summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGoogler <noreply@google.com>2016-07-27 17:23:39 +0000
committerColin Cross <ccross@android.com>2017-02-16 22:36:54 -0800
commita80c538f420f60cf4ab0130c8c6b2a8488ebd827 (patch)
tree56611e8926155707bca6143a7e2ad6af4f7566a1
parent90a0b5534c12b4a249d390dcb07d3ded3400c189 (diff)
downloaddesugar-a80c538f420f60cf4ab0130c8c6b2a8488ebd827.tar.gz
Add a resource parsing action.
Part of 3 proposed new actions: - parsing action - merging action - validating action Dependencies (directData and transitiveData) expect the symbol files. If the merge action produces the symbol files, then each merge action depends on each other. Instead, produce it in an action with just source resources as prereqs to allow more parallelism. Technically, we don't need a manifest as part of the parameters. I debated about whether to introduce a basic version of UnvalidatedAndroidData or not. -- MOS_MIGRATED_REVID=128599714 GitOrigin-RevId: fcd684775f21d8fc38228368c6ac4b2a0213def5 Change-Id: Ib7a5ac5845e6be340ea825a82e5bd4d6069fa6c6
-rw-r--r--java/com/google/devtools/build/android/Converters.java26
1 files changed, 24 insertions, 2 deletions
diff --git a/java/com/google/devtools/build/android/Converters.java b/java/com/google/devtools/build/android/Converters.java
index bcbfa97..464e793 100644
--- a/java/com/google/devtools/build/android/Converters.java
+++ b/java/com/google/devtools/build/android/Converters.java
@@ -67,8 +67,30 @@ public final class Converters {
@Override
public String getTypeDescription() {
- return "unvalidated android data in the format "
- + "resources[#resources]:assets[#assets]:manifest";
+ return "unvalidated android data in the format " + UnvalidatedAndroidData.expectedFormat();
+ }
+ }
+
+ /**
+ * Converter for {@link UnvalidatedAndroidDirectories}.
+ */
+ public static class UnvalidatedAndroidDirectoriesConverter
+ implements Converter<UnvalidatedAndroidDirectories> {
+
+ @Override
+ public UnvalidatedAndroidDirectories convert(String input) throws OptionsParsingException {
+ try {
+ return UnvalidatedAndroidDirectories.valueOf(input);
+ } catch (IllegalArgumentException e) {
+ throw new OptionsParsingException(
+ String.format("invalid UnvalidatedAndroidDirectories: %s", e.getMessage()), e);
+ }
+ }
+
+ @Override
+ public String getTypeDescription() {
+ return "unvalidated android directories in the format "
+ + UnvalidatedAndroidDirectories.expectedFormat();
}
}