ForkingSunRmicpublic class ForkingSunRmic extends DefaultRmicAdapter This is an extension of the sun rmic compiler, which forks rather than
executes it inline. Why so? Because rmic is dog slow, but if you fork the
compiler you can have multiple copies compiling different bits of your project
at the same time. Which, on a multi-cpu system results in significant speedups.
Also, Java1.6 behaves oddly with -XNew, so we switch it on here if needed. |
Fields Summary |
---|
public static final String | COMPILER_NAMEthe name of this adapter for users to select |
Methods Summary |
---|
public boolean | execute()exec by creating a new command
Rmic owner = getRmic();
Commandline cmd = setupRmicCommand();
Project project = owner.getProject();
//rely on RMIC being on the path
cmd.setExecutable(JavaEnvUtils.getJdkExecutable(getExecutableName()));
//set up the args
String[] args = cmd.getCommandline();
try {
Execute exe = new Execute(new LogStreamHandler(owner,
Project.MSG_INFO,
Project.MSG_WARN));
exe.setAntRun(project);
exe.setWorkingDirectory(project.getBaseDir());
exe.setCommandline(args);
exe.execute();
return !exe.isFailure();
} catch (IOException exception) {
throw new BuildException("Error running " + getExecutableName()
+ " -maybe it is not on the path", exception);
}
| protected java.lang.String | getExecutableName()Override point.
return SunRmic.RMIC_EXECUTABLE;
|
|