Skip to content

Commit

Permalink
Make sure all J2CL Bazel actions use same set of jvm flags.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 720349880
  • Loading branch information
gkdn authored and copybara-github committed Jan 28, 2025
1 parent a167bba commit ad9f0e5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
2 changes: 2 additions & 0 deletions tools/java/com/google/j2cl/tools/gwtincompatible/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down Expand Up @@ -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"],
Expand Down
2 changes: 2 additions & 0 deletions tools/java/com/google/j2cl/tools/rta/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand All @@ -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"],
Expand Down
8 changes: 8 additions & 0 deletions transpiler/java/com/google/j2cl/common/bazel/jvm_flags.bzl
Original file line number Diff line number Diff line change
@@ -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",
]
8 changes: 1 addition & 7 deletions transpiler/java/com/google/j2cl/transpiler/BUILD
Original file line number Diff line number Diff line change
@@ -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"],
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit ad9f0e5

Please sign in to comment.