aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools/android/java/com/google/devtools/build/android/aapt2
diff options
context:
space:
mode:
authorGravatar jingwen <jingwen@google.com>2017-12-18 08:24:12 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2017-12-18 08:25:32 -0800
commit094caa508fa74081d861e9e8f8eb50934811bf65 (patch)
treec6911010ba0c7dea50fa13ee718f93719b43eb8a /src/tools/android/java/com/google/devtools/build/android/aapt2
parent310fe150811c6abe0c52232eb5cb0e4380a6e084 (diff)
Automatic formatting cleanup of Android *.java files.
RELNOTES: None. PiperOrigin-RevId: 179425421
Diffstat (limited to 'src/tools/android/java/com/google/devtools/build/android/aapt2')
-rw-r--r--src/tools/android/java/com/google/devtools/build/android/aapt2/Aapt2ConfigOptions.java139
-rw-r--r--src/tools/android/java/com/google/devtools/build/android/aapt2/CompiledResources.java4
-rw-r--r--src/tools/android/java/com/google/devtools/build/android/aapt2/StaticLibrary.java9
3 files changed, 72 insertions, 80 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 6d8d614116..1b402eaf90 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
@@ -63,29 +63,28 @@ public class Aapt2ConfigOptions extends OptionsBase {
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."
+ 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."
+ 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;
@@ -100,45 +99,45 @@ public class Aapt2ConfigOptions extends OptionsBase {
public TriState conditionalKeepRules;
@Option(
- name = "uncompressedExtensions",
- defaultValue = "",
- converter = CommaSeparatedOptionListConverter.class,
- category = "config",
- documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
- effectTags = {OptionEffectTag.UNKNOWN},
- help = "A list of file extensions not to compress."
+ 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."
+ 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."
+ 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."
+ 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;
@@ -147,34 +146,34 @@ public class Aapt2ConfigOptions extends OptionsBase {
+ "#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."
+ 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;
@Option(
- name = "useCompiledResourcesForMerge",
- defaultValue = "false",
- category = "config",
- documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
- effectTags = {OptionEffectTag.UNKNOWN},
- help = "Use compiled resources for merging rather than parsed symbols binary."
+ name = "useCompiledResourcesForMerge",
+ defaultValue = "false",
+ category = "config",
+ documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
+ effectTags = {OptionEffectTag.UNKNOWN},
+ help = "Use compiled resources for merging rather than parsed symbols binary."
)
public boolean useCompiledResourcesForMerge;
}
diff --git a/src/tools/android/java/com/google/devtools/build/android/aapt2/CompiledResources.java b/src/tools/android/java/com/google/devtools/build/android/aapt2/CompiledResources.java
index 2e96319a81..65200f6b52 100644
--- a/src/tools/android/java/com/google/devtools/build/android/aapt2/CompiledResources.java
+++ b/src/tools/android/java/com/google/devtools/build/android/aapt2/CompiledResources.java
@@ -65,9 +65,7 @@ public class CompiledResources implements ManifestContainer {
resources, manifest, assetDirs != null ? assetDirs : ImmutableList.of(), Optional.empty());
}
- /**
- * This zip file contains resource flat files that are the result of aapt2 compile
- */
+ /** This zip file contains resource flat files that are the result of aapt2 compile */
public Path getZip() {
return resources;
}
diff --git a/src/tools/android/java/com/google/devtools/build/android/aapt2/StaticLibrary.java b/src/tools/android/java/com/google/devtools/build/android/aapt2/StaticLibrary.java
index 142d7fefb1..a8b27e9e8c 100644
--- a/src/tools/android/java/com/google/devtools/build/android/aapt2/StaticLibrary.java
+++ b/src/tools/android/java/com/google/devtools/build/android/aapt2/StaticLibrary.java
@@ -57,13 +57,8 @@ public class StaticLibrary {
return new StaticLibrary(library, rTxt, assets, sourceJar);
}
- public static StaticLibrary from(
- Path library, Path rTxt, ImmutableList<Path> assetDirs) {
- return of(
- library,
- Optional.ofNullable(rTxt),
- Optional.ofNullable(assetDirs),
- Optional.empty());
+ public static StaticLibrary from(Path library, Path rTxt, ImmutableList<Path> assetDirs) {
+ return of(library, Optional.ofNullable(rTxt), Optional.ofNullable(assetDirs), Optional.empty());
}
public static StaticLibrary from(