From aca944916a59aab74042a9c08b9ed99b0a13d492 Mon Sep 17 00:00:00 2001 From: Roland Levillain Date: Thu, 13 Feb 2020 15:22:05 +0000 Subject: [PATCH] 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 --- android/neverallow.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/android/neverallow.go b/android/neverallow.go index 26e42e656..526d39949 100644 --- a/android/neverallow.go +++ b/android/neverallow.go @@ -145,11 +145,18 @@ func createLibcoreRules() []Rule { "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$")), }