Change CLI flag and Gradle name for proxy options (#526)

Rationale: "proxy" can mean very different things (e.g. java.lang.reflect.Proxy in Java).
This makes the flag name more specific.

CLI:
* `--proxy` -> `--http-proxy`
* `--no-proxy` -> `--http-no-proxy`

Gradle:
* `proxyAddress` -> `httpProxy`
* `noProxy` -> `httpNoProxy`
This commit is contained in:
Daniel Chao
2024-06-14 08:08:21 -07:00
committed by GitHub
parent 380095c8a7
commit f15ad6ec06
9 changed files with 27 additions and 27 deletions

View File

@@ -130,10 +130,10 @@ data class CliBaseOptions(
val caCertificates: List<Path> = listOf(),
/** The proxy to connect to. */
val proxyAddress: URI? = null,
val httpProxy: URI? = null,
/** Hostnames, IP addresses, or CIDR blocks to not proxy. */
val noProxy: List<String>? = null,
val httpNoProxy: List<String>? = null,
) {
companion object {

View File

@@ -160,12 +160,12 @@ abstract class CliCommand(protected val cliOptions: CliBaseOptions) {
}
private val proxyAddress by lazy {
cliOptions.proxyAddress
cliOptions.httpProxy
?: project?.evaluatorSettings?.http?.proxy?.address ?: settings.http?.proxy?.address
}
private val noProxy by lazy {
cliOptions.noProxy
cliOptions.httpNoProxy
?: project?.evaluatorSettings?.http?.proxy?.noProxy ?: settings.http?.proxy?.noProxy
}

View File

@@ -175,7 +175,7 @@ class BaseOptions : OptionGroup() {
@Suppress("HttpUrlsUsage")
val proxy: URI? by
option(
names = arrayOf("--proxy"),
names = arrayOf("--http-proxy"),
metavar = "<address>",
help = "Proxy to use for HTTP(S) connections."
)
@@ -191,7 +191,7 @@ class BaseOptions : OptionGroup() {
val noProxy: List<String>? by
option(
names = arrayOf("--no-proxy"),
names = arrayOf("--http-no-proxy"),
metavar = "<pattern1,pattern2>",
help = "Hostnames that should not be connected to via a proxy."
)
@@ -229,8 +229,8 @@ class BaseOptions : OptionGroup() {
omitProjectSettings = projectOptions?.omitProjectSettings ?: false,
noProject = projectOptions?.noProject ?: false,
caCertificates = caCertificates,
proxyAddress = proxy,
noProxy = noProxy ?: emptyList()
httpProxy = proxy,
httpNoProxy = noProxy ?: emptyList()
)
}
}