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/UnvalidatedAndroidDirectories.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/UnvalidatedAndroidDirectories.java')
-rw-r--r-- | src/tools/android/java/com/google/devtools/build/android/UnvalidatedAndroidDirectories.java | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/tools/android/java/com/google/devtools/build/android/UnvalidatedAndroidDirectories.java b/src/tools/android/java/com/google/devtools/build/android/UnvalidatedAndroidDirectories.java index f87da7fbf0..5723f6ec61 100644 --- a/src/tools/android/java/com/google/devtools/build/android/UnvalidatedAndroidDirectories.java +++ b/src/tools/android/java/com/google/devtools/build/android/UnvalidatedAndroidDirectories.java @@ -30,9 +30,7 @@ public class UnvalidatedAndroidDirectories { private static final Pattern VALID_REGEX = Pattern.compile(".*:.*"); - static String expectedFormat() { - return "resources[#resources]:assets[#assets]"; - } + public static final String EXPECTED_FORMAT = "resources[#resources]:assets[#assets]"; public static UnvalidatedAndroidDirectories valueOf(String text) { return valueOf(text, FileSystems.getDefault()); @@ -42,7 +40,7 @@ public class UnvalidatedAndroidDirectories { static UnvalidatedAndroidDirectories 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 UnvalidatedAndroidDirectories( |