aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google
diff options
context:
space:
mode:
authorGravatar tomlu <tomlu@google.com>2017-08-22 21:32:54 +0200
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2017-08-23 13:28:56 +0200
commita3781a2b1fc87ba0023d7613305580c77da8ba0b (patch)
treebc49cc59b8cc55438a79461da1057df90c163ead /src/main/java/com/google
parent1a5f12992b32c9ed9c3263e31019ce79b98ed69d (diff)
Use CustomCommandLine directly instead of via SpawnAction.Builder.
This change forces use of CustomCommandLine.Builder, which has a richer interface for constructing memory-efficient command lines. It will also permit surveying the code base for inefficient patterns using an IDE. This change was done by hand and split using Rosie to assist with rollbacks in case of bugs. Reviewers, please pay particular attention to: * Each all to addInputArgument/addOutputArgument should come with a corresponding matching pair to SpawnAction.Builder#addInput and CustomCommandLine.Builder#addExecPath (eg.). * The commandLine must be set on the SpawnAction using SpawnAction.Builder#setCommandLine. Note that most calls to addPrefixed("arg=", val) should be more idiomatically expressed as add("arg", val), but this involves changing tests and making sure that the command line tools can accept the format. PiperOrigin-RevId: 166097992
Diffstat (limited to 'src/main/java/com/google')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java
index 2a2145cfcb..fba1b24ba5 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java
@@ -389,9 +389,12 @@ public final class ReleaseBundlingSupport {
ObjcRuleClasses.spawnAppleEnvActionBuilder(configuration, platform)
.setMnemonic("EnvironmentPlist")
.setExecutable(attributes.environmentPlist())
- .addArguments("--platform", platformWithVersion)
- .addArguments("--output", getGeneratedEnvironmentPlist().getExecPathString())
.addOutput(getGeneratedEnvironmentPlist())
+ .setCommandLine(
+ CustomCommandLine.builder()
+ .add("--platform", platformWithVersion)
+ .addExecPath("--output", getGeneratedEnvironmentPlist())
+ .build())
.build(ruleContext));
}
@@ -603,10 +606,13 @@ public final class ReleaseBundlingSupport {
new SpawnAction.Builder()
.setMnemonic("MergeEntitlementsFiles")
.setExecutable(attributes.plmerge())
- .addArgument("--control")
- .addInputArgument(plMergeControlArtifact)
.addTransitiveInputs(entitlements)
.addOutput(intermediateArtifacts.entitlements())
+ .addInput(plMergeControlArtifact)
+ .setCommandLine(
+ CustomCommandLine.builder()
+ .addExecPath("--control", plMergeControlArtifact)
+ .build())
.build(ruleContext));
}
@@ -852,9 +858,11 @@ public final class ReleaseBundlingSupport {
.setMnemonic("IosBundle")
.setProgressMessage("Bundling iOS application: %s", ruleContext.getLabel())
.setExecutable(attributes.bundleMergeExecutable())
- .addInputArgument(bundleMergeControlArtifact)
+ .addInput(bundleMergeControlArtifact)
.addTransitiveInputs(bundling.getBundleContentArtifacts())
.addOutput(intermediateArtifacts.unprocessedIpa())
+ .setCommandLine(
+ CustomCommandLine.builder().addExecPath(bundleMergeControlArtifact).build())
.build(ruleContext));
}