bp2build for java_library with .kt srcs or common_srcs
java_library modules with .kt srcs or common_srcs will be converted into module type kt_jvm_library Test: m bp2build, manually inspected build files for allowlisted modules Bug: 258688914 Change-Id: I8293a11c8247b4b76358d0991f82c6b61b58adc3
This commit is contained in:
@@ -649,3 +649,46 @@ android_library {
|
||||
}),
|
||||
}})
|
||||
}
|
||||
|
||||
func TestJavaLibraryKotlinSrcs(t *testing.T) {
|
||||
runJavaLibraryTestCase(t, Bp2buildTestCase{
|
||||
Description: "java_library with kotlin srcs",
|
||||
Blueprint: `java_library {
|
||||
name: "java-lib-1",
|
||||
srcs: ["a.java", "b.java", "c.kt"],
|
||||
bazel_module: { bp2build_available: true },
|
||||
}
|
||||
`,
|
||||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("kt_jvm_library", "java-lib-1", AttrNameToString{
|
||||
"srcs": `[
|
||||
"a.java",
|
||||
"b.java",
|
||||
"c.kt",
|
||||
]`,
|
||||
}),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
func TestJavaLibraryKotlinCommonSrcs(t *testing.T) {
|
||||
runJavaLibraryTestCase(t, Bp2buildTestCase{
|
||||
Description: "java_library with kotlin common_srcs",
|
||||
Blueprint: `java_library {
|
||||
name: "java-lib-1",
|
||||
srcs: ["a.java", "b.java"],
|
||||
common_srcs: ["c.kt"],
|
||||
bazel_module: { bp2build_available: true },
|
||||
}
|
||||
`,
|
||||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("kt_jvm_library", "java-lib-1", AttrNameToString{
|
||||
"srcs": `[
|
||||
"a.java",
|
||||
"b.java",
|
||||
]`,
|
||||
"common_srcs": `["c.kt"]`,
|
||||
}),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user