summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
author Cole Faust <colefaust@google.com> 2024-09-06 18:41:58 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2024-09-06 18:41:58 +0000
commitace2d9884a9957b3e538f171786a7a5d7392fb82 (patch)
tree8080b098dbbc7fe37407e0075ef38d1477db80ed /java/java.go
parent9d269b6956939b7faed39a4bb86ce06c0200f000 (diff)
parent219009f60695ba87d382f03f1de59b9f1b6170b2 (diff)
Merge "Make the java static_libs property configurable" into main am: 219009f606
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3254302 Change-Id: I708599b3007151e4e525f5c647f79861d4968923 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'java/java.go')
-rw-r--r--java/java.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/java/java.go b/java/java.go
index 797a90dfc..95f4fd892 100644
--- a/java/java.go
+++ b/java/java.go
@@ -2011,11 +2011,11 @@ type JavaApiLibraryProperties struct {
// 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"`
@@ -2191,8 +2191,8 @@ func (al *ApiLibrary) DepsMutator(ctx android.BottomUpMutatorContext) {
}
}
- 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)
@@ -2426,16 +2426,16 @@ func (al *ApiLibrary) TargetSdkVersion(ctx android.EarlyModuleContext) android.A
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))
}
@@ -2479,7 +2479,7 @@ type ImportProperties struct {
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
@@ -2620,7 +2620,7 @@ func (j *Import) setStrictUpdatabilityLinting(bool) {
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)