Skip to content

Commit

Permalink
[J2KT] Use the correct jre bundle for J2ktRestrictionsCheckerTest
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 699887968
  • Loading branch information
martinkretzschmar authored and copybara-github committed Nov 25, 2024
1 parent a8e1403 commit bac9d76
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
9 changes: 8 additions & 1 deletion transpiler/javatests/com/google/j2cl/transpiler/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ java_binary(
runtime_deps = ["//jre/java:jre_bootclasspath"],
)

# A java_binary to create a merged jar of all deps of the standard runtime for Kotlin backend.
java_binary(
name = "jre_bundle-j2kt",
create_executable = 0,
runtime_deps = ["//third_party/java/xplat/j2kt:jre_bootclasspath-j2kt"],
)

# A java_binary to create a merged jar of all deps of the standard runtime for Wasm.
java_binary(
name = "jre_bundle-j2wasm",
Expand Down Expand Up @@ -88,7 +95,7 @@ java_test(
java_test(
name = "J2ktRestrictionsCheckerTest",
srcs = ["J2ktRestrictionsCheckerTest.java"],
data = [":jre_bundle_deploy.jar"],
data = [":jre_bundle-j2kt_deploy.jar"],
deps = [
":TranspilerTester",
"//third_party:junit",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ public void testKtPropertyConstructorFails() {
}

private TranspilerTester newTranspilerTester(String compilationUnitName, String... code) {
return TranspilerTester.newTesterWithDefaults()
.addArgs("-backend", "KOTLIN")
return TranspilerTester.newTesterWithJ2ktDefaults()
.addCompilationUnit(compilationUnitName, code);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public static TranspilerTester newTesterWithDefaults() {
.setClassPathArg("transpiler/javatests/com/google/j2cl/transpiler/jre_bundle_deploy.jar");
}

/** Creates a new transpiler tester initialized with Kotlin defaults. */
/** Creates a new transpiler tester initialized with Kotlin (frontend) defaults. */
public static TranspilerTester newTesterWithKotlinDefaults() {
return newTester()
.addArgs("-frontend", "KOTLIN")
Expand All @@ -77,6 +77,14 @@ public static TranspilerTester newTesterWithKotlinDefaults() {
"transpiler/javatests/com/google/j2cl/transpiler/ktstdlib_bundle_deploy.jar");
}

/** Creates a new transpiler tester initialized with Kotlin (backend) defaults. */
public static TranspilerTester newTesterWithJ2ktDefaults() {
return newTester()
.addArgs("-backend", "KOTLIN")
.setClassPathArg(
"transpiler/javatests/com/google/j2cl/transpiler/jre_bundle-j2kt_deploy.jar");
}

/** Creates a new transpiler tester initialized with WASM defaults. */
public static TranspilerTester newTesterWithWasmDefaults() {
return newTester()
Expand Down

0 comments on commit bac9d76

Please sign in to comment.