diff options
author | 2024-09-30 18:46:51 +0000 | |
---|---|---|
committer | 2024-10-02 17:19:18 +0000 | |
commit | 8bce3818334988d4ac7da979c7a8a529613c455b (patch) | |
tree | dc15298aa934374377b23107642eee0b24a0d426 | |
parent | 46694ccbbd2207e3346b2580206862640ca11734 (diff) |
Remove the java property `exclude_static_libs`
All usages of the property has been converted to using select syntax.
Test: m nothing --no-skip-soong-tests
Bug: 368127911
Change-Id: I130f15d8524b56b6905c4dd3e7283731f437f88d
-rw-r--r-- | android/neverallow.go | 9 | ||||
-rw-r--r-- | android/neverallow_test.go | 17 | ||||
-rw-r--r-- | java/base.go | 5 | ||||
-rw-r--r-- | java/java_test.go | 31 |
4 files changed, 1 insertions, 61 deletions
diff --git a/android/neverallow.go b/android/neverallow.go index b89d150cb..e135f5780 100644 --- a/android/neverallow.go +++ b/android/neverallow.go @@ -58,7 +58,6 @@ func init() { AddNeverAllowRules(createInitFirstStageRules()...) AddNeverAllowRules(createProhibitFrameworkAccessRules()...) AddNeverAllowRules(createCcStubsRule()) - AddNeverAllowRules(createJavaExcludeStaticLibsRule()) AddNeverAllowRules(createProhibitHeaderOnlyRule()) AddNeverAllowRules(createLimitNdkExportRule()...) } @@ -253,14 +252,6 @@ func createProhibitFrameworkAccessRules() []Rule { } } -func createJavaExcludeStaticLibsRule() Rule { - return NeverAllow(). - 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, libcore, and frameworks/base/api") -} - func createProhibitHeaderOnlyRule() Rule { return NeverAllow(). Without("name", "framework-minus-apex-headers"). diff --git a/android/neverallow_test.go b/android/neverallow_test.go index b2620ef92..192c92409 100644 --- a/android/neverallow_test.go +++ b/android/neverallow_test.go @@ -344,23 +344,6 @@ var neverallowTests = []struct { `module "outside_allowed_list": violates neverallow`, }, }, - // Test for the rule restricting use of exclude_static_libs - { - name: `"exclude_static_libs" outside allowed directory`, - fs: map[string][]byte{ - "a/b/Android.bp": []byte(` - java_library { - name: "baz", - exclude_static_libs: [ - "bar", - ], - } - `), - }, - expectedErrors: []string{ - `exclude_static_libs property is only allowed for java modules defined in build/soong, libcore, and frameworks/base/api`, - }, - }, // Test for only allowing headers_only for framework-minus-apex-headers { name: `"headers_only" outside framework-minus-apex-headers modules`, diff --git a/java/base.go b/java/base.go index 7c26cc355..32bfc17f9 100644 --- a/java/base.go +++ b/java/base.go @@ -83,9 +83,6 @@ type CommonProperties struct { // list of java libraries that will be compiled into the resulting jar Static_libs proptools.Configurable[[]string] `android:"arch_variant"` - // list of java libraries that should not be used to build this module - Exclude_static_libs []string `android:"arch_variant"` - // manifest file to be included in resulting jar Manifest *string `android:"path"` @@ -827,7 +824,7 @@ func (j *Module) AvailableFor(what string) bool { } func (j *Module) staticLibs(ctx android.BaseModuleContext) []string { - return android.RemoveListFromList(j.properties.Static_libs.GetOrDefault(ctx, nil), j.properties.Exclude_static_libs) + return j.properties.Static_libs.GetOrDefault(ctx, nil) } func (j *Module) deps(ctx android.BottomUpMutatorContext) { diff --git a/java/java_test.go b/java/java_test.go index e976b081e..db154ce98 100644 --- a/java/java_test.go +++ b/java/java_test.go @@ -2454,37 +2454,6 @@ java_test_host { } } -func TestJavaExcludeStaticLib(t *testing.T) { - ctx, _ := testJava(t, ` - java_library { - name: "bar", - } - java_library { - name: "foo", - } - java_library { - name: "baz", - static_libs: [ - "foo", - "bar", - ], - exclude_static_libs: [ - "bar", - ], - } - `) - - // "bar" not included as dependency of "baz" - CheckModuleDependencies(t, ctx, "baz", "android_common", []string{ - `core-lambda-stubs`, - `ext`, - `foo`, - `framework`, - `stable-core-platform-api-stubs-system-modules`, - `stable.core.platform.api.stubs`, - }) -} - func TestJavaLibraryWithResourcesStem(t *testing.T) { ctx, _ := testJavaWithFS(t, ` java_library { |