convert java_import jars with arch variants
Bug: 220168131 Test: go test ./bp2build -run TestJavaImport Test: b build '...' Change-Id: Ib485e6905e7be9d199af5295b23131c226fd6e96
This commit is contained in:
12
java/java.go
12
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,
|
||||
|
Reference in New Issue
Block a user