options.getDumpSignatureFile())) {
return false;
}
} else {
long compileStart = System.currentTimeMillis();
TreeLogger branch = logger.branch(TreeLogger.INFO,
"Compiling module " + moduleName);
// Optimize early since permutation compiles will run in process.
options.setOptimizePrecompile(true);
Precompilation precompilation = Precompile.precompile(branch,
options, module, options.getGenDir(), compilerWorkDir,
options.getDumpSignatureFile());
if (precompilation == null) {
return false;
}
Permutation[] allPerms = precompilation.getPermutations();
List<FileBackedObject<PermutationResult>> resultFiles = CompilePerms.makeResultFiles(
options.getCompilerWorkDir(moduleName), allPerms);
CompilePerms.compile(branch, precompilation, allPerms,
options.getLocalWorkers(), resultFiles);
ArtifactSet generatedArtifacts = precompilation.getGeneratedArtifacts();
JJSOptions precompileOptions = precompilation.getUnifiedAst().getOptions();
precompilation = null; // No longer needed, so save the memory
File absPath = new File(options.getWarDir(), module.getName());
absPath = absPath.getAbsoluteFile();
String logMessage = "Linking into " + absPath + ".";
if (options.getExtraDir() != null) {
File absExtrasPath = new File(options.getExtraDir(), module.getName());
absExtrasPath = absExtrasPath.getAbsoluteFile();
logMessage += " Writing extras to " + absExtrasPath;
}
Link.link(logger.branch(TreeLogger.TRACE, logMessage),
module, generatedArtifacts, allPerms, resultFiles,
options.getWarDir(), options.getExtraDir(), precompileOptions);
long compileDone = System.currentTimeMillis();
long delta = compileDone - compileStart;
branch.log(TreeLogger.INFO, "Compilation succeeded -- "
+ String.format("%.3f", delta / 1000d) + "s");
}
}
} catch (IOException e) {