aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/analysis/actions/CustomCommandLine.java
diff options
context:
space:
mode:
authorGravatar laszlocsomor <laszlocsomor@google.com>2017-07-17 13:09:48 +0200
committerGravatar Klaus Aehlig <aehlig@google.com>2017-07-17 13:41:43 +0200
commit5752463ece84ebb4fb074888cba57412ab8d86b3 (patch)
treec2c11cd91141f603045703b0054e0427165db066 /src/main/java/com/google/devtools/build/lib/analysis/actions/CustomCommandLine.java
parent8ed126b66fc3c06bfa597aa84a4d031b1669c02c (diff)
AndroidBusyBox: deprecate path-list-type flags
This commit: - deprecates PathListConverter - removes ExistingPathListConverter because it was not used in production, only tests - deprecated List<Path> type flags that use PathListConverter - introduces new List<Path> type flags next to the deprecated ones that use @Options.allowMultiple and convert with PathConverter; the new and old lists are concatenated, yielding the flag value PathListConverter and all of its occurrences should be removed after 2018-01-31 (about 6 months from now, which is a safe enough timeframe for everyone to upgrade Bazel so it uses the new-style flags). Reason for deprecation is that colon-separated path lists don't work on Windows because paths have colons in them. Since the Android BusyBox is not intended to be executed by users but by Bazel only, there's no release notes necessary. See https://github.com/bazelbuild/bazel/issues/3264 RELNOTES: none PiperOrigin-RevId: 162193998
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/analysis/actions/CustomCommandLine.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/actions/CustomCommandLine.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/actions/CustomCommandLine.java b/src/main/java/com/google/devtools/build/lib/analysis/actions/CustomCommandLine.java
index b05b0394c6..2ed135ba79 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/actions/CustomCommandLine.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/actions/CustomCommandLine.java
@@ -411,6 +411,22 @@ public final class CustomCommandLine extends CommandLine {
}
/**
+ * For every element in `artifacts`, adds the `arg` followed by the exec path of the artifact.
+ *
+ * <p>Results in adding: <code>[arg, execpath1, arg, execpath2, ...]</code>.
+ *
+ * <p>Has no effect if `artifacts` is null or empty.
+ */
+ public Builder addExecPaths(String arg, @Nullable Iterable<Artifact> artifacts) {
+ Preconditions.checkNotNull(arg);
+ if (artifacts != null && !Iterables.isEmpty(artifacts)) {
+ arguments.add(
+ InterspersingArgs.fromExecPaths(artifacts, /*beforeEach=*/ arg, /*formatEach=*/ null));
+ }
+ return this;
+ }
+
+ /**
* Adds a placeholder TreeArtifact exec path. When the command line is used in an action
* template, the placeholder will be replaced by the exec path of a {@link TreeFileArtifact}
* inside the TreeArtifact at execution time for each expanded action.