diff options
author | Googler <noreply@google.com> | 2017-08-15 17:57:39 +0200 |
---|---|---|
committer | Irina Iancu <elenairina@google.com> | 2017-08-16 11:05:17 +0200 |
commit | 7481de4637998750a0f0eda2e39d09a5a9f84be9 (patch) | |
tree | c1b70e92a488ed963f2822335f9812a481613329 /src/tools/android/java/com | |
parent | e29cb64e2b47d90f734beb4319d1ac708cb039a6 (diff) |
android_library can be used in the resources attribute
This allows us to perform a more gradual migration away from the
android_resources rule. Specifically, rather than move all android_resources
targets and simultaneously move all resources attributes, we can now first
transform all android_resources rules into android_library rules, and then
afterwards migrate dependencies on those rules from resources into deps. This
allows a two-part migration.
The resources attribute, once allowed to take android_library targets, should
continue to work exactly as before.
There is one change in behavior - for this to work, android_library targets now
need to build an output APK during resource processing. This APK will be
removed once the resources attribute is removed.
Once the migration is complete, the resources attribute will be removed
completely.
RELNOTES: none
PiperOrigin-RevId: 165313447
Diffstat (limited to 'src/tools/android/java/com')
-rw-r--r-- | src/tools/android/java/com/google/devtools/build/android/AndroidResourceValidatorAction.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/tools/android/java/com/google/devtools/build/android/AndroidResourceValidatorAction.java b/src/tools/android/java/com/google/devtools/build/android/AndroidResourceValidatorAction.java index e277cb2c80..616eeb2377 100644 --- a/src/tools/android/java/com/google/devtools/build/android/AndroidResourceValidatorAction.java +++ b/src/tools/android/java/com/google/devtools/build/android/AndroidResourceValidatorAction.java @@ -106,6 +106,18 @@ public class AndroidResourceValidatorAction { help = "Path to where the R.txt should be written." ) public Path rOutput; + + @Option( + name = "packagePath", + defaultValue = "null", + converter = PathConverter.class, + category = "output", + documentationCategory = OptionDocumentationCategory.UNCATEGORIZED, + effectTags = {OptionEffectTag.UNKNOWN}, + help = "Path to the write the archive." + ) + // TODO(b/30307842): Remove this once it is no longer needed for resources migration. + public Path packagePath; } public static void main(String[] args) throws Exception { @@ -152,7 +164,7 @@ public class AndroidResourceValidatorAction { resources, assets, generatedSources, - null, /* packageOut */ + options.packagePath, null, /* proguardOut */ null, /* mainDexProguardOut */ null /* publicResourcesOut */); |