mainParams.add("localeList=" + localeList);
mainParams.add("internStrings=false");
mainParams.add("action=release");
mainParams.add("layerOptimize=" + layerOptimize);
mainParams.add("profileFile=" + profilePath);
Commandline commandLine = new Commandline();
commandLine.setExecutable(javaExec);
commandLine.setWorkingDirectory(dojoDirectory + "/util/buildscripts");
List<String> commandArgs = new ArrayList<String>();
// add the class path
if (classpathArgs.size() > 0) {
commandArgs.add("-classpath");
String classpath = "";
for (int i = 0; i < classpathArgs.size(); i++) {
classpath += (i == 0 ? "" : File.pathSeparator);
classpath += classpathArgs.get(i);
}
commandArgs.add(classpath);
}
// add the rest...
commandArgs.add(mainClass);
commandArgs.add(buildFile);
for (String param : mainParams) {
commandArgs.add(param);
}
commandLine.addArguments(commandArgs.toArray(new String[commandArgs.size()]));
try {
log.info("Executing " + commandLine.toString());
int resultCode = CommandLineUtils.executeCommandLine(commandLine, new LogStream(), new LogStream());
if (resultCode > 0) {
throw new MojoExecutionException("Result of " + commandLine + " execution is: '" + resultCode + "'.");
}
} catch (CommandLineException e) {