Make the java static_libs property configurable
Bug: 362579941
Test: m nothing --no-skip-soong-tests
Change-Id: Iccc93cf14753aae1adb26c6eedd00aabf1c2f6a6
diff --git a/java/java.go b/java/java.go
index 8cc1085..93b2976 100644
--- a/java/java.go
+++ b/java/java.go
@@ -1994,11 +1994,11 @@
// List of shared java libs that this module has dependencies to and
// should be passed as classpath in javac invocation
- Libs []string
+ Libs proptools.Configurable[[]string]
// List of java libs that this module has static dependencies to and will be
// merge zipped after metalava invocation
- Static_libs []string
+ Static_libs proptools.Configurable[[]string]
// Version of previously released API file for compatibility check.
Previous_api *string `android:"path"`
@@ -2174,8 +2174,8 @@
}
}
- ctx.AddVariationDependencies(nil, libTag, al.properties.Libs...)
- ctx.AddVariationDependencies(nil, staticLibTag, al.properties.Static_libs...)
+ ctx.AddVariationDependencies(nil, libTag, al.properties.Libs.GetOrDefault(ctx, nil)...)
+ ctx.AddVariationDependencies(nil, staticLibTag, al.properties.Static_libs.GetOrDefault(ctx, nil)...)
for _, aconfigDeclarationsName := range al.properties.Aconfig_declarations {
ctx.AddDependency(ctx.Module(), aconfigDeclarationTag, aconfigDeclarationsName)
@@ -2406,16 +2406,16 @@
func (al *ApiLibrary) IDEInfo(ctx android.BaseModuleContext, i *android.IdeInfo) {
i.Deps = append(i.Deps, al.ideDeps(ctx)...)
- i.Libs = append(i.Libs, al.properties.Libs...)
- i.Static_libs = append(i.Static_libs, al.properties.Static_libs...)
+ i.Libs = append(i.Libs, al.properties.Libs.GetOrDefault(ctx, nil)...)
+ i.Static_libs = append(i.Static_libs, al.properties.Static_libs.GetOrDefault(ctx, nil)...)
i.SrcJars = append(i.SrcJars, al.stubsSrcJar.String())
}
// deps of java_api_library for module_bp_java_deps.json
func (al *ApiLibrary) ideDeps(ctx android.BaseModuleContext) []string {
ret := []string{}
- ret = append(ret, al.properties.Libs...)
- ret = append(ret, al.properties.Static_libs...)
+ ret = append(ret, al.properties.Libs.GetOrDefault(ctx, nil)...)
+ ret = append(ret, al.properties.Static_libs.GetOrDefault(ctx, nil)...)
if al.properties.System_modules != nil {
ret = append(ret, proptools.String(al.properties.System_modules))
}
@@ -2459,7 +2459,7 @@
Libs []string
// List of static java libs that this module has dependencies to
- Static_libs []string
+ Static_libs proptools.Configurable[[]string]
// List of files to remove from the jar file(s)
Exclude_files []string
@@ -2600,7 +2600,7 @@
func (j *Import) DepsMutator(ctx android.BottomUpMutatorContext) {
ctx.AddVariationDependencies(nil, libTag, j.properties.Libs...)
- ctx.AddVariationDependencies(nil, staticLibTag, j.properties.Static_libs...)
+ ctx.AddVariationDependencies(nil, staticLibTag, j.properties.Static_libs.GetOrDefault(ctx, nil)...)
if ctx.Device() && Bool(j.dexProperties.Compile_dex) {
sdkDeps(ctx, android.SdkContext(j), j.dexer)