diff options
author | 2016-04-15 20:35:59 +0000 | |
---|---|---|
committer | 2016-04-18 10:43:19 +0000 | |
commit | 1bdf2f49edf67c699b0ffe4a35dd89673c7d9dc8 (patch) | |
tree | e05ca9b35f892096fe00b58d0ac77da2a5f90c5e /src/main/java/com/google/devtools/build/lib/rules/android/AndroidResourcesProcessorBuilder.java | |
parent | ea81a7037f761c10516cfa6ef1eeee7e4bcc7d07 (diff) |
Add a crunch_png attribute to android_binary
This allows a user to turn off png crunching during
the final merge (with crunch_png = 0), but it does
not skip nine-patch processing.
RELNOTES: adds crunch_png attribute to android_binary
--
MOS_MIGRATED_REVID=119986498
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/android/AndroidResourcesProcessorBuilder.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/android/AndroidResourcesProcessorBuilder.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidResourcesProcessorBuilder.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidResourcesProcessorBuilder.java index 3e4ec6b69b..2c3606f1e1 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidResourcesProcessorBuilder.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidResourcesProcessorBuilder.java @@ -78,6 +78,7 @@ public class AndroidResourcesProcessorBuilder { private Artifact manifestOut; private Artifact mergedResourcesOut; private boolean isLibrary; + private boolean crunchPng = true; /** * @param ruleContext The RuleContext that was used to create the SpawnAction.Builder. @@ -108,6 +109,11 @@ public class AndroidResourcesProcessorBuilder { return this; } + public AndroidResourcesProcessorBuilder setCrunchPng(boolean crunchPng) { + this.crunchPng = crunchPng; + return this; + } + public AndroidResourcesProcessorBuilder setDensities(List<String> densities) { this.densities = densities; return this; @@ -325,6 +331,9 @@ public class AndroidResourcesProcessorBuilder { if (!uncompressedExtensions.isEmpty()) { builder.addJoinStrings("--uncompressedExtensions", ",", uncompressedExtensions); } + if (!crunchPng) { + builder.add("--useAaptCruncher=no"); + } if (!assetsToIgnore.isEmpty()) { builder.addJoinStrings("--assetsToIgnore", ",", assetsToIgnore); } |