Add getExec method for JavaOptions.
This acts similarly to getHost, except:
1. It is intended to generate options for the exec transition, and
2. The default is to clone the options, not start with defaults.
Part of work on execution transitions,
@@ -677,4 +677,19 @@ public class JavaOptions extends FragmentOptions {
return host;
}
+ @Override
+ public FragmentOptions getExec() {
+ JavaOptions exec = (JavaOptions) super.getExec();
+
+ exec.javaBase = getHostJavaBase();
+ exec.jvmOpts = ImmutableList.of("-XX:ErrorFile=/dev/stderr");
+
+ exec.pluginList = ImmutableList.of();
+ exec.javacOpts = hostJavacOpts;
+ exec.javaToolchain = hostJavaToolchain;
+
+ exec.javaLauncher = hostJavaLauncher;
+
+ return exec;
+ }
}
