bp2build converts java_version property to javacopts attribute
This CL also converts `external/rappor` (which already set `java_version` to `1.7`) to be bazelable to testify the changes. Results from `b build //external/rappor && cat bazel-bin/external/rappor/librappor.jar-0.params`: https://paste.googleplex.com/5518725462622208. Test: go test ./bp2build/... Bug: 227618664 Change-Id: I8d370d4639f70fba51e6de6ceb7bcb5ace9ccd91
This commit is contained in:
@@ -43,6 +43,7 @@ java_library_host {
|
||||
name: "java-lib-host-2",
|
||||
srcs: ["c.java"],
|
||||
bazel_module: { bp2build_available: true },
|
||||
java_version: "9",
|
||||
}`,
|
||||
expectedBazelTargets: []string{
|
||||
makeBazelTarget("java_library", "java-lib-host-1", attrNameToString{
|
||||
@@ -54,7 +55,8 @@ java_library_host {
|
||||
})`,
|
||||
}),
|
||||
makeBazelTarget("java_library", "java-lib-host-2", attrNameToString{
|
||||
"srcs": `["c.java"]`,
|
||||
"javacopts": `["-source 1.9 -target 1.9"]`,
|
||||
"srcs": `["c.java"]`,
|
||||
"target_compatible_with": `select({
|
||||
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
|
Reference in New Issue
Block a user