mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-113519 Groovy Shell fails to open with exceptions
This commit is contained in:
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.
+16
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user