diff options
author | 2023-06-01 22:17:32 +0000 | |
---|---|---|
committer | 2023-06-05 21:42:48 +0000 | |
commit | 381c2fa27c08417b587727cc26b1c033b4fa9974 (patch) | |
tree | 8aa0005b9ecfe0d1ba43a040afb097ae0b53ebea /java/java_test.go | |
parent | f508c252bb0bba6df49ceca5dbde28e9aa48cac1 (diff) |
Introduce "Exclude_static_libs" property for Java modules
Exclude_static_libs property can be used to specify static libs that
should not be used to build the module. The list acts as filter for
static_libs.
Bug: 285410821
Test: go test ./java
Change-Id: Iee7f160ba88b5f64bdd265c30d47c9f51feb0f5e
Diffstat (limited to 'java/java_test.go')
-rw-r--r-- | java/java_test.go | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/java/java_test.go b/java/java_test.go index cd5c343ce..561b187d0 100644 --- a/java/java_test.go +++ b/java/java_test.go @@ -2322,3 +2322,34 @@ java_test_host { t.Errorf("Expected args[\"extraTestRunnerConfigs\"] to equal %q, was %q", expected, args["extraTestRunnerConfigs"]) } } + +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`, + }) +} |