}
}
});
CompilerMessageLogger ml = new MessageLogger();
// Init and compile the workspace.
Status initStatus = new Status("Init status.");
workspaceManager.initWorkspace(streamProvider, 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.CompilationOptions options = new WorkspaceManager.CompilationOptions();
options.setForceCodeRegeneration(forceCodeRegen);
workspaceManager.compile(ml, dirtyOnly, null, options);
}
long compileTime = System.currentTimeMillis() - startCompile;
boolean compilationSucceeded;
if (ml.getMaxSeverity().compareTo(CompilerMessage.Severity.ERROR) >= 0) {
// Errors
jfitLogger.severe("Compilation unsuccessful because of errors:");
compilationSucceeded = false;
} else {
// Compilation successful
jfitLogger.fine("Compilation successful");
compilationSucceeded = true;
}
// Write out compiler messages
java.util.List<CompilerMessage> errs = ml.getCompilerMessages();
int errsSize = errs.size();
for (int i = 0; i < errsSize; i++) {
CompilerMessage err = errs.get(i);
jfitLogger.info(" " + err.toString());
}