Add "art/test" to the list of Core Library projects.
Allow modules under art/test to use `sdk_version: "none"`. This is so
that ART run-test module definitions can use the same settings as
Libcore tests:
sdk_version: "none",
system_modules: "core-all-system-modules",
Test: m nothing
Bug: 147814778
Change-Id: Ibb74d6a06a6609be511403c51ca7a02204bf606f
diff --git a/android/neverallow.go b/android/neverallow.go
index 26e42e6..526d399 100644
--- a/android/neverallow.go
+++ b/android/neverallow.go
@@ -145,11 +145,18 @@
"prebuilts",
}
- // Core library constraints. The sdk_version: "none" can only be used in core library projects.
+ // Additional whitelisted path only used for ART testing, which needs access to core library
+ // targets. This does not affect the contents of a device image (system, vendor, etc.).
+ var artTests = []string{
+ "art/test",
+ }
+
+ // Core library constraints. The sdk_version: "none" can only be used in core library projects and ART tests.
// Access to core library targets is restricted using visibility rules.
rules := []Rule{
NeverAllow().
NotIn(coreLibraryProjects...).
+ NotIn(artTests...).
With("sdk_version", "none").
WithoutMatcher("name", Regexp("^android_.*stubs_current$")),
}