Skip to content

Commit

Permalink
Add host_jvmopt.
Browse files Browse the repository at this point in the history
Fixes #11893

Closes #12822.

PiperOrigin-RevId: 352631243
  • Loading branch information
comius authored and copybara-github committed Jan 19, 2021
1 parent 052e5f8 commit 570f019
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,18 @@ public ImportDepsCheckingLevelConverter() {
+ "VM startup options of each java_binary target.")
public List<String> jvmOpts;

@Option(
name = "host_jvmopt",
allowMultiple = true,
defaultValue = "null",
documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
effectTags = {OptionEffectTag.UNKNOWN},
help =
"Additional options to pass to the Java VM when building tools that are executed during "
+ " the build. These options will get added to the VM startup options of each "
+ " java_binary target.")
public List<String> hostJvmOpts;

@Option(
name = "use_ijars",
defaultValue = "true",
Expand Down Expand Up @@ -688,7 +700,11 @@ public FragmentOptions getHost() {
JavaOptions host = (JavaOptions) getDefault();

host.javaBase = getHostJavaBase();
host.jvmOpts = ImmutableList.of("-XX:ErrorFile=/dev/stderr");
if (hostJvmOpts == null || hostJvmOpts.isEmpty()) {
host.jvmOpts = ImmutableList.of("-XX:ErrorFile=/dev/stderr");
} else {
host.jvmOpts = hostJvmOpts;
}

host.javacOpts = hostJavacOpts;
host.javaToolchain = hostJavaToolchain;
Expand Down

0 comments on commit 570f019

Please sign in to comment.