setup kjc command arguments.
Commandline cmd = new Commandline();
// generate classpath, because kjc doesn't support sourcepath.
Path classpath = getCompileClasspath();
if (deprecation) {
cmd.createArgument().setValue("-deprecation");
}
if (destDir != null) {
cmd.createArgument().setValue("-d");
cmd.createArgument().setFile(destDir);
}
// generate the clsspath
cmd.createArgument().setValue("-classpath");
Path cp = new Path(project);
// kjc don't have bootclasspath option.
Path p = getBootClassPath();
if (p.size() > 0) {
cp.append(p);
}
if (extdirs != null) {
cp.addExtdirs(extdirs);
}
cp.append(classpath);
if (compileSourcepath != null) {
cp.append(compileSourcepath);
} else {
cp.append(src);
}
cmd.createArgument().setPath(cp);
// kjc-1.5A doesn't support -encoding option now.
// but it will be supported near the feature.
if (encoding != null) {
cmd.createArgument().setValue("-encoding");
cmd.createArgument().setValue(encoding);
}
if (debug) {
cmd.createArgument().setValue("-g");
}
if (optimize) {
cmd.createArgument().setValue("-O2");
}
if (verbose) {
cmd.createArgument().setValue("-verbose");
}
addCurrentCompilerArgs(cmd);
logAndAddFilesToCompile(cmd);
return cmd;