summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
Diffstat (limited to 'java/java.go')
-rw-r--r--java/java.go25
1 files changed, 17 insertions, 8 deletions
diff --git a/java/java.go b/java/java.go
index 97d55146c..d400b0cfb 100644
--- a/java/java.go
+++ b/java/java.go
@@ -1612,7 +1612,7 @@ func (ap *JavaApiContribution) GenerateAndroidBuildActions(ctx android.ModuleCon
}
type JavaApiLibraryDepsInfo struct {
- StubsJar android.Path
+ JavaInfo
StubsSrcJar android.Path
}
@@ -1821,7 +1821,7 @@ func (al *ApiLibrary) GenerateAndroidBuildActions(ctx android.ModuleContext) {
staticLibs = append(staticLibs, provider.HeaderJars...)
case depApiSrcsTag:
provider := ctx.OtherModuleProvider(dep, JavaApiLibraryDepsProvider).(JavaApiLibraryDepsInfo)
- classPaths = append(classPaths, provider.StubsJar)
+ classPaths = append(classPaths, provider.HeaderJars...)
depApiSrcsStubsSrcJar = provider.StubsSrcJar
}
})
@@ -1900,7 +1900,9 @@ func (al *ApiLibrary) GenerateAndroidBuildActions(ctx android.ModuleContext) {
})
ctx.SetProvider(JavaApiLibraryDepsProvider, JavaApiLibraryDepsInfo{
- StubsJar: al.stubsJar,
+ JavaInfo: JavaInfo{
+ HeaderJars: android.PathsIfNonNil(al.stubsJar),
+ },
StubsSrcJar: al.stubsSrcJar,
})
}
@@ -2905,10 +2907,6 @@ func (m *Library) convertLibraryAttrsBp2Build(ctx android.TopDownMutatorContext)
}
}
- if m.properties.Static_libs != nil {
- staticDeps.Append(android.BazelLabelForModuleDeps(ctx, android.LastUniqueStrings(android.CopyOf(m.properties.Static_libs))))
- }
-
protoDepLabel := bp2buildProto(ctx, &m.Module, srcPartitions[protoSrcPartition])
// Soong does not differentiate between a java_library and the Bazel equivalent of
// a java_proto_library + proto_library pair. Instead, in Soong proto sources are
@@ -2920,7 +2918,18 @@ func (m *Library) convertLibraryAttrsBp2Build(ctx android.TopDownMutatorContext)
depLabels := &javaDependencyLabels{}
depLabels.Deps = deps
- depLabels.StaticDeps = bazel.MakeLabelListAttribute(staticDeps)
+
+ for axis, configToProps := range archVariantProps {
+ for config, _props := range configToProps {
+ if archProps, ok := _props.(*CommonProperties); ok {
+ archStaticLibs := android.BazelLabelForModuleDeps(
+ ctx,
+ android.LastUniqueStrings(android.CopyOf(archProps.Static_libs)))
+ depLabels.StaticDeps.SetSelectValue(axis, config, archStaticLibs)
+ }
+ }
+ }
+ depLabels.StaticDeps.Value.Append(staticDeps)
hasKotlin := !kotlinSrcs.IsEmpty()
commonAttrs.kotlinAttributes = &kotlinAttributes{