aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/android/AndroidResourceMergingActionBuilder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/android/AndroidResourceMergingActionBuilder.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/android/AndroidResourceMergingActionBuilder.java27
1 files changed, 12 insertions, 15 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidResourceMergingActionBuilder.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidResourceMergingActionBuilder.java
index 0d39a8696d..fe0b68f22e 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidResourceMergingActionBuilder.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidResourceMergingActionBuilder.java
@@ -22,6 +22,7 @@ import com.google.devtools.build.lib.analysis.RuleConfiguredTarget.Mode;
import com.google.devtools.build.lib.analysis.RuleContext;
import com.google.devtools.build.lib.analysis.actions.ActionConstructionContext;
import com.google.devtools.build.lib.analysis.actions.CustomCommandLine;
+import com.google.devtools.build.lib.analysis.actions.ParamFileInfo;
import com.google.devtools.build.lib.analysis.actions.SpawnAction;
import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder;
import com.google.devtools.build.lib.rules.android.ResourceContainerConverter.Builder.SeparatorType;
@@ -182,20 +183,16 @@ public class AndroidResourceMergingActionBuilder {
}
SpawnAction.Builder spawnActionBuilder = new SpawnAction.Builder();
-
- if (OS.getCurrent() == OS.WINDOWS) {
- // Some flags (e.g. --mainData) may specify lists (or lists of lists) separated by special
- // characters (colon, semicolon, hashmark, ampersand) that don't work on Windows, and quoting
- // semantics are very complicated (more so than in Bash), so let's just always use a parameter
- // file.
- // TODO(laszlocsomor), TODO(corysmith): restructure the Android BusyBux's flags by deprecating
- // list-type and list-of-list-type flags that use such problematic separators in favor of
- // multi-value flags (to remove one level of listing) and by changing all list separators to a
- // platform-safe character (= comma).
- spawnActionBuilder.alwaysUseParameterFile(ParameterFileType.UNQUOTED);
- } else {
- spawnActionBuilder.useParameterFile(ParameterFileType.UNQUOTED);
- }
+ ParamFileInfo.Builder paramFileInfo = ParamFileInfo.builder(ParameterFileType.UNQUOTED);
+ // Some flags (e.g. --mainData) may specify lists (or lists of lists) separated by special
+ // characters (colon, semicolon, hashmark, ampersand) that don't work on Windows, and quoting
+ // semantics are very complicated (more so than in Bash), so let's just always use a parameter
+ // file.
+ // TODO(laszlocsomor), TODO(corysmith): restructure the Android BusyBux's flags by deprecating
+ // list-type and list-of-list-type flags that use such problematic separators in favor of
+ // multi-value flags (to remove one level of listing) and by changing all list separators to a
+ // platform-safe character (= comma).
+ paramFileInfo.setUseAlways(OS.getCurrent() == OS.WINDOWS);
// Create the spawn action.
ruleContext.registerAction(
@@ -203,7 +200,7 @@ public class AndroidResourceMergingActionBuilder {
.useDefaultShellEnvironment()
.addTransitiveInputs(inputs.build())
.addOutputs(ImmutableList.copyOf(outs))
- .setCommandLine(builder.build())
+ .addCommandLine(builder.build(), paramFileInfo.build())
.setExecutable(
ruleContext.getExecutablePrerequisite("$android_resources_busybox", Mode.HOST))
.setProgressMessage("Merging Android resources for %s", ruleContext.getLabel())