Add dont_merge_manifests attribute to android_test

Bug: 122332514
Test: treehugger, convert cts/tests/tests/content
Change-Id: Ib66fcafd7c31913402cd390dfecce292b1817729
This commit is contained in:
Sasha Smundak 2019-10-28 15:50:06 -07:00
parent 05491b4861
commit 541056c3fa
2 changed files with 5 additions and 1 deletions

View file

@ -198,6 +198,7 @@ func init() {
"LOCAL_EXPORT_PACKAGE_RESOURCES": "export_package_resources",
"LOCAL_PRIVILEGED_MODULE": "privileged",
"LOCAL_AAPT_INCLUDE_ALL_RESOURCES": "aapt_include_all_resources",
"LOCAL_DONT_MERGE_MANIFESTS": "dont_merge_manifests",
"LOCAL_USE_EMBEDDED_NATIVE_LIBS": "use_embedded_native_libs",
"LOCAL_USE_EMBEDDED_DEX": "use_embedded_dex",

View file

@ -72,6 +72,9 @@ type aaptProperties struct {
// 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 @@ func (a *aapt) buildActions(ctx android.ModuleContext, sdkContext sdkContext, ex
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