diff options
author | 2018-05-22 08:38:40 -0700 | |
---|---|---|
committer | 2018-05-22 08:40:04 -0700 | |
commit | 06e43f8b56ca50d7b87c7963d2251d1c72c00977 (patch) | |
tree | b41965fdb1f2b6d91c8c0b2ac19e14ea7c4b18b2 /src/main/java/com/google/devtools/build/lib/rules/android/AndroidBinary.java | |
parent | 85a6f166cef1231f1e436978171870ce6b10a6d8 (diff) |
Pass AndroidDataContext through manifest processing methods
Manifest processing methods are particularly messy for this migration, since
the old ApplicationManifest class is still around. Anyway, pass around
AndroidDataContext instead of RuleContext everywhere we can.
Note that the built-in expander does not seem able to be modified to support
decoupling attributes and other information, and thus really can't be done once
we get rid of RuleContext. Instead, for Skylark rules, document that expansion
must happen outside of the Android data Skylark method calls (for example, for
manifest_values and nocompress_extensions).
RELNOTES: none
PiperOrigin-RevId: 197567541
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/android/AndroidBinary.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/android/AndroidBinary.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidBinary.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidBinary.java index 43805cd013..b023c46031 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidBinary.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidBinary.java @@ -202,7 +202,12 @@ public abstract class AndroidBinary implements RuleConfiguredTargetFactory { if (AndroidResources.decoupleDataProcessing(dataContext)) { StampedAndroidManifest manifest = - AndroidManifest.fromAttributes(ruleContext, androidSemantics).mergeWithDeps(ruleContext); + AndroidManifest.fromAttributes(ruleContext, dataContext, androidSemantics) + .mergeWithDeps( + dataContext, + resourceDeps, + ApplicationManifest.getManifestValues(ruleContext), + ApplicationManifest.useLegacyMerging(ruleContext)); applicationManifest = ApplicationManifest.fromExplicitManifest(ruleContext, manifest.getManifest()); @@ -237,7 +242,9 @@ public abstract class AndroidBinary implements RuleConfiguredTargetFactory { .generateRClass(dataContext, aaptVersion); } else { applicationManifest = - androidSemantics.getManifestForRule(ruleContext).mergeWith(ruleContext, resourceDeps); + androidSemantics + .getManifestForRule(ruleContext) + .mergeWith(ruleContext, dataContext, resourceDeps); Artifact featureOfArtifact = ruleContext.attributes().isAttributeValueExplicitlySpecified("feature_of") |