// Get the path of the Build folder.
File projectFolder = new File(proj.getProjectDirectory().getPath());
// Start the session by specifying the main class location, name, and the name of the method
// we wish to stop at. We will stop at "action Main".
final TODSession session = TODSessionFactory.getDefault();
if (session.isActive()) {
return;
}
session.setMainClassLocation(projectFolder);
session.setJar("Run/Default.jar"); // TODO: Actually it's a JAR name
if (SodbeansDebugAction.firstTODRun) {
SodbeansDebugAction.firstTODRun = false;
// Associate a listener for the VM's output
session.getJVMHandler().addListener(new JVMListener() {
@Override
public void VMPrepareEvent() {
TODWatcher watch = new TODWatcher(session.getJVMHandler().getJVMInputStream());
watch.start();
}
});
}
// Start the session.
session.getActionHandler().start(new String[]{});
}
} else {
int numberErrors = compiler.getCompilerErrorManager().getNumberOfSyntaxErrors();
addSuccessfulBuildLog(startTime, endTime, false, numberErrors);