aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/android/ResourceShrinkerActionBuilder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/android/ResourceShrinkerActionBuilder.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/android/ResourceShrinkerActionBuilder.java35
1 files changed, 19 insertions, 16 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/ResourceShrinkerActionBuilder.java b/src/main/java/com/google/devtools/build/lib/rules/android/ResourceShrinkerActionBuilder.java
index d87b7dbd0d..dd9fea6ea3 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/android/ResourceShrinkerActionBuilder.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/android/ResourceShrinkerActionBuilder.java
@@ -20,6 +20,7 @@ import com.google.devtools.build.lib.actions.Artifact;
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.CustomCommandLine;
+import com.google.devtools.build.lib.analysis.actions.CustomCommandLine.VectorArg;
import com.google.devtools.build.lib.analysis.actions.SpawnAction;
import com.google.devtools.build.lib.analysis.config.CompilationMode;
import com.google.devtools.build.lib.packages.RuleClass.ConfiguredTargetFactory.RuleErrorException;
@@ -161,20 +162,22 @@ public class ResourceShrinkerActionBuilder {
.getRunfilesSupport()
.getRunfilesArtifactsWithoutMiddlemen());
- commandLine.addExecPath("--aapt", sdk.getAapt().getExecutable());
+ commandLine.add("--aapt", sdk.getAapt().getExecutable());
- commandLine.addExecPath("--annotationJar", sdk.getAnnotationsJar());
+ commandLine.add("--annotationJar", sdk.getAnnotationsJar());
inputs.add(sdk.getAnnotationsJar());
- commandLine.addExecPath("--androidJar", sdk.getAndroidJar());
+ commandLine.add("--androidJar", sdk.getAndroidJar());
inputs.add(sdk.getAndroidJar());
if (!uncompressedExtensions.isEmpty()) {
- commandLine.addJoinStrings(
- "--uncompressedExtensions", ",", ImmutableList.copyOf(uncompressedExtensions));
+ commandLine.add(
+ "--uncompressedExtensions",
+ VectorArg.of(ImmutableList.copyOf(uncompressedExtensions)).joinWith(","));
}
if (!assetsToIgnore.isEmpty()) {
- commandLine.addJoinStrings("--assetsToIgnore", ",", ImmutableList.copyOf(assetsToIgnore));
+ commandLine.add(
+ "--assetsToIgnore", VectorArg.of(ImmutableList.copyOf(assetsToIgnore)).joinWith(","));
}
if (ruleContext.getConfiguration().getCompilationMode() != CompilationMode.OPT) {
commandLine.add("--debug");
@@ -191,38 +194,38 @@ public class ResourceShrinkerActionBuilder {
checkNotNull(primaryResources.getManifest());
checkNotNull(resourceApkOut);
- commandLine.addExecPath("--resources", resourceFilesZip);
+ commandLine.add("--resources", resourceFilesZip);
inputs.add(resourceFilesZip);
- commandLine.addExecPath("--shrunkJar", shrunkJar);
+ commandLine.add("--shrunkJar", shrunkJar);
inputs.add(shrunkJar);
- commandLine.addExecPath("--proguardMapping", proguardMapping);
+ commandLine.add("--proguardMapping", proguardMapping);
inputs.add(proguardMapping);
- commandLine.addExecPath("--rTxt", primaryResources.getRTxt());
+ commandLine.add("--rTxt", primaryResources.getRTxt());
inputs.add(primaryResources.getRTxt());
- commandLine.addExecPath("--primaryManifest", primaryResources.getManifest());
+ commandLine.add("--primaryManifest", primaryResources.getManifest());
inputs.add(primaryResources.getManifest());
ImmutableList<Artifact> dependencyManifests = getManifests(dependencyResources);
if (!dependencyManifests.isEmpty()) {
- commandLine.addExecPaths("--dependencyManifest", dependencyManifests);
+ commandLine.add("--dependencyManifest", dependencyManifests);
inputs.addAll(dependencyManifests);
}
ImmutableList<String> resourcePackages =
getResourcePackages(primaryResources, dependencyResources);
- commandLine.addJoinStrings("--resourcePackages", ",", resourcePackages);
+ commandLine.add("--resourcePackages", VectorArg.of(resourcePackages).joinWith(","));
- commandLine.addExecPath("--shrunkResourceApk", resourceApkOut);
+ commandLine.add("--shrunkResourceApk", resourceApkOut);
outputs.add(resourceApkOut);
- commandLine.addExecPath("--shrunkResources", shrunkResourcesOut);
+ commandLine.add("--shrunkResources", shrunkResourcesOut);
outputs.add(shrunkResourcesOut);
- commandLine.addExecPath("--log", logOut);
+ commandLine.add("--log", logOut);
outputs.add(logOut);
ruleContext.registerAction(