summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
author Romain Jobredeaux <jobredeaux@google.com> 2023-04-05 13:32:29 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2023-04-05 13:32:29 +0000
commitb2539d08edab2ded7a6aac0a442400f36560b8e8 (patch)
tree3a379ce14485f61685af4d9bd5da4a2556b6cf0b /java/java.go
parenta1961e7eedf7613e208db55b9eb1fa51d11a50a7 (diff)
parenteb711b9f7c96db64bbf71fc1505748287ca3bf49 (diff)
Merge "Support arch variants in java's StaticLibs in bp2build"
Diffstat (limited to 'java/java.go')
-rw-r--r--java/java.go17
1 files changed, 12 insertions, 5 deletions
diff --git a/java/java.go b/java/java.go
index 97d55146c..403f503eb 100644
--- a/java/java.go
+++ b/java/java.go
@@ -2905,10 +2905,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 +2916,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{