diff options
author | Googler <noreply@google.com> | 2016-07-26 15:07:43 +0000 |
---|---|---|
committer | Damien Martin-Guillerez <dmarting@google.com> | 2016-07-27 11:14:10 +0000 |
commit | 3b16a284b202e410d3b1bc9b14a578773e530b18 (patch) | |
tree | 7f07ae337f9ddb6743cfcdcf487cee8b87404bf1 /src/main/java/com | |
parent | f61d12e9e4f940810efbaf244911a94830ba6c05 (diff) |
Moves exports_manifest attribute to AndroidLibraryBaseRule instead of
AndroidResourceSupportRule. This removes the exports_manifest attribute from
AndroidBinaryBaseRule and its children.
RELNOTES: Removes exports_manifest attribute from android_binary rule.
--
MOS_MIGRATED_REVID=128472120
Diffstat (limited to 'src/main/java/com')
3 files changed, 14 insertions, 7 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidLibraryBaseRule.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidLibraryBaseRule.java index 778ff8d579..14a13d6cf8 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidLibraryBaseRule.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidLibraryBaseRule.java @@ -95,6 +95,11 @@ public final class AndroidLibraryBaseRule implements RuleDefinition { .allowedFileTypes(/*May not have files in exports!*/) .aspect(jackAspect) .aspect(androidNeverlinkAspect)) + /* <!-- #BLAZE_RULE(android_library).ATTRIBUTE(exports_manifest) --> + Whether to export manifest entries to <code>android_binary</code> targets + that depend on this target. <code>uses-permissions</code> attributes are never exported. + <!-- #END_BLAZE_RULE.ATTRIBUTE --> */ + .add(attr("exports_manifest", BOOLEAN).value(false)) .add(attr("alwayslink", BOOLEAN).undocumented("purely informational for now")) /* <!-- #BLAZE_RULE(android_library).ATTRIBUTE(neverlink) --> Only use this library for compilation and not at runtime. diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidResourceContainerBuilder.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidResourceContainerBuilder.java index c1011d90ac..47dd0c3090 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidResourceContainerBuilder.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidResourceContainerBuilder.java @@ -73,7 +73,7 @@ public final class AndroidResourceContainerBuilder { data.getResources(), data.getAssetRoots(), data.getResourceRoots(), - ruleContext.attributes().get("exports_manifest", Type.BOOLEAN), + getExportsManifest(ruleContext), rOutput, symbolsFile); } @@ -96,6 +96,13 @@ public final class AndroidResourceContainerBuilder { return ruleContext.attributes().isAttributeValueExplicitlySpecified("custom_package"); } + private boolean getExportsManifest(RuleContext ruleContext) { + // AndroidLibraryBaseRule has exports_manifest but AndroidBinaryBaseRule does not. + // ResourceContainers are built for both, so we must check if exports_manifest is present. + return ruleContext.attributes().has("exports_manifest", Type.BOOLEAN) + && ruleContext.attributes().get("exports_manifest", Type.BOOLEAN); + } + @Nullable private String getRenameManifestPackage(RuleContext ruleContext) { return ruleContext.attributes().isAttributeValueExplicitlySpecified("rename_manifest_package") @@ -107,4 +114,4 @@ public final class AndroidResourceContainerBuilder { this.symbolsFile = symbolsFile; return this; } -}
\ No newline at end of file +} diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidRuleClasses.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidRuleClasses.java index 197c1552fd..1c2eb2b72c 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidRuleClasses.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidRuleClasses.java @@ -435,11 +435,6 @@ public final class AndroidRuleClasses { Must be defined if resource_files or assets are defined. <!-- #END_BLAZE_RULE.ATTRIBUTE --> */ .add(attr("manifest", LABEL).legacyAllowAnyFileType()) - /* <!-- #BLAZE_RULE($android_resource_support).ATTRIBUTE(exports_manifest) --> - Whether to export manifest entries to <code>android_binary</code> targets - that depend on this target. <code>uses-permissions</code> attributes are never exported. - <!-- #END_BLAZE_RULE.ATTRIBUTE --> */ - .add(attr("exports_manifest", BOOLEAN).value(false)) /* <!-- #BLAZE_RULE($android_resource_support).ATTRIBUTE(resource_files) --> The list of resources to be packaged. This is typically a <code>glob</code> of all files under the |