JavacExternalpublic class JavacExternal extends DefaultCompilerAdapter Performs a compile using javac externally. |
Methods Summary |
---|
private boolean | execOnVMS(org.apache.tools.ant.types.Commandline cmd, int firstFileName)helper method to execute our command on VMS.
File vmsFile = null;
try {
vmsFile = JavaEnvUtils.createVmsJavaOptionFile(cmd.getArguments());
String[] commandLine = {cmd.getExecutable(),
"-V",
vmsFile.getPath()};
return 0 == executeExternalCompile(commandLine,
firstFileName,
true);
} catch (IOException e) {
throw new BuildException("Failed to create a temporary file for \"-V\" switch");
} finally {
FileUtils.delete(vmsFile);
}
| public boolean | execute()Performs a compile using the Javac externally.
attributes.log("Using external javac compiler", Project.MSG_VERBOSE);
Commandline cmd = new Commandline();
cmd.setExecutable(getJavac().getJavacExecutable());
if (!assumeJava11() && !assumeJava12()) {
setupModernJavacCommandlineSwitches(cmd);
} else {
setupJavacCommandlineSwitches(cmd, true);
}
int firstFileName = assumeJava11() ? -1 : cmd.size();
logAndAddFilesToCompile(cmd);
//On VMS platform, we need to create a special java options file
//containing the arguments and classpath for the javac command.
//The special file is supported by the "-V" switch on the VMS JVM.
if (Os.isFamily("openvms")) {
return execOnVMS(cmd, firstFileName);
}
return
executeExternalCompile(cmd.getCommandline(), firstFileName,
true)
== 0;
|
|