IDEA-113519 Groovy Shell fails to open with exceptions

This commit is contained in:
Max Medvedev
2013-09-13 08:56:29 +04:00
parent 0ab182ee23
commit 3e598ed2de
23 changed files with 17 additions and 2 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -27,9 +27,12 @@ import org.jetbrains.plugins.groovy.config.AbstractConfigUtils;
import org.jetbrains.plugins.groovy.config.GroovyConfigUtils;
import org.jetbrains.plugins.groovy.runner.DefaultGroovyScriptRunner;
import org.jetbrains.plugins.groovy.runner.GroovyScriptRunConfiguration;
import org.jetbrains.plugins.groovy.runner.GroovyScriptRunner;
import org.jetbrains.plugins.groovy.util.GroovyUtils;
import org.jetbrains.plugins.groovy.util.LibrariesUtil;
import java.io.File;
/**
* @author Sergey Evdokimov
*/
@@ -45,7 +48,19 @@ public class DefaultGroovyShellRunner extends GroovyShellRunner {
@Override
public JavaParameters createJavaParameters(@NotNull Module module) throws ExecutionException {
JavaParameters res = GroovyScriptRunConfiguration.createJavaParametersWithSdk(module);
DefaultGroovyScriptRunner.configureGenericGroovyRunner(res, module, "org.codehaus.groovy.tools.shell.Main", !hasGroovyAll(module), true);
boolean useBundled = !hasGroovyAll(module);
DefaultGroovyScriptRunner.configureGenericGroovyRunner(res, module, "org.codehaus.groovy.tools.shell.Main", false, true);
if (useBundled) {
String parent = GroovyUtils.getBundledGroovyJar().getParent();
String groovyHome = parent + File.separator + "groovy";
File libDir = new File(groovyHome + File.separator + "lib");
assert libDir.isDirectory();
for (File file : libDir.listFiles()) {
res.getClassPath().add(file);
}
GroovyScriptRunner.setGroovyHome(res, groovyHome);
}
res.setWorkingDirectory(getWorkingDirectory(module));
return res;
@@ -79,7 +79,7 @@ public abstract class GroovyScriptRunner {
}
}
protected static void setGroovyHome(JavaParameters params, @NotNull String groovyHome) {
public static void setGroovyHome(JavaParameters params, @NotNull String groovyHome) {
params.getVMParametersList().add("-Dgroovy.home=" + groovyHome);
if (groovyHome.contains("grails")) { //a bit of a hack
params.getVMParametersList().add("-Dgrails.home=" + groovyHome);