use of org.yakindu.sct.generator.core.execution.IGeneratorEntryExecutor in project statecharts by Yakindu.
the class AbstractJavaGeneratorTest method generateAndCompile.
public IMarker[] generateAndCompile(Statechart statechart) throws Exception {
GeneratorEntry entry = createGeneratorEntry(statechart.getName(), SRC_GEN);
entry.setElementRef(statechart);
IProject targetProject = getProject(entry);
targetProject.delete(true, new NullProgressMonitor());
targetProject = getProject(entry);
if (!targetProject.exists()) {
targetProject.create(new NullProgressMonitor());
targetProject.open(new NullProgressMonitor());
}
IGeneratorEntryExecutor executor = new EclipseContextGeneratorExecutorLookup() {
protected Module getContextModule() {
return Modules.override(super.getContextModule()).with(new Module() {
@Override
public void configure(Binder binder) {
binder.bind(IConsoleLogger.class).to(TestLogger.class);
}
});
}
}.createExecutor(entry, "yakindu::java");
executor.execute(entry);
targetProject.refreshLocal(IResource.DEPTH_INFINITE, null);
targetProject.getWorkspace().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, null);
targetProject.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, new NullProgressMonitor());
IMarker[] markers = targetProject.findMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE);
return markers;
}
Aggregations