aboutsummaryrefslogtreecommitdiffstats
path: root/sdk/sdk_test.go
diff options
context:
space:
mode:
authorPaul Duffin <paulduffin@google.com>2020-02-19 16:10:09 +0000
committerPaul Duffin <paulduffin@google.com>2020-02-20 11:41:17 +0000
commit44885e29d619d216455931059367490ffc403534 (patch)
tree846c5045488389a213fc52d248981b02b9799c9f /sdk/sdk_test.go
parent7fa7646ad7fc341b60f7a37805b38848b68c9d5f (diff)
downloadbuild_soong-44885e29d619d216455931059367490ffc403534.tar.gz
build_soong-44885e29d619d216455931059367490ffc403534.tar.bz2
build_soong-44885e29d619d216455931059367490ffc403534.zip
Simplify visibility rules that include //visibility:public
While it is invalid to mix //visibility:public with other rules in the visibility property in a .bp file tt was possible, by overriding defaults, to have //visibility:public mixed in with other rules in the effective visibility rules. That caused problems when those effective rules were used in an sdk snapshot. This change replaces any set of rules that include //visibility:public with just the //visibility:public rule. That simplifies those rules, making them cheaper to process and ensures that the effective rules are valid in the visibility property. Adding test support required some refactoring of the effectiveVisibilityRules(BaseModuleContext, ...) and underlying methods to take a Config instead of BaseModuleContext as the tests do not have access to BaseModuleContext. Bug: 142935992 Test: m nothing - new tests failed without change, work with it Add dex2oat to art-module-host-exports, build it and check the generated Android.bp file in the snapshot to ensure the visibility property for the dex2oat prebuilt does not mix //visibility:public with other rules. Change-Id: I08e7f0dcb40838d426fe88fedf69eae27b77473c
Diffstat (limited to 'sdk/sdk_test.go')
-rw-r--r--sdk/sdk_test.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/sdk/sdk_test.go b/sdk/sdk_test.go
index d376e590..934bdae0 100644
--- a/sdk/sdk_test.go
+++ b/sdk/sdk_test.go
@@ -111,8 +111,14 @@ func TestSnapshotVisibility(t *testing.T) {
sdk_version: "none",
}
+ java_defaults {
+ name: "java-defaults",
+ visibility: ["//other/bar"],
+ }
+
java_library {
name: "mypublicjavalib",
+ defaults: ["java-defaults"],
visibility: ["//visibility:public"],
srcs: ["Test.java"],
system_modules: "none",