public void runSandbox(String language, List<File> compileList, File fileToRun) throws Exception
{
logListener.log("Running Sandbox");
logListener.log("Language is " + language);
ICompiler compiler = getCompiler(language, logListener);
if (compiler == null)
{
logListener.log(language + " compiler path not set. Please click Configure Sandbox and set up the path.");
return;
}
IRuntime runtime = getRuntime(language, logListener);
if (runtime == null)
{
logListener.log(language + " runtime path not set. Please click Configure Sandbox and set up the path.");
return;
}
logListener.log("Compiling: " + StringUtil.listToString(compileList));
boolean compiledOK = compiler.compile(compileList, logParser.getConfig().getClassLocations(), SANDBOX_CLASS_DIR.toFile(),
logListener);
logListener.log("Compilation success: " + compiledOK);
if (compiledOK)
{
String fqClassNameToRun = runtime.getClassToExecute(fileToRun);
boolean executionSuccess = executeClass(fqClassNameToRun, runtime, logParser.getConfig().isSandboxIntelMode());
logListener.log("Execution success: " + executionSuccess);
if (executionSuccess)
{
runJITWatch();
if (!logParser.hasParseError())
{
String fqClassNameForTriView = runtime.getClassForTriView(fileToRun);
showTriView(language, fqClassNameForTriView);
}
}
else
{
sandboxStage.showError(runtime.getErrorStream());
}
}
else
{
sandboxStage.showError(compiler.getErrorStream());
}
}