Merge "bp2build supports arch variant srcs for java_library"

This commit is contained in:
Treehugger Robot
2022-03-14 17:06:01 +00:00
committed by Gerrit Code Review
3 changed files with 57 additions and 7 deletions

View File

@@ -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"