diff options
author | 2023-06-14 23:14:42 +0000 | |
---|---|---|
committer | 2023-06-15 18:51:57 +0000 | |
commit | 3d4d88d68e5b5796cf4d9d236793df5322a1eab5 (patch) | |
tree | 8f7e268b23ddfd2a351bca31ff48efd485f22e6b | |
parent | 1147b31eb0e2e9df822b1e89b2eed9bae87c4f00 (diff) |
Allow java_library.exclude_static_libs property for libcore and f/b/api
exclude_static_lib property was introduced to enable static lib
switching based on build configuration. The usage of property was
limited to build/soong directory to prevent other modules from using the
proerty.
In order to allow "core-lambda-stubs" and
"android-non-updatable.stubs.*" to utilize similar static lib switching
based on build configuration, allow exclude_static_libs property to be
used in libcore and frameworks/base/api directory.
Test: m nothing
Bug: 287344503
Change-Id: I342b09c7ada03607b12dc8896ae39825d8545e92
-rw-r--r-- | android/neverallow.go | 4 | ||||
-rw-r--r-- | android/neverallow_test.go | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/android/neverallow.go b/android/neverallow.go index f2e8c8534..73f8f4b51 100644 --- a/android/neverallow.go +++ b/android/neverallow.go @@ -256,10 +256,10 @@ func createProhibitFrameworkAccessRules() []Rule { func createJavaExcludeStaticLibsRule() Rule { return NeverAllow(). - NotIn("build/soong"). + NotIn("build/soong", "libcore", "frameworks/base/api"). ModuleType("java_library"). WithMatcher("exclude_static_libs", isSetMatcherInstance). - Because("exclude_static_libs property is only allowed for java modules defined in build/soong") + Because("exclude_static_libs property is only allowed for java modules defined in build/soong, libcore, and frameworks/base/api") } func neverallowMutator(ctx BottomUpMutatorContext) { diff --git a/android/neverallow_test.go b/android/neverallow_test.go index 1639bbf40..2a938b811 100644 --- a/android/neverallow_test.go +++ b/android/neverallow_test.go @@ -358,7 +358,7 @@ var neverallowTests = []struct { `), }, expectedErrors: []string{ - `exclude_static_libs property is only allowed for java modules defined in build/soong`, + `exclude_static_libs property is only allowed for java modules defined in build/soong, libcore, and frameworks/base/api`, }, }, } |