Add dont_merge_manifests attribute to android_test
Bug: 122332514
Test: treehugger, convert cts/tests/tests/content
Change-Id: Ib66fcafd7c31913402cd390dfecce292b1817729
diff --git a/java/aar.go b/java/aar.go
index 6426ac3..96eb5c0 100644
--- a/java/aar.go
+++ b/java/aar.go
@@ -72,6 +72,9 @@
// paths to additional manifest files to merge with main manifest.
Additional_manifests []string `android:"path"`
+
+ // do not include AndroidManifest from dependent libraries
+ Dont_merge_manifests *bool
}
type aapt struct {
@@ -225,7 +228,7 @@
a.transitiveManifestPaths = append(android.Paths{manifestPath}, additionalManifests...)
a.transitiveManifestPaths = append(a.transitiveManifestPaths, transitiveStaticLibManifests...)
- if len(a.transitiveManifestPaths) > 1 {
+ if len(a.transitiveManifestPaths) > 1 && !Bool(a.aaptProperties.Dont_merge_manifests) {
a.mergedManifestFile = manifestMerger(ctx, a.transitiveManifestPaths[0], a.transitiveManifestPaths[1:], a.isLibrary)
if !a.isLibrary {
// Only use the merged manifest for applications. For libraries, the transitive closure of manifests