diff options
author | 2017-11-21 05:57:15 -0800 | |
---|---|---|
committer | 2017-11-21 05:58:44 -0800 | |
commit | bb60ca44caff02f8c21678b860a4526a3b5beac5 (patch) | |
tree | e5e37f599222f9468b30d5ad4b2b8789cac3cdc7 /src/main/java/com/google/devtools/build | |
parent | 34d02ef1a47cdb7847fdd12e96d7532dc7e0d7df (diff) |
Update AndroidConfiguration to reflect changes
RELNOTES: none
PiperOrigin-RevId: 176496770
Diffstat (limited to 'src/main/java/com/google/devtools/build')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/android/AndroidBinary.java | 17 | ||||
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/android/AndroidConfiguration.java | 21 |
2 files changed, 9 insertions, 29 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 de767540c7..1bfcac40af 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 @@ -296,15 +296,14 @@ public abstract class AndroidBinary implements RuleConfiguredTargetFactory { boolean shrinkResources = shouldShrinkResources(ruleContext); - NestedSet<Artifact> excludedRuntimeArtifacts = null; - if (!androidConfig.includeLibraryResourceJars()) { - // Remove the library resource JARs from the binary's runtime classpath. - // Resource classes from android_library dependencies are replaced by the binary's resource - // class. We remove them only at the top level so that resources included by a library that is - // a dependency of a java_library are still included, since these resources are propagated via - // android-specific providers and won't show up when we collect the library resource JARs. - excludedRuntimeArtifacts = getLibraryResourceJars(ruleContext); - } + // Remove the library resource JARs from the binary's runtime classpath. + // Resource classes from android_library dependencies are replaced by the binary's resource + // class. We remove them only at the top level so that resources included by a library that is + // a dependency of a java_library are still included, since these resources are propagated via + // android-specific providers and won't show up when we collect the library resource JARs. + // TODO(b/69552500): Instead, handle this properly so R JARs aren't put on the classpath for + // both binaries and libraries. + NestedSet<Artifact> excludedRuntimeArtifacts = getLibraryResourceJars(ruleContext); JavaTargetAttributes resourceClasses = androidCommon.init( javaSemantics, 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 df9ceccbb0..41d9f50e02 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 @@ -600,19 +600,6 @@ public class AndroidConfiguration extends BuildConfiguration.Fragment { public boolean compressJavaResources; @Option( - name = "experimental_android_include_library_resource_jars", - defaultValue = "false", - documentationCategory = OptionDocumentationCategory.UNDOCUMENTED, - effectTags = {OptionEffectTag.UNKNOWN}, - help = - "Specifies whether resource JAR files for android_library targets should be included" - + " as runtime dependencies. Defaults to the old behavior, including them. These JARs" - + " are not nessecary for normal use as all required resources are included in the" - + " top-level android_binary resource JAR." - ) - public boolean includeLibraryResourceJars; - - @Option( name = "experimental_android_library_exports_manifest_default", defaultValue = "false", documentationCategory = OptionDocumentationCategory.UNCATEGORIZED, @@ -662,7 +649,7 @@ public class AndroidConfiguration extends BuildConfiguration.Fragment { @Option( name = "experimental_android_inherit_resources_in_tests", - defaultValue = "false", + defaultValue = "true", documentationCategory = OptionDocumentationCategory.UNDOCUMENTED, effectTags = {OptionEffectTag.LOADING_AND_ANALYSIS}, help = "If true, local_resource_files indicates that resource files should be inherited" @@ -745,7 +732,6 @@ public class AndroidConfiguration extends BuildConfiguration.Fragment { private final boolean useSingleJarApkBuilder; private final ResourceFilterFactory resourceFilterFactory; private final boolean compressJavaResources; - private final boolean includeLibraryResourceJars; private final boolean exportsManifestDefault; private final AndroidAaptVersion androidAaptVersion; private final boolean throwOnResourceConflict; @@ -783,7 +769,6 @@ public class AndroidConfiguration extends BuildConfiguration.Fragment { this.useRexToCompressDexFiles = options.useRexToCompressDexFiles; this.resourceFilterFactory = options.resourceFilterFactory; this.compressJavaResources = options.compressJavaResources; - this.includeLibraryResourceJars = options.includeLibraryResourceJars; this.exportsManifestDefault = options.exportsManifestDefault; this.androidAaptVersion = options.androidAaptVersion; this.throwOnResourceConflict = options.throwOnResourceConflict; @@ -927,10 +912,6 @@ public class AndroidConfiguration extends BuildConfiguration.Fragment { return compressJavaResources; } - public boolean includeLibraryResourceJars() { - return includeLibraryResourceJars; - } - boolean getExportsManifestDefault() { return exportsManifestDefault; } |