Add host_jvmopt.
Fixes
Closes
@@ -152,6 +152,18 @@ public class JavaOptions extends FragmentOptions {
+ "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",
@@ -688,7 +700,11 @@ public class JavaOptions extends FragmentOptions {
JavaOptions host = (JavaOptions) getDefault();
host.javaBase = getHostJavaBase();
+ if (hostJvmOpts == null || hostJvmOpts.isEmpty()) {
host.jvmOpts = ImmutableList.of("-XX:ErrorFile=/dev/stderr");
+ } else {
+ host.jvmOpts = hostJvmOpts;
+ }
host.javacOpts = hostJavacOpts;
host.javaToolchain = hostJavaToolchain;
