diff --git a/plugins/groovy/groovy-psi/resources/conf/console.groovy b/plugins/groovy/groovy-psi/resources/conf/console.groovy new file mode 100644 index 000000000000..3efbc6ad9a87 --- /dev/null +++ b/plugins/groovy/groovy-psi/resources/conf/console.groovy @@ -0,0 +1,19 @@ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. + +Binding bind +try { + bind = scriptBinding +} +catch (MissingPropertyException ignore) { + bind = scriptBinding = new Binding() +} +try { + def result = new GroovyShell(bind).run(((String)line).replaceAll('###\\\\n', '\n'), 'ideaGroovyConsole.groovy') + if (result != null) { + System.out.println 'ee2d5778-e2f4-4705-84ef-0847535c32f4' + result + } +} +catch (Throwable e) { + e.printStackTrace() +} +System.out.println '01bd8da7-84b0-4f52-9f98-fd15f4dbc1a7' diff --git a/plugins/groovy/groovy-psi/resources/conf/console.txt b/plugins/groovy/groovy-psi/resources/conf/console.txt deleted file mode 100644 index 0a14be0433b7..000000000000 --- a/plugins/groovy/groovy-psi/resources/conf/console.txt +++ /dev/null @@ -1,33 +0,0 @@ -/* -* Copyright 2000-2012 JetBrains s.r.o. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -Binding bind -try { - bind = scriptBinding -} -catch (MissingPropertyException ignore) { - bind = scriptBinding = new Binding() -} -try { - def result = new GroovyShell(bind).run(((String)line).replaceAll('###\\\\n', '\n'), 'ideaGroovyConsole.groovy') - if (result != null) { - System.out.println 'ee2d5778-e2f4-4705-84ef-0847535c32f4' + result - } -} -catch (Throwable e) { - e.printStackTrace() -} -System.out.println '01bd8da7-84b0-4f52-9f98-fd15f4dbc1a7' diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/console/GroovyConsole.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/console/GroovyConsole.java index b648cbf84307..affc57ba525c 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/console/GroovyConsole.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/console/GroovyConsole.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.plugins.groovy.console; import com.intellij.execution.ExecutionException; @@ -220,7 +206,7 @@ public class GroovyConsole { private static JavaParameters createJavaParameters(@NotNull Module module) throws ExecutionException { JavaParameters res = GroovyScriptRunConfiguration.createJavaParametersWithSdk(module); DefaultGroovyScriptRunner.configureGenericGroovyRunner(res, module, "groovy.ui.GroovyMain", !GroovyConsoleUtil.hasGroovyAll(module), true, true, false); - res.getProgramParametersList().addAll("-p", GroovyScriptRunner.getPathInConf("console.txt")); + res.getProgramParametersList().addAll("-p", GroovyScriptRunner.getPathInConf("console.groovy")); res.setWorkingDirectory(getWorkingDirectory(module)); res.setUseDynamicClasspath(true); return res;