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
@@ -282,7 +282,7 @@ public class PklPlugin implements Plugin<Project> {
spec.getTestPort().convention(-1);
spec.getNoProxy().convention(List.of());
spec.getHttpNoProxy().convention(List.of());
}
private void configureCodeGenSpec(CodeGenSpec spec) {
@@ -427,8 +427,8 @@ public class PklPlugin implements Plugin<Project> {
task.getModuleCacheDir().set(spec.getModuleCacheDir());
task.getEvalTimeout().set(spec.getEvalTimeout());
task.getTestPort().set(spec.getTestPort());
task.getProxyAddress().set(spec.getProxyAddress());
task.getNoProxy().set(spec.getNoProxy());
task.getHttpProxy().set(spec.getHttpProxy());
task.getHttpNoProxy().set(spec.getHttpNoProxy());
}
private <T extends ModulesTask, S extends ModulesSpec> void configureModulesTask(T task, S spec) {
@@ -52,7 +52,7 @@ public interface BasePklSpec {
Property<Integer> getTestPort();
Property<URI> getProxyAddress();
Property<URI> getHttpProxy();
ListProperty<String> getNoProxy();
ListProperty<String> getHttpNoProxy();
}
@@ -127,11 +127,11 @@ public abstract class BasePklTask extends DefaultTask {
@Input
@Optional
public abstract Property<URI> getProxyAddress();
public abstract Property<URI> getHttpProxy();
@Input
@Optional
public abstract ListProperty<String> getNoProxy();
public abstract ListProperty<String> getHttpNoProxy();
@TaskAction
public void runTask() {
@@ -165,8 +165,8 @@ public abstract class BasePklTask extends DefaultTask {
false,
getTestPort().getOrElse(-1),
Collections.emptyList(),
getProxyAddress().getOrNull(),
getNoProxy().getOrElse(List.of()));
getHttpProxy().getOrNull(),
getHttpNoProxy().getOrElse(List.of()));
}
return cachedOptions;
}