diff --git a/tools/java/com/google/j2cl/tools/gwtincompatible/BUILD b/tools/java/com/google/j2cl/tools/gwtincompatible/BUILD index 4b7c1fdc0e..a11fe6e136 100644 --- a/tools/java/com/google/j2cl/tools/gwtincompatible/BUILD +++ b/tools/java/com/google/j2cl/tools/gwtincompatible/BUILD @@ -4,6 +4,7 @@ # J2CL. load("@rules_java//java:defs.bzl", "java_binary", "java_library") +load("//transpiler/java/com/google/j2cl/common/bazel:jvm_flags.bzl", "JVM_FLAGS") package( default_applicable_licenses = ["//:j2cl_license"], @@ -45,6 +46,7 @@ java_library( java_binary( name = "GwtIncompatibleStripper_worker", + jvm_flags = JVM_FLAGS, main_class = "com.google.j2cl.tools.gwtincompatible.BazelGwtIncompatibleStripper", visibility = ["//build_defs/internal_do_not_use:__pkg__"], runtime_deps = [":gwtincompatible_worker_lib"], diff --git a/tools/java/com/google/j2cl/tools/rta/BUILD b/tools/java/com/google/j2cl/tools/rta/BUILD index 9c382e99b5..215882fee9 100644 --- a/tools/java/com/google/j2cl/tools/rta/BUILD +++ b/tools/java/com/google/j2cl/tools/rta/BUILD @@ -2,6 +2,7 @@ # Implementation of RTA algorithm used to do fast method pruning. load("@rules_java//java:defs.bzl", "java_binary", "java_library") +load("//transpiler/java/com/google/j2cl/common/bazel:jvm_flags.bzl", "JVM_FLAGS") package( default_applicable_licenses = ["//:j2cl_license"], @@ -24,6 +25,7 @@ java_proto_library( java_binary( name = "J2clRta_worker", + jvm_flags = JVM_FLAGS, main_class = "com.google.j2cl.tools.rta.BazelJ2clRta", visibility = ["//build_defs/internal_do_not_use:__pkg__"], runtime_deps = [":rta"], diff --git a/transpiler/java/com/google/j2cl/common/bazel/jvm_flags.bzl b/transpiler/java/com/google/j2cl/common/bazel/jvm_flags.bzl new file mode 100644 index 0000000000..e23a24364f --- /dev/null +++ b/transpiler/java/com/google/j2cl/common/bazel/jvm_flags.bzl @@ -0,0 +1,8 @@ +"""Shared JVM flags for J2CL JVM-based workers.""" + +JVM_FLAGS = [ + "-XX:+TieredCompilation", + "-Xss3M", + # Disable bytecode verification to save from class-loading time. + "-Xverify:none", +] diff --git a/transpiler/java/com/google/j2cl/transpiler/BUILD b/transpiler/java/com/google/j2cl/transpiler/BUILD index 154e463860..5eed521b28 100644 --- a/transpiler/java/com/google/j2cl/transpiler/BUILD +++ b/transpiler/java/com/google/j2cl/transpiler/BUILD @@ -1,4 +1,5 @@ load("@rules_java//java:defs.bzl", "java_binary", "java_library") +load("//transpiler/java/com/google/j2cl/common/bazel:jvm_flags.bzl", "JVM_FLAGS") package( default_applicable_licenses = ["//:j2cl_license"], @@ -101,13 +102,6 @@ java_library( ], ) -JVM_FLAGS = [ - "-XX:+TieredCompilation", - "-Xss3M", - # Disable bytecode verification to save from class-loading time. - "-Xverify:none", -] - java_binary( name = "BazelJ2clBuilder", jvm_flags = JVM_FLAGS,