Remove sdk_version: "none" restriction

Not entirely sure what the history behind requiring only libcore
projects use this, but it is a bit annoying to have to allow-list every
use.

Bug: 173606718
Test: m nothing
Change-Id: I66f71e67d3f17e7f983c8537dff537fe8419da95
This commit is contained in:
Anton Hansson
2020-12-17 15:36:00 +00:00
parent 1a74be780b
commit 0af20effc1
2 changed files with 0 additions and 77 deletions

View File

@@ -51,7 +51,6 @@ var neverallows = []Rule{}
func init() {
AddNeverAllowRules(createIncludeDirsRules()...)
AddNeverAllowRules(createTrebleRules()...)
AddNeverAllowRules(createLibcoreRules()...)
AddNeverAllowRules(createMediaRules()...)
AddNeverAllowRules(createJavaDeviceForHostRules()...)
AddNeverAllowRules(createCcSdkVariantRules()...)
@@ -133,38 +132,6 @@ func createTrebleRules() []Rule {
}
}
func createLibcoreRules() []Rule {
var coreLibraryProjects = []string{
"libcore",
"external/apache-harmony",
"external/apache-xml",
"external/bouncycastle",
"external/conscrypt",
"external/icu",
"external/okhttp",
"external/wycheproof",
"prebuilts",
}
// 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$")),
}
return rules
}
func createMediaRules() []Rule {
return []Rule{
NeverAllow().