Add `aapt_include_all_resources`
The equivalent of Make's LOCAL_AAPT_INCLUDE_ALL_RESOURCES.
Test: build LatinIME with Soong
Change-Id: Ib76bea5f28e365b59fa9477b9bceabb84012ff8e
diff --git a/java/aar.go b/java/aar.go
index a06d191..3ab07cc 100644
--- a/java/aar.go
+++ b/java/aar.go
@@ -47,6 +47,10 @@
// 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 1e92b8c..db6c15c 100644
--- a/java/app.go
+++ b/java/app.go
@@ -194,14 +194,16 @@
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