getLog().info("GWT files are up to date. Skipping GWT build.");
return;
}
}
CommandLine cmd = new CommandLine("java");
ClassBuilder cb = new ClassBuilder(project);
cb.add(p.getProperty("spiffyui.generated-source"));
cb.add(resources.getAbsolutePath());
for (String sourceRoot : compileSourceRoots) {
cb.add(sourceRoot);
}
cmd.addArgument("-cp").addArgument(cb.toString())
.addArgument(extraJvmArgs)
.addArgument("com.google.gwt.dev.Compiler")
.addArgument("-gen").addArgument(gen.getAbsolutePath())
.addArgument("-logLevel").addArgument(logLevel)
.addArgument("-style").addArgument(style)
.addArgument("-war").addArgument(outputDirectory.getAbsolutePath())
.addArgument("-localWorkers").addArgument(String.valueOf(getLocalWorkers()));
// optional advanced arguments
if (enableAssertions) {
cmd.addArgument("-ea");
}
if (draftCompile) {
cmd.addArgument("-draftCompile");
}
if (validateOnly) {
cmd.addArgument("-validateOnly");
}
if (treeLogger) {
cmd.addArgument("-treeLogger");
}
if (disableClassMetadata) {
cmd.addArgument("-XdisableClassMetadata");
}
if (disableCastChecking) {
cmd.addArgument("-XdisableCastChecking");
}
if (strict) {
cmd.addArgument("-strict");
}
if (soycDetailed) {
cmd.addArgument("-XsoycDetailed");
}
if (optimizationLevel >= 0) {
cmd.addArgument("-optimize").addArgument(Integer.toString(optimizationLevel));
}
if (extraParam || compileReport) {
getLog().debug("create extra directory ");
if (!extra.exists()) {
extra.mkdirs();
}
cmd.addArgument("-extra").addArgument(extra.getAbsolutePath());
} else {
getLog().debug("NOT create extra directory ");
}
if (compileReport) {
cmd.addArgument("-compileReport");
}
if (workDir != null) {
cmd.addArgument("-workDir").addArgument(String.valueOf(workDir));
}
cmd.addArgument(gwtModuleName);
try {
DefaultExecutor executor = new DefaultExecutor();
getLog().debug("Exec: " + cmd.toString());
int ret = executor.execute(cmd, CommandLineUtils.getSystemEnvVars());
if (ret != 0) {
throw new MojoExecutionException("Exec failed: " + Integer.toString(ret));
}