aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/android/AndroidConfiguration.java
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2017-11-22 10:21:00 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2017-11-22 10:22:28 -0800
commit2d05d10362fd6a360a2447eebb6138ff05757ec2 (patch)
tree3d60dc0ffd5e8700927e96c65c10bcb0c757aa06 /src/main/java/com/google/devtools/build/lib/rules/android/AndroidConfiguration.java
parentd55acc31ec7c731481a3691e6cf91c53869e9c67 (diff)
Don't propagate resources when neverlink is specified and manifest is not
We already handle this properly in the normal case. However, when no attributes from the new implementation of resource processing are specified, we fall back to the old version, which didn't handle this. RELNOTES: none PiperOrigin-RevId: 176672081
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/android/AndroidConfiguration.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/android/AndroidConfiguration.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidConfiguration.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidConfiguration.java
index 6b48275d3f..e4b8c4d845 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidConfiguration.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidConfiguration.java
@@ -670,6 +670,17 @@ public class AndroidConfiguration extends BuildConfiguration.Fragment {
)
public boolean inheritResourcesInTests;
+ @Option(
+ name = "android_fixed_resource_neverlinking",
+ defaultValue = "false",
+ documentationCategory = OptionDocumentationCategory.UNDOCUMENTED,
+ effectTags = {OptionEffectTag.LOADING_AND_ANALYSIS},
+ help = "If true, resources will properly not get propagated through neverlinked libraries."
+ + " Otherwise, the old behavior of propagating those resources if no resource-related"
+ + " attributes are specified in the neverlink library will be preserved."
+ )
+ public boolean fixedResourceNeverlinking;
+
@Override
public FragmentOptions getHost() {
Options host = (Options) super.getHost();
@@ -753,6 +764,7 @@ public class AndroidConfiguration extends BuildConfiguration.Fragment {
private final boolean allowResourcesAttr;
private final boolean inheritResourcesInTests;
private final boolean skipParsingAction;
+ private final boolean fixedResourceNeverlinking;
AndroidConfiguration(Options options) throws InvalidConfigurationException {
@@ -791,6 +803,7 @@ public class AndroidConfiguration extends BuildConfiguration.Fragment {
this.allowResourcesAttr = options.allowResourcesAttr;
this.inheritResourcesInTests = options.inheritResourcesInTests;
this.skipParsingAction = options.skipParsingAction;
+ this.fixedResourceNeverlinking = options.fixedResourceNeverlinking;
if (!dexoptsSupportedInIncrementalDexing.contains("--no-locals")) {
// TODO(bazel-team): Still needed? See DexArchiveAspect
@@ -954,6 +967,10 @@ public class AndroidConfiguration extends BuildConfiguration.Fragment {
return this.skipParsingAction;
}
+ public boolean fixedResourceNeverlinking() {
+ return this.fixedResourceNeverlinking;
+ }
+
@Override
public void addGlobalMakeVariables(ImmutableMap.Builder<String, String> globalMakeEnvBuilder) {
globalMakeEnvBuilder.put("ANDROID_CPU", cpu);