aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/analysis/actions/CustomCommandLine.java
diff options
context:
space:
mode:
authorGravatar tomlu <tomlu@google.com>2017-08-11 19:47:42 +0200
committerGravatar Irina Iancu <elenairina@google.com>2017-08-14 14:13:46 +0200
commite13280fbd29dd0b349794890c1d5ddf6e332042a (patch)
tree2bee4db4a1b8683c19b93c480c289dbb5e8862a4 /src/main/java/com/google/devtools/build/lib/analysis/actions/CustomCommandLine.java
parente8069cf0aebe0b1577700e3be25baa307d1b2074 (diff)
Use CustomCommandLine.Builder in SpawnAction always.
This takes advantage of CustomCommandLine's ability to defer argument expansion. I can't think of any situation where this would be inferior, at it also cleans up the code a little. After the execution phase when Artifact strings will have been prodded and interned, I expect the memory difference to be less pronounced. PiperOrigin-RevId: 164996323
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.java10
1 files changed, 10 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 83adf2e6ac..9ef6545700 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
@@ -605,12 +605,22 @@ public final class CustomCommandLine extends CommandLine {
public CustomCommandLine build() {
return new CustomCommandLine(arguments);
}
+
+ public boolean isEmpty() {
+ return arguments.isEmpty();
+ }
}
public static Builder builder() {
return new Builder();
}
+ public static Builder builder(Builder other) {
+ Builder builder = new Builder();
+ builder.arguments.addAll(other.arguments);
+ return builder;
+ }
+
private final ImmutableList<Object> arguments;
/**