bp2build kotlinCFlags

for java_library, java_binary, android_app & android_library

Change-Id: Ia8dec7e7d497eb41b2d8dcd8c44c3090d1d3b4bd
Bug: 271265771
Test: go test ./bp2build
This commit is contained in:
Alix
2023-03-06 19:43:55 +00:00
parent 34127be4e9
commit f848bf8225
6 changed files with 145 additions and 6 deletions

View File

@@ -2787,11 +2787,12 @@ func (m *Library) convertLibraryAttrsBp2Build(ctx android.TopDownMutatorContext)
depLabels.StaticDeps = bazel.MakeLabelListAttribute(staticDeps)
hasKotlin := !kotlinSrcs.IsEmpty()
commonAttrs.kotlinAttributes = &kotlinAttributes{
Kotlincflags: &m.properties.Kotlincflags,
}
if len(m.properties.Common_srcs) != 0 {
hasKotlin = true
commonAttrs.kotlinAttributes = &kotlinAttributes{
bazel.MakeLabelListAttribute(android.BazelLabelForModuleSrc(ctx, m.properties.Common_srcs)),
}
commonAttrs.kotlinAttributes.Common_srcs = bazel.MakeLabelListAttribute(android.BazelLabelForModuleSrc(ctx, m.properties.Common_srcs))
}
bp2BuildInfo := &bp2BuildJavaInfo{
@@ -2810,7 +2811,8 @@ type javaLibraryAttributes struct {
}
type kotlinAttributes struct {
Common_srcs bazel.LabelListAttribute
Common_srcs bazel.LabelListAttribute
Kotlincflags *[]string
}
func javaLibraryBp2Build(ctx android.TopDownMutatorContext, m *Library) {