summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2022-03-14 17:06:01 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2022-03-14 17:06:01 +0000
commit7db79508c7787a708e38f5e9ff7403b674b3a248 (patch)
tree602e252d2bf6939a2c4e227d88f7183d90b4c587 /java/java.go
parentf1346fce859fe17ac277d65db18e8708310b0770 (diff)
parente91d0303f2f1c71eec9e9f89da8b1985a966e81a (diff)
Merge "bp2build supports arch variant srcs for java_library"
Diffstat (limited to 'java/java.go')
-rw-r--r--java/java.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/java/java.go b/java/java.go
index 0a35908dd..895ce7af1 100644
--- a/java/java.go
+++ b/java/java.go
@@ -2011,8 +2011,16 @@ type javaLibraryAttributes struct {
}
func (m *Library) convertLibraryAttrsBp2Build(ctx android.TopDownMutatorContext) *javaLibraryAttributes {
- //TODO(b/209577426): Support multiple arch variants
- srcs := bazel.MakeLabelListAttribute(android.BazelLabelForModuleSrcExcludes(ctx, m.properties.Srcs, m.properties.Exclude_srcs))
+ var srcs bazel.LabelListAttribute
+ archVariantProps := m.GetArchVariantProperties(ctx, &CommonProperties{})
+ for axis, configToProps := range archVariantProps {
+ for config, _props := range configToProps {
+ if archProps, ok := _props.(*CommonProperties); ok {
+ archSrcs := android.BazelLabelForModuleSrcExcludes(ctx, archProps.Srcs, archProps.Exclude_srcs)
+ srcs.SetSelectValue(axis, config, archSrcs)
+ }
+ }
+ }
javaSrcPartition := "java"
protoSrcPartition := "proto"