aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools/android/java/com/google/devtools/build/android/aapt2/Aapt2ConfigOptions.java
diff options
context:
space:
mode:
authorGravatar corysmith <corysmith@google.com>2017-08-23 19:01:08 +0200
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2017-08-24 13:58:47 +0200
commit827d3d2f3350417d33f9f7caf614c7e48aabb071 (patch)
tree46ba2106449aed6414dff72a017e5513eee19a45 /src/tools/android/java/com/google/devtools/build/android/aapt2/Aapt2ConfigOptions.java
parenta7271d28ba82a24d235da2cf57045bac042d1bb7 (diff)
Final tweaks and fixes to enable aapt2 for Blaze.
Implemented processing databinding for compile passes RELNOTES: None PiperOrigin-RevId: 166215052
Diffstat (limited to 'src/tools/android/java/com/google/devtools/build/android/aapt2/Aapt2ConfigOptions.java')
-rw-r--r--src/tools/android/java/com/google/devtools/build/android/aapt2/Aapt2ConfigOptions.java99
1 files changed, 99 insertions, 0 deletions
diff --git a/src/tools/android/java/com/google/devtools/build/android/aapt2/Aapt2ConfigOptions.java b/src/tools/android/java/com/google/devtools/build/android/aapt2/Aapt2ConfigOptions.java
index ada69bc1a3..0225041418 100644
--- a/src/tools/android/java/com/google/devtools/build/android/aapt2/Aapt2ConfigOptions.java
+++ b/src/tools/android/java/com/google/devtools/build/android/aapt2/Aapt2ConfigOptions.java
@@ -18,11 +18,14 @@ package com.google.devtools.build.android.aapt2;
import com.android.repository.Revision;
import com.google.devtools.build.android.Converters.ExistingPathConverter;
import com.google.devtools.build.android.Converters.RevisionConverter;
+import com.google.devtools.common.options.Converters.CommaSeparatedOptionListConverter;
import com.google.devtools.common.options.Option;
import com.google.devtools.common.options.OptionDocumentationCategory;
import com.google.devtools.common.options.OptionEffectTag;
import com.google.devtools.common.options.OptionsBase;
+import com.google.devtools.common.options.TriState;
import java.nio.file.Path;
+import java.util.List;
/** Aaprt2 specific configuration options. */
public class Aapt2ConfigOptions extends OptionsBase {
@@ -58,4 +61,100 @@ public class Aapt2ConfigOptions extends OptionsBase {
help = "Path to the android jar for resource packaging and building apks."
)
public Path androidJar;
+
+ @Option(
+ name = "annotationJar",
+ defaultValue = "null",
+ converter = ExistingPathConverter.class,
+ category = "tool",
+ documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
+ effectTags = {OptionEffectTag.UNKNOWN},
+ help = "Path to the android jar for resource packaging and building apks."
+ )
+ public Path annotationJar;
+
+
+ @Option(
+ name = "useAaptCruncher",
+ defaultValue = "auto",
+ category = "config",
+ documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
+ effectTags = {OptionEffectTag.UNKNOWN},
+ help =
+ "Use the legacy aapt cruncher, defaults to true for non-LIBRARY packageTypes. "
+ + " LIBRARY packages do not benefit from the additional processing as the resources"
+ + " will need to be reprocessed during the generation of the final apk. See"
+ + " https://code.google.com/p/android/issues/detail?id=67525 for a discussion of the"
+ + " different png crunching methods."
+ )
+ public TriState useAaptCruncher;
+
+ @Option(
+ name = "uncompressedExtensions",
+ defaultValue = "",
+ converter = CommaSeparatedOptionListConverter.class,
+ category = "config",
+ documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
+ effectTags = {OptionEffectTag.UNKNOWN},
+ help = "A list of file extensions not to compress."
+ )
+ public List<String> uncompressedExtensions;
+
+ @Option(
+ name = "assetsToIgnore",
+ defaultValue = "",
+ converter = CommaSeparatedOptionListConverter.class,
+ category = "config",
+ documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
+ effectTags = {OptionEffectTag.UNKNOWN},
+ help = "A list of assets extensions to ignore."
+ )
+ public List<String> assetsToIgnore;
+
+ @Option(
+ name = "debug",
+ defaultValue = "false",
+ category = "config",
+ documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
+ effectTags = {OptionEffectTag.UNKNOWN},
+ help = "Indicates if it is a debug build."
+ )
+ public boolean debug;
+
+ @Option(
+ name = "resourceConfigs",
+ defaultValue = "",
+ converter = CommaSeparatedOptionListConverter.class,
+ category = "config",
+ documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
+ effectTags = {OptionEffectTag.UNKNOWN},
+ help = "A list of resource config filters to pass to aapt."
+ )
+ public List<String> resourceConfigs;
+
+ private static final String ANDROID_SPLIT_DOCUMENTATION_URL =
+ "https://developer.android.com/guide/topics/resources/providing-resources.html"
+ + "#QualifierRules";
+
+ @Option(
+ name = "split",
+ defaultValue = "required but ignored due to allowMultiple",
+ category = "config",
+ documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
+ effectTags = {OptionEffectTag.UNKNOWN},
+ allowMultiple = true,
+ help =
+ "An individual split configuration to pass to aapt."
+ + " Each split is a list of configuration filters separated by commas."
+ + " Configuration filters are lists of configuration qualifiers separated by dashes,"
+ + " as used in resource directory names and described on the Android developer site: "
+ + ANDROID_SPLIT_DOCUMENTATION_URL
+ + " For example, a split might be 'en-television,en-xxhdpi', containing English"
+ + " assets which either are for TV screens or are extra extra high resolution."
+ + " Multiple splits can be specified by passing this flag multiple times."
+ + " Each split flag will produce an additional output file, named by replacing the"
+ + " commas in the split specification with underscores, and appending the result to"
+ + " the output package name following an underscore."
+ )
+ public List<String> splits;
}