use of org.eclipse.titan.designer.compiler.BuildTimestamp in project titan.EclipsePlug-ins by eclipse.
the class TITANJavaBuilder method build.
@Override
protected IProject[] build(final int kind, final Map<String, String> args, final IProgressMonitor monitor) throws CoreException {
IProject project = getProject();
if (!TITANInstallationValidator.check(true)) {
return project.getReferencedProjects();
}
if (!LicenseValidator.check()) {
return project.getReferencedProjects();
}
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
final boolean reportDebugInformation = store.getBoolean(PreferenceConstants.DISPLAYDEBUGINFORMATION);
final SubMonitor progress = SubMonitor.convert(monitor);
progress.beginTask("Build", 2);
ProjectSourceParser sourceParser = GlobalParser.getProjectSourceParser(project);
// TODO: this is temporary code!
sourceParser.makefileCreatingAnalyzeAll();
progress.worked(1);
BuildTimestamp timestamp = BuildTimestamp.getNewBuildCounter();
IProgressMonitor codeGeneratorMonitor = progress.newChild(1);
codeGeneratorMonitor.beginTask("Checking prerequisites", sourceParser.getModules().size() + 1);
for (Module module : sourceParser.getModules()) {
TITANDebugConsole.println("Generating code for module `" + module.getIdentifier().getDisplayName() + "'");
try {
ProjectSourceCompiler.compile(timestamp, module, reportDebugInformation);
} catch (Exception e) {
ErrorReporter.logExceptionStackTrace("While generating Java code for module " + module.getIdentifier().getDisplayName(), e);
}
codeGeneratorMonitor.worked(1);
}
TITANDebugConsole.println("Generating code for single main");
try {
ProjectSourceCompiler.generateSingleMain(project, sourceParser.getModules(), reportDebugInformation);
ProjectSourceCompiler.generateParallelMain(project, sourceParser.getModules(), reportDebugInformation);
} catch (CoreException e) {
ErrorReporter.logExceptionStackTrace("While generating Java code for main module ", e);
}
codeGeneratorMonitor.worked(1);
codeGeneratorMonitor.done();
return new IProject[0];
}
Aggregations