* @param options additional parameters needed by a specific
* implementation.
* @return the command line
*/
protected Commandline setupRmicCommand(String[] options) {
Commandline cmd = new Commandline();
if (options != null) {
for (int i = 0; i < options.length; i++) {
cmd.createArgument().setValue(options[i]);
}
}
Path classpath = getCompileClasspath();
cmd.createArgument().setValue("-d");
cmd.createArgument().setFile(attributes.getBase());
if (attributes.getExtdirs() != null) {
cmd.createArgument().setValue("-extdirs");
cmd.createArgument().setPath(attributes.getExtdirs());
}
cmd.createArgument().setValue("-classpath");
cmd.createArgument().setPath(classpath);
String stubOption = addStubVersionOptions();
if (stubOption != null) {
//set the non-null stubOption
cmd.createArgument().setValue(stubOption);
}
if (null != attributes.getSourceBase()) {
cmd.createArgument().setValue("-keepgenerated");
}
if (attributes.getIiop()) {
attributes.log("IIOP has been turned on.", Project.MSG_INFO);
cmd.createArgument().setValue("-iiop");
if (attributes.getIiopopts() != null) {
attributes.log("IIOP Options: " + attributes.getIiopopts(),
Project.MSG_INFO);
cmd.createArgument().setValue(attributes.getIiopopts());
}
}
if (attributes.getIdl()) {
cmd.createArgument().setValue("-idl");
attributes.log("IDL has been turned on.", Project.MSG_INFO);
if (attributes.getIdlopts() != null) {
cmd.createArgument().setValue(attributes.getIdlopts());
attributes.log("IDL Options: " + attributes.getIdlopts(),
Project.MSG_INFO);
}
}
if (attributes.getDebug()) {
cmd.createArgument().setValue("-g");
}
String[] compilerArgs = attributes.getCurrentCompilerArgs();
compilerArgs = preprocessCompilerArgs(compilerArgs);
cmd.addArguments(compilerArgs);
logAndAddFilesToCompile(cmd);
return cmd;
}