/**
* Compile the workspace.
* @return whether the workspace compiled successfully.
*/
private boolean compileWorkspace() {
CompilerMessageLogger ml = new MessageLogger();
calLogger.fine("Compiling workspace..");
// Init and compile the workspace.
Status initStatus = new Status("Init status.");
workspaceManager.initWorkspace(getStreamProvider(), false, initStatus);
if (initStatus.getSeverity() != Status.Severity.OK) {
ml.logMessage(initStatus.asCompilerMessage());
}
long startCompile = System.currentTimeMillis();
// If there are no errors go ahead and compile the workspace.
if (ml.getMaxSeverity().compareTo(CompilerMessage.Severity.ERROR) < 0) {
workspaceManager.compile(ml, true, null);
}
long compileTime = System.currentTimeMillis() - startCompile;
// Write out compiler messages
writeOutCompileResult(ml);
int nModules = workspaceManager.getModuleNamesInProgram().length;
calLogger.fine("CAL: Finished compiling " + nModules + " modules in " + compileTime + "ms\n");
return ml.getNErrors() == 0;
}