Merge "bp2build supports arch variant srcs for java_library" am: 7db79508c7 am: 2f624bc824 am: 4dc497f88e

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1989486

Change-Id: I59d9d933590cc2c7d1fe83af5b83a48d9c2c47be
This commit is contained in:
Treehugger Robot
2022-03-14 18:22:55 +00:00
committed by Automerger Merge Worker
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"