summaryrefslogtreecommitdiff
path: root/java/app_test.go
diff options
context:
space:
mode:
author Anton Hansson <hansson@google.com> 2019-01-30 16:03:37 +0000
committer Anton Hansson <hansson@google.com> 2019-01-30 16:07:56 +0000
commit94c93f37cb9ecfdce877bfa3710b3f552fa8e5c6 (patch)
tree32ddf0e555b687ee87b9197535dd2ae925e6323e /java/app_test.go
parentee0413915438f2cfe1b84ae4be64d3974e80be85 (diff)
Allow excluding specific overlay sub-directories
This change allows PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS to refer to subdirectories of directories in PRODUCT_PACKAGE_OVERLAYS, e.g.: PRODUCT_PACKAGE_OVERLAYS := foo/overlay PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS := foo/overlay/packages/apps/HelloWorld Bug: 118823052 Test: m nothing (soong tests) Change-Id: Ic9f89c11d023ea1b4f6f2f6683d94c81aa7b8a1b
Diffstat (limited to 'java/app_test.go')
-rw-r--r--java/app_test.go19
1 files changed, 12 insertions, 7 deletions
diff --git a/java/app_test.go b/java/app_test.go
index 7e06dba71..21bda3c42 100644
--- a/java/app_test.go
+++ b/java/app_test.go
@@ -149,9 +149,13 @@ var testEnforceRROTests = []struct {
},
},
{
- name: "enforce RRO on all",
- enforceRROTargets: []string{"*"},
- enforceRROExcludedOverlays: []string{"device/vendor/blah/static_overlay"},
+ name: "enforce RRO on all",
+ enforceRROTargets: []string{"*"},
+ enforceRROExcludedOverlays: []string{
+ // Excluding specific apps/res directories also allowed.
+ "device/vendor/blah/static_overlay/foo",
+ "device/vendor/blah/static_overlay/bar/res",
+ },
overlayFiles: map[string][]string{
"foo": []string{"device/vendor/blah/static_overlay/foo/res/values/strings.xml"},
"bar": []string{"device/vendor/blah/static_overlay/bar/res/values/strings.xml"},
@@ -208,11 +212,12 @@ func TestEnforceRRO(t *testing.T) {
getOverlays := func(moduleName string) ([]string, []string) {
module := ctx.ModuleForTests(moduleName, "android_common")
- overlayCompiledPaths := module.Output("aapt2/overlay.list").Inputs.Strings()
-
+ overlayFile := module.MaybeOutput("aapt2/overlay.list")
var overlayFiles []string
- for _, o := range overlayCompiledPaths {
- overlayFiles = append(overlayFiles, module.Output(o).Inputs.Strings()...)
+ if overlayFile.Rule != nil {
+ for _, o := range overlayFile.Inputs.Strings() {
+ overlayFiles = append(overlayFiles, module.Output(o).Inputs.Strings()...)
+ }
}
rroDirs := module.Module().(*AndroidApp).rroDirs.Strings()