aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/android/MergedAndroidResources.java
diff options
context:
space:
mode:
authorGravatar asteinb <asteinb@google.com>2018-05-03 08:09:09 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-05-03 08:10:55 -0700
commit158dda74f4d6d33b88be4ab4c40322eca5f1c2fd (patch)
tree9d666848416b0b59328c2e6e3b11e221be1f3905 /src/main/java/com/google/devtools/build/lib/rules/android/MergedAndroidResources.java
parent70821069b0e39249eb0f23cf16ca4438c9703a7b (diff)
Fix up newly discovered bugs in decoupled Android data processing
- Always generate a symbols file - the new resource processing pipeline likes knowing that this is non-null, and it shouldn't cost much extra to create. - A misleading method signature (which I made) led to me forgetting about Proguard artifacts. Properly propogate them into the ResourceApk object. - Don't get Aapt version directly from AndroidConfiguration - there's some additional logic in AndroidAaptVersion not exposed elsewhere - Split library tests that expect resources and assets to be processed together to have a new version where they're processed seperately. - Tests use ValidatedAndroidData interface rather than ResourceContainer object - Properly move some LocalTest magic around resource JAR out of the old pipeline only, as it should apply to both old and new pipelines. - Processing action defaults to empty resource and asset deps rather than null RELNOTES: none PiperOrigin-RevId: 195253161
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/android/MergedAndroidResources.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/android/MergedAndroidResources.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/MergedAndroidResources.java b/src/main/java/com/google/devtools/build/lib/rules/android/MergedAndroidResources.java
index 717159a143..07c274ac81 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/android/MergedAndroidResources.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/android/MergedAndroidResources.java
@@ -39,12 +39,12 @@ public class MergedAndroidResources extends ParsedAndroidResources {
public static MergedAndroidResources mergeFrom(
RuleContext ruleContext, ParsedAndroidResources parsed, boolean neverlink)
- throws InterruptedException {
+ throws InterruptedException, RuleErrorException {
AndroidConfiguration androidConfiguration = AndroidCommon.getAndroidConfig(ruleContext);
boolean useCompiledMerge =
- androidConfiguration.getAndroidAaptVersion().equals(AndroidAaptVersion.AAPT2)
+ AndroidAaptVersion.chooseTargetAaptVersion(ruleContext) == AndroidAaptVersion.AAPT2
&& androidConfiguration.skipParsingAction();
Preconditions.checkState(
@@ -141,7 +141,8 @@ public class MergedAndroidResources extends ParsedAndroidResources {
* <p>See {@link ValidatedAndroidResources#validateFrom(RuleContext, MergedAndroidResources)}.
* This method is a convenience method for calling that one.
*/
- public ValidatedAndroidResources validate(RuleContext ruleContext) throws InterruptedException {
+ public ValidatedAndroidResources validate(RuleContext ruleContext)
+ throws InterruptedException, RuleErrorException {
return ValidatedAndroidResources.validateFrom(ruleContext, this);
}