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
This commit is contained in:
Jihoon Kang
2023-06-01 22:17:32 +00:00
parent f508c252bb
commit 381c2fa27c
4 changed files with 66 additions and 3 deletions

View File

@@ -79,6 +79,9 @@ type CommonProperties struct {
// list of java libraries that will be compiled into the resulting jar
Static_libs []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"`
@@ -724,6 +727,8 @@ func (j *Module) deps(ctx android.BottomUpMutatorContext) {
}
libDeps := ctx.AddVariationDependencies(nil, libTag, j.properties.Libs...)
j.properties.Static_libs = android.RemoveListFromList(j.properties.Static_libs, j.properties.Exclude_static_libs)
ctx.AddVariationDependencies(nil, staticLibTag, j.properties.Static_libs...)
// Add dependency on libraries that provide additional hidden api annotations.