diff options
author | Googler <noreply@google.com> | 2016-08-29 17:06:53 +0000 |
---|---|---|
committer | Klaus Aehlig <aehlig@google.com> | 2016-08-30 08:32:45 +0000 |
commit | 5963ae7407f32cf25ebbe7e046f5bc5d0240aae3 (patch) | |
tree | 99a600b92832aaa12d52ee46b05ed1045ff60261 /src/tools/android/java/com/google/devtools/build/android/UnvalidatedAndroidData.java | |
parent | 012b06b0a89ae76e623f8844da3a787841da757c (diff) |
Add a lightweight resource merge action.
Part 2 of the 3 new proposed android_library res
processing actions. The primary and deps are all
assumed to be parsed+summarized in a protobuf.
Represent that with a new class (similar to
DependencyAndroidData but w/out R.txt).
Avoid having "manifest" artifacts as deps input,
and instead use "label", since that is only used
in a warning. DepAD still uses the manifest for
#asSymbolFileProvider, so we keep it there.
Move loading the primary out of the merge function
so that we can share the merge function with this
style of primary data, and the existing style of
of primary data (UnvalidatedAndroidData).
This produces an R class.jar and a zip file to
pass along to a future validation action. Images
are stubbed out since they are irrelevant to the
validation action.
--
MOS_MIGRATED_REVID=131604421
Diffstat (limited to 'src/tools/android/java/com/google/devtools/build/android/UnvalidatedAndroidData.java')
-rw-r--r-- | src/tools/android/java/com/google/devtools/build/android/UnvalidatedAndroidData.java | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/tools/android/java/com/google/devtools/build/android/UnvalidatedAndroidData.java b/src/tools/android/java/com/google/devtools/build/android/UnvalidatedAndroidData.java index beeeba7e37..20717d6005 100644 --- a/src/tools/android/java/com/google/devtools/build/android/UnvalidatedAndroidData.java +++ b/src/tools/android/java/com/google/devtools/build/android/UnvalidatedAndroidData.java @@ -31,9 +31,7 @@ import java.util.regex.Pattern; class UnvalidatedAndroidData extends UnvalidatedAndroidDirectories { private static final Pattern VALID_REGEX = Pattern.compile(".*:.*:.+"); - static String expectedFormat() { - return "resources[#resources]:assets[#assets]:manifest"; - } + public static final String EXPECTED_FORMAT = "resources[#resources]:assets[#assets]:manifest"; public static UnvalidatedAndroidData valueOf(String text) { return valueOf(text, FileSystems.getDefault()); @@ -43,7 +41,7 @@ class UnvalidatedAndroidData extends UnvalidatedAndroidDirectories { static UnvalidatedAndroidData valueOf(String text, FileSystem fileSystem) { if (!VALID_REGEX.matcher(text).find()) { throw new IllegalArgumentException( - text + " is not in the format '" + expectedFormat() + "'"); + text + " is not in the format '" + EXPECTED_FORMAT + "'"); } String[] parts = text.split(":"); return new UnvalidatedAndroidData( |