diff --git a/androidmk/cmd/androidmk/android.go b/androidmk/cmd/androidmk/android.go index b3d5aec56..99b35237f 100644 --- a/androidmk/cmd/androidmk/android.go +++ b/androidmk/cmd/androidmk/android.go @@ -161,24 +161,25 @@ func init() { addStandardProperties(bpparser.BoolType, map[string]string{ // Bool properties - "LOCAL_IS_HOST_MODULE": "host", - "LOCAL_CLANG": "clang", - "LOCAL_FORCE_STATIC_EXECUTABLE": "static_executable", - "LOCAL_NATIVE_COVERAGE": "native_coverage", - "LOCAL_NO_CRT": "nocrt", - "LOCAL_ALLOW_UNDEFINED_SYMBOLS": "allow_undefined_symbols", - "LOCAL_RTTI_FLAG": "rtti", - "LOCAL_NO_STANDARD_LIBRARIES": "no_standard_libs", - "LOCAL_PACK_MODULE_RELOCATIONS": "pack_relocations", - "LOCAL_TIDY": "tidy", - "LOCAL_USE_CLANG_LLD": "use_clang_lld", - "LOCAL_PROPRIETARY_MODULE": "proprietary", - "LOCAL_VENDOR_MODULE": "vendor", - "LOCAL_ODM_MODULE": "device_specific", - "LOCAL_PRODUCT_MODULE": "product_specific", - "LOCAL_PRODUCT_SERVICES_MODULE": "product_services_specific", - "LOCAL_EXPORT_PACKAGE_RESOURCES": "export_package_resources", - "LOCAL_PRIVILEGED_MODULE": "privileged", + "LOCAL_IS_HOST_MODULE": "host", + "LOCAL_CLANG": "clang", + "LOCAL_FORCE_STATIC_EXECUTABLE": "static_executable", + "LOCAL_NATIVE_COVERAGE": "native_coverage", + "LOCAL_NO_CRT": "nocrt", + "LOCAL_ALLOW_UNDEFINED_SYMBOLS": "allow_undefined_symbols", + "LOCAL_RTTI_FLAG": "rtti", + "LOCAL_NO_STANDARD_LIBRARIES": "no_standard_libs", + "LOCAL_PACK_MODULE_RELOCATIONS": "pack_relocations", + "LOCAL_TIDY": "tidy", + "LOCAL_USE_CLANG_LLD": "use_clang_lld", + "LOCAL_PROPRIETARY_MODULE": "proprietary", + "LOCAL_VENDOR_MODULE": "vendor", + "LOCAL_ODM_MODULE": "device_specific", + "LOCAL_PRODUCT_MODULE": "product_specific", + "LOCAL_PRODUCT_SERVICES_MODULE": "product_services_specific", + "LOCAL_EXPORT_PACKAGE_RESOURCES": "export_package_resources", + "LOCAL_PRIVILEGED_MODULE": "privileged", + "LOCAL_AAPT_INCLUDE_ALL_RESOURCES": "aapt_include_all_resources", "LOCAL_DEX_PREOPT": "dex_preopt.enabled", "LOCAL_DEX_PREOPT_APP_IMAGE": "dex_preopt.app_image", diff --git a/java/aar.go b/java/aar.go index a06d19164..3ab07cc90 100644 --- a/java/aar.go +++ b/java/aar.go @@ -47,6 +47,10 @@ type aaptProperties struct { // flags passed to aapt when creating the apk Aaptflags []string + // include all resource configurations, not just the product-configured + // ones. + Aapt_include_all_resources *bool + // list of directories relative to the Blueprints file containing assets. // Defaults to "assets" Asset_dirs []string diff --git a/java/app.go b/java/app.go index 1e92b8ce6..db6c15ce5 100644 --- a/java/app.go +++ b/java/app.go @@ -194,14 +194,16 @@ func (a *AndroidApp) generateAndroidBuildActions(ctx android.ModuleContext) { linkFlags = append(linkFlags, "--product", ctx.Config().ProductAAPTCharacteristics()) } - // Product AAPT config - for _, aaptConfig := range ctx.Config().ProductAAPTConfig() { - linkFlags = append(linkFlags, "-c", aaptConfig) - } + if !Bool(a.aaptProperties.Aapt_include_all_resources) { + // Product AAPT config + for _, aaptConfig := range ctx.Config().ProductAAPTConfig() { + linkFlags = append(linkFlags, "-c", aaptConfig) + } - // Product AAPT preferred config - if len(ctx.Config().ProductAAPTPreferredConfig()) > 0 { - linkFlags = append(linkFlags, "--preferred-density", ctx.Config().ProductAAPTPreferredConfig()) + // Product AAPT preferred config + if len(ctx.Config().ProductAAPTPreferredConfig()) > 0 { + linkFlags = append(linkFlags, "--preferred-density", ctx.Config().ProductAAPTPreferredConfig()) + } } // TODO: LOCAL_PACKAGE_OVERRIDES