[groovy] rename console.txt to console.groovy

This commit is contained in:
Daniil Ovchinnikov
2018-02-07 20:32:32 +03:00
parent 96d70151bb
commit 53da81b380
3 changed files with 21 additions and 49 deletions
@@ -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'
@@ -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'
@@ -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;