summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2022-04-04 16:06:55 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2022-04-04 16:06:55 +0000
commit7a45d37e62c9d4ea37af06a751f4167fcf304bd6 (patch)
tree4883d4f9191e377e6f345a07355dfaed5be57eee /java/java.go
parent3aae38d451e44d7f12224e938456dfb2fd665ac5 (diff)
parent489831660c099a0a7903f1082bb2095b506e5bc0 (diff)
Merge "convert java_import jars with arch variants"
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 1b6e559b3..ecbbc329c 100644
--- a/java/java.go
+++ b/java/java.go
@@ -2218,8 +2218,16 @@ type bazelJavaImportAttributes struct {
// java_import bp2Build converter.
func (i *Import) ConvertWithBp2build(ctx android.TopDownMutatorContext) {
- //TODO(b/209577426): Support multiple arch variants
- jars := bazel.MakeLabelListAttribute(android.BazelLabelForModuleSrcExcludes(ctx, i.properties.Jars, []string(nil)))
+ var jars bazel.LabelListAttribute
+ archVariantProps := i.GetArchVariantProperties(ctx, &ImportProperties{})
+ for axis, configToProps := range archVariantProps {
+ for config, _props := range configToProps {
+ if archProps, ok := _props.(*ImportProperties); ok {
+ archJars := android.BazelLabelForModuleSrcExcludes(ctx, archProps.Jars, []string(nil))
+ jars.SetSelectValue(axis, config, archJars)
+ }
+ }
+ }
attrs := &bazelJavaImportAttributes{
Jars: jars,