groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject groovy git commit: GROOVY-8351: groovy-starter.conf could be extended to support configscript (closes #616)
Date Mon, 16 Oct 2017 22:33:48 GMT
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_6_X 297970484 -> 81a684bb7


GROOVY-8351: groovy-starter.conf could be extended to support configscript (closes #616)


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/81a684bb
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/81a684bb
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/81a684bb

Branch: refs/heads/GROOVY_2_6_X
Commit: 81a684bb7c9859bd26a87affefa8a1fea21c2b6c
Parents: 2979704
Author: paulk <paulk@asert.com.au>
Authored: Wed Oct 11 21:02:58 2017 +1000
Committer: paulk <paulk@asert.com.au>
Committed: Tue Oct 17 08:33:36 2017 +1000

----------------------------------------------------------------------
 src/main/groovy/ui/GroovyMain.java              | 40 +++++++++++++-------
 .../ASTTransformationCustomizer.groovy          |  2 +-
 .../groovy/tools/FileSystemCompiler.java        | 31 +++++++--------
 .../groovy/tools/LoaderConfiguration.java       | 10 ++++-
 .../groovy/inspect/swingui/AstBrowser.groovy    |  9 +++--
 .../swingui/AstNodeToScriptAdapter.groovy       |  6 ++-
 .../swingui/ScriptToTreeNodeAdapter.groovy      | 14 ++++---
 .../src/main/groovy/groovy/ui/Console.groovy    | 39 +++++++++++++++----
 .../main/resources/groovy/ui/Console.properties |  2 +
 9 files changed, 102 insertions(+), 51 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/81a684bb/src/main/groovy/ui/GroovyMain.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/ui/GroovyMain.java b/src/main/groovy/ui/GroovyMain.java
index 04c5a14..db1efed 100644
--- a/src/main/groovy/ui/GroovyMain.java
+++ b/src/main/groovy/ui/GroovyMain.java
@@ -38,6 +38,7 @@ import org.codehaus.groovy.runtime.InvokerHelper;
 import org.codehaus.groovy.runtime.InvokerInvocationException;
 import org.codehaus.groovy.runtime.ResourceGroovyMethods;
 import org.codehaus.groovy.runtime.StackTraceUtils;
+import org.codehaus.groovy.runtime.StringGroovyMethods;
 
 import java.io.*;
 import java.math.BigInteger;
@@ -47,6 +48,7 @@ import java.net.URL;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.Enumeration;
+import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Properties;
@@ -272,26 +274,36 @@ public class GroovyMain {
             main.conf.setScriptBaseClass(line.getOptionValue("basescript"));
         }
 
-        if (line.hasOption("configscript")) {
-            String path = line.getOptionValue("configscript");
-            File groovyConfigurator = new File(path);
-            Binding binding = new Binding();
-            binding.setVariable("configuration", main.conf);
-
-            CompilerConfiguration configuratorConfig = new CompilerConfiguration();
-            ImportCustomizer customizer = new ImportCustomizer();
-            customizer.addStaticStars("org.codehaus.groovy.control.customizers.builder.CompilerCustomizationBuilder");
-            configuratorConfig.addCompilationCustomizers(customizer);
-
-            GroovyShell shell = new GroovyShell(binding, configuratorConfig);
-            shell.evaluate(groovyConfigurator);
+        String configScripts = System.getProperty("groovy.starter.configscripts", null);
+        if (line.hasOption("configscript") || (configScripts != null && !configScripts.isEmpty()))
{
+            List<String> scripts = new ArrayList<String>();
+            if (line.hasOption("configscript")) {
+                scripts.add(line.getOptionValue("configscript"));
+            }
+            if (configScripts != null) {
+                scripts.addAll(StringGroovyMethods.tokenize((CharSequence) configScripts,
','));
+            }
+            processConfigScripts(scripts, main.conf);
         }
 
         main.args = args;
-
         return main.run();
     }
 
+    public static void processConfigScripts(List<String> scripts, CompilerConfiguration
conf) throws IOException {
+        if (scripts.isEmpty()) return;
+        Binding binding = new Binding();
+        binding.setVariable("configuration", conf);
+        CompilerConfiguration configuratorConfig = new CompilerConfiguration();
+        ImportCustomizer customizer = new ImportCustomizer();
+        customizer.addStaticStars("org.codehaus.groovy.control.customizers.builder.CompilerCustomizationBuilder");
+        configuratorConfig.addCompilationCustomizers(customizer);
+        GroovyShell shell = new GroovyShell(binding, configuratorConfig);
+        for (String script : scripts) {
+            shell.evaluate(new File(script));
+        }
+    }
+
 
     /**
      * Run the script.

http://git-wip-us.apache.org/repos/asf/groovy/blob/81a684bb/src/main/org/codehaus/groovy/control/customizers/ASTTransformationCustomizer.groovy
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/control/customizers/ASTTransformationCustomizer.groovy
b/src/main/org/codehaus/groovy/control/customizers/ASTTransformationCustomizer.groovy
index 22b08a6..cbf992a 100644
--- a/src/main/org/codehaus/groovy/control/customizers/ASTTransformationCustomizer.groovy
+++ b/src/main/org/codehaus/groovy/control/customizers/ASTTransformationCustomizer.groovy
@@ -85,7 +85,7 @@ import org.codehaus.groovy.control.CompilationUnit
  */
 class ASTTransformationCustomizer extends CompilationCustomizer implements CompilationUnitAware
{
     private final AnnotationNode annotationNode;
-    private final ASTTransformation transformation
+    final ASTTransformation transformation
 
     protected CompilationUnit compilationUnit;
     private boolean applied = false; // used for global AST transformations

http://git-wip-us.apache.org/repos/asf/groovy/blob/81a684bb/src/main/org/codehaus/groovy/tools/FileSystemCompiler.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/tools/FileSystemCompiler.java b/src/main/org/codehaus/groovy/tools/FileSystemCompiler.java
index f254a24..d108cfc 100644
--- a/src/main/org/codehaus/groovy/tools/FileSystemCompiler.java
+++ b/src/main/org/codehaus/groovy/tools/FileSystemCompiler.java
@@ -18,9 +18,7 @@
  */
 package org.codehaus.groovy.tools;
 
-import groovy.lang.Binding;
 import groovy.lang.GroovyResourceLoader;
-import groovy.lang.GroovyShell;
 import groovy.lang.GroovySystem;
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.CommandLineParser;
@@ -31,8 +29,8 @@ import org.apache.commons.cli.Options;
 import org.codehaus.groovy.control.CompilationUnit;
 import org.codehaus.groovy.control.CompilerConfiguration;
 import org.codehaus.groovy.control.ConfigurationException;
-import org.codehaus.groovy.control.customizers.ImportCustomizer;
 import org.codehaus.groovy.runtime.DefaultGroovyStaticMethods;
+import org.codehaus.groovy.runtime.StringGroovyMethods;
 import org.codehaus.groovy.tools.javac.JavaAwareCompilationUnit;
 
 import java.io.BufferedReader;
@@ -47,6 +45,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.Arrays;
 
+import static groovy.ui.GroovyMain.processConfigScripts;
+
 /**
  * Command-line compiler (aka. <tt>groovyc</tt>).
  */
@@ -305,21 +305,18 @@ public class FileSystemCompiler {
             configuration.getOptimizationOptions().put("indy", true);
         }
 
-        if (cli.hasOption("configscript")) {
-            String path = cli.getOptionValue("configscript");
-            File groovyConfigurator = new File(path);
-            Binding binding = new Binding();
-            binding.setVariable("configuration", configuration);
-
-            CompilerConfiguration configuratorConfig = new CompilerConfiguration();
-            ImportCustomizer customizer = new ImportCustomizer();
-            customizer.addStaticStars("org.codehaus.groovy.control.customizers.builder.CompilerCustomizationBuilder");
-            configuratorConfig.addCompilationCustomizers(customizer);
-
-            GroovyShell shell = new GroovyShell(binding, configuratorConfig);
-            shell.evaluate(groovyConfigurator);
+        String configScripts = System.getProperty("groovy.starter.configscripts", null);
+        if (cli.hasOption("configscript") || (configScripts != null && !configScripts.isEmpty()))
{
+            List<String> scripts = new ArrayList<String>();
+            if (cli.hasOption("configscript")) {
+                scripts.add(cli.getOptionValue("configscript"));
+            }
+            if (configScripts != null) {
+                scripts.addAll(StringGroovyMethods.tokenize((CharSequence) configScripts,
','));
+            }
+            processConfigScripts(scripts, configuration);
         }
-        
+
         return configuration;
     }
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/81a684bb/src/main/org/codehaus/groovy/tools/LoaderConfiguration.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/tools/LoaderConfiguration.java b/src/main/org/codehaus/groovy/tools/LoaderConfiguration.java
index 5e43194..ff9b357 100644
--- a/src/main/org/codehaus/groovy/tools/LoaderConfiguration.java
+++ b/src/main/org/codehaus/groovy/tools/LoaderConfiguration.java
@@ -19,6 +19,7 @@
 package org.codehaus.groovy.tools;
 
 import org.apache.groovy.util.SystemUtil;
+import org.codehaus.groovy.runtime.DefaultGroovyMethods;
 
 import java.io.BufferedReader;
 import java.io.File;
@@ -78,7 +79,7 @@ import java.util.regex.Pattern;
  */
 public class LoaderConfiguration {
 
-    private static final String MAIN_PREFIX = "main is", LOAD_PREFIX = "load", GRAB_PREFIX
= "grab", PROP_PREFIX = "property";
+    private static final String MAIN_PREFIX = "main is", LOAD_PREFIX = "load", GRAB_PREFIX
= "grab", PROP_PREFIX = "property", CONFIGSCRIPT_PREFIX = "configscript";
     private final List<URL> classPath = new ArrayList<URL>();
     private String main;
     private boolean requireMain;
@@ -87,6 +88,7 @@ public class LoaderConfiguration {
     private static final String MATCH_FILE_NAME = "\\\\E[^/]+?\\\\Q";
     private static final String MATCH_ALL = "\\\\E.+?\\\\Q";
     private final List<String> grabList = new ArrayList<String>();
+    private final List<String> configScripts = new ArrayList<String>();
 
     /**
      * creates a new loader configuration
@@ -129,12 +131,18 @@ public class LoaderConfiguration {
                 String params = line.substring(PROP_PREFIX.length()).trim();
                 String key = SystemUtil.setSystemPropertyFrom(params);
                 System.setProperty(key, assignProperties(System.getProperty(key)));
+            } else if (line.startsWith(CONFIGSCRIPT_PREFIX)) {
+                String script = line.substring(CONFIGSCRIPT_PREFIX.length()).trim();
+                configScripts.add(assignProperties(script));
             } else {
                 throw new IOException("unexpected line in " + lineNumber + " : " + line);
             }
         }
 
         if (requireMain && main == null) throw new IOException("missing main class
definition in config file");
+        if (!configScripts.isEmpty()) {
+            System.setProperty("groovy.starter.configscripts", DefaultGroovyMethods.join((Iterable)configScripts,
","));
+        }
     }
 
     /*

http://git-wip-us.apache.org/repos/asf/groovy/blob/81a684bb/subprojects/groovy-console/src/main/groovy/groovy/inspect/swingui/AstBrowser.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-console/src/main/groovy/groovy/inspect/swingui/AstBrowser.groovy
b/subprojects/groovy-console/src/main/groovy/groovy/inspect/swingui/AstBrowser.groovy
index 5e7ee1b..4108fee 100644
--- a/subprojects/groovy-console/src/main/groovy/groovy/inspect/swingui/AstBrowser.groovy
+++ b/subprojects/groovy-console/src/main/groovy/groovy/inspect/swingui/AstBrowser.groovy
@@ -22,6 +22,7 @@ import groovy.lang.GroovyClassLoader.ClassCollector
 import groovy.swing.SwingBuilder
 import org.codehaus.groovy.ast.ClassNode
 import org.codehaus.groovy.control.CompilationUnit
+import org.codehaus.groovy.control.CompilerConfiguration
 import org.codehaus.groovy.control.Phases
 import org.codehaus.groovy.control.SourceUnit
 import org.objectweb.asm.ClassReader
@@ -70,11 +71,13 @@ class AstBrowser {
     GeneratedBytecodeAwareGroovyClassLoader classLoader
     def prefs = new AstBrowserUiPreferences()
     Action refreshAction
+    private CompilerConfiguration config
 
-    AstBrowser(inputArea, rootElement, classLoader) {
+    AstBrowser(inputArea, rootElement, classLoader, config = null) {
         this.inputArea = inputArea
         this.rootElement = rootElement
         this.classLoader = new GeneratedBytecodeAwareGroovyClassLoader(classLoader)
+        this.config = config
     }
 
     SwingBuilder swing
@@ -445,7 +448,7 @@ class AstBrowser {
         swing.doOutside {
             try {
 
-                String result = new AstNodeToScriptAdapter().compileToScript(source, phaseId,
classLoader, showScriptFreeForm, showScriptClass)
+                String result = new AstNodeToScriptAdapter().compileToScript(source, phaseId,
classLoader, showScriptFreeForm, showScriptClass, config)
                 swing.doLater {
                     decompiledSource.textEditor.text = result 
                     decompiledSource.textEditor.setCaretPosition(0)
@@ -474,7 +477,7 @@ class AstBrowser {
         swing.doOutside {
             try {
                 def nodeMaker = new SwingTreeNodeMaker()
-                def adapter = new ScriptToTreeNodeAdapter(classLoader, showScriptFreeForm,
showScriptClass, showClosureClasses, nodeMaker)
+                def adapter = new ScriptToTreeNodeAdapter(classLoader, showScriptFreeForm,
showScriptClass, showClosureClasses, nodeMaker, config)
                 classLoader.clearBytecodeTable()
                 def result = adapter.compile(script, compilePhase, showIndyBytecode)
                 swing.doLater {

http://git-wip-us.apache.org/repos/asf/groovy/blob/81a684bb/subprojects/groovy-console/src/main/groovy/groovy/inspect/swingui/AstNodeToScriptAdapter.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-console/src/main/groovy/groovy/inspect/swingui/AstNodeToScriptAdapter.groovy
b/subprojects/groovy-console/src/main/groovy/groovy/inspect/swingui/AstNodeToScriptAdapter.groovy
index 2a90ed7..98eddac 100644
--- a/subprojects/groovy-console/src/main/groovy/groovy/inspect/swingui/AstNodeToScriptAdapter.groovy
+++ b/subprojects/groovy-console/src/main/groovy/groovy/inspect/swingui/AstNodeToScriptAdapter.groovy
@@ -78,9 +78,11 @@ and [compilephase] is a valid Integer based org.codehaus.groovy.control.CompileP
      *    Whether or not to show the script portion of the source code
      * @param showScriptClass
      *    Whether or not to show the Script class from the source code
+     * @param config
+     *    optional compiler configuration
      * @returns the source code from the AST state
      */
-    String compileToScript(String script, int compilePhase, ClassLoader classLoader = null,
boolean showScriptFreeForm = true, boolean showScriptClass = true) {
+    String compileToScript(String script, int compilePhase, ClassLoader classLoader = null,
boolean showScriptFreeForm = true, boolean showScriptClass = true, CompilerConfiguration config
= null) {
 
         def writer = new StringWriter()
 
@@ -88,7 +90,7 @@ and [compilephase] is a valid Integer based org.codehaus.groovy.control.CompileP
 
         def scriptName = 'script' + System.currentTimeMillis() + '.groovy'
         GroovyCodeSource codeSource = new GroovyCodeSource(script, scriptName, '/groovy/script')
-        CompilationUnit cu = new CompilationUnit(CompilerConfiguration.DEFAULT, codeSource.codeSource,
classLoader)
+        CompilationUnit cu = new CompilationUnit(config ?: CompilerConfiguration.DEFAULT,
codeSource.codeSource, classLoader)
         cu.addPhaseOperation(new AstNodeToScriptVisitor(writer, showScriptFreeForm, showScriptClass),
compilePhase)
         cu.addSource(codeSource.getName(), script)
         try {

http://git-wip-us.apache.org/repos/asf/groovy/blob/81a684bb/subprojects/groovy-console/src/main/groovy/groovy/inspect/swingui/ScriptToTreeNodeAdapter.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-console/src/main/groovy/groovy/inspect/swingui/ScriptToTreeNodeAdapter.groovy
b/subprojects/groovy-console/src/main/groovy/groovy/inspect/swingui/ScriptToTreeNodeAdapter.groovy
index a3ab9a6..b5b6e11 100644
--- a/subprojects/groovy-console/src/main/groovy/groovy/inspect/swingui/ScriptToTreeNodeAdapter.groovy
+++ b/subprojects/groovy-console/src/main/groovy/groovy/inspect/swingui/ScriptToTreeNodeAdapter.groovy
@@ -46,9 +46,6 @@ import org.codehaus.groovy.control.CompilationFailedException
  * not appear in the tree.
  *
  * The String label of a tree node is defined by classname in AstBrowserProperties.properties.
- *
- * @author Hamlet D'Arcy 
- * @author Roshan Dawrani
  */
 class ScriptToTreeNodeAdapter {
 
@@ -56,6 +53,7 @@ class ScriptToTreeNodeAdapter {
     boolean showScriptFreeForm, showScriptClass, showClosureClasses
     final GroovyClassLoader classLoader
     final AstBrowserNodeMaker nodeMaker
+    private final CompilerConfiguration config
 
     static {
         try {
@@ -83,12 +81,13 @@ class ScriptToTreeNodeAdapter {
         }
     }
     
-    ScriptToTreeNodeAdapter(classLoader, showScriptFreeForm, showScriptClass, showClosureClasses,
nodeMaker) {
+    ScriptToTreeNodeAdapter(classLoader, showScriptFreeForm, showScriptClass, showClosureClasses,
nodeMaker, config = null) {
         this.classLoader = classLoader ?: new GroovyClassLoader(getClass().classLoader)
         this.showScriptFreeForm = showScriptFreeForm
         this.showScriptClass = showScriptClass
         this.showClosureClasses = showClosureClasses
         this.nodeMaker = nodeMaker
+        this.config = config
     }
 
     /**
@@ -104,9 +103,12 @@ class ScriptToTreeNodeAdapter {
     def compile(String script, int compilePhase, boolean indy=false) {
         def scriptName = 'script' + System.currentTimeMillis() + '.groovy'
         GroovyCodeSource codeSource = new GroovyCodeSource(script, scriptName, '/groovy/script')
-        CompilerConfiguration cc = new CompilerConfiguration(CompilerConfiguration.DEFAULT)
+        CompilerConfiguration cc = new CompilerConfiguration(config ?: CompilerConfiguration.DEFAULT)
+        if (config) {
+            cc.addCompilationCustomizers(*config.compilationCustomizers)
+        }
         if (indy) {
-            cc.getOptimizationOptions().put(CompilerConfiguration.INVOKEDYNAMIC, true)
+            cc.optimizationOptions.put(CompilerConfiguration.INVOKEDYNAMIC, true)
         }
         CompilationUnit cu = new CompilationUnit(cc, codeSource.codeSource, classLoader)
         cu.setClassgenCallback(classLoader.createCollector(cu, null))

http://git-wip-us.apache.org/repos/asf/groovy/blob/81a684bb/subprojects/groovy-console/src/main/groovy/groovy/ui/Console.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-console/src/main/groovy/groovy/ui/Console.groovy b/subprojects/groovy-console/src/main/groovy/groovy/ui/Console.groovy
index 7663719..729e45c 100644
--- a/subprojects/groovy-console/src/main/groovy/groovy/ui/Console.groovy
+++ b/subprojects/groovy-console/src/main/groovy/groovy/ui/Console.groovy
@@ -24,7 +24,9 @@ import groovy.swing.SwingBuilder
 import groovy.ui.text.FindReplaceUtility
 import org.codehaus.groovy.antlr.LexerFrame
 import org.codehaus.groovy.control.messages.SimpleMessage
+import org.codehaus.groovy.runtime.StringGroovyMethods
 import org.codehaus.groovy.tools.shell.util.MessageSource
+import org.codehaus.groovy.transform.ThreadInterruptibleASTTransformation
 
 import java.awt.Component
 import java.awt.EventQueue
@@ -191,7 +193,7 @@ class Console implements CaretListener, HyperlinkListener, ComponentListener,
Fo
     Action selectWordAction
     Action selectPreviousWordAction
 
-    ConsolePreferences consolePreferences;
+    ConsolePreferences consolePreferences
 
     static void main(args) {
         CliBuilder cli = new CliBuilder(usage: 'groovyConsole [options] [filename]', stopAtNonOption:
false)
@@ -204,6 +206,7 @@ class Console implements CaretListener, HyperlinkListener, ComponentListener,
Fo
             pa(longOpt: 'parameters', messages['cli.option.parameters.description'])
             i(longOpt: 'indy', messages['cli.option.indy.description'])
             D(longOpt: 'define', args: 2, argName: 'name=value', valueSeparator: '=', messages['cli.option.define.description'])
+            _(longOpt: 'configscript', args: 1, messages['cli.option.configscript.description'])
         }
         OptionAccessor options = cli.parse(args)
 
@@ -235,7 +238,19 @@ class Console implements CaretListener, HyperlinkListener, ComponentListener,
Fo
         UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName())
 
         def baseConfig = new CompilerConfiguration()
-        baseConfig.setParameters((boolean) options.hasOption("pa"))
+        String starterConfigScripts = System.getProperty("groovy.starter.configscripts",
null)
+        if (options.configscript || (starterConfigScripts != null && !starterConfigScripts.isEmpty()))
{
+            List<String> configScripts = new ArrayList<String>()
+            if (options.configscript) {
+                configScripts.add(options.configscript)
+            }
+            if (starterConfigScripts != null) {
+                configScripts.addAll(StringGroovyMethods.tokenize((CharSequence) starterConfigScripts,
','))
+            }
+            GroovyMain.processConfigScripts(configScripts, baseConfig)
+        }
+
+        baseConfig.setParameters(options.hasOption("pa"))
 
         if (options.i) {
             enableIndy(baseConfig)
@@ -311,8 +326,10 @@ class Console implements CaretListener, HyperlinkListener, ComponentListener,
Fo
 
     void newScript(ClassLoader parent, Binding binding) {
         config = new CompilerConfiguration(baseConfig)
-        if (threadInterrupt) config.addCompilationCustomizers(new ASTTransformationCustomizer(ThreadInterrupt))
-
+        config.addCompilationCustomizers(*baseConfig.compilationCustomizers)
+        if (threadInterrupt) {
+            config.addCompilationCustomizers(new ASTTransformationCustomizer(ThreadInterrupt))
+        }
         shell = new GroovyShell(parent, binding, config)
     }
 
@@ -620,8 +637,16 @@ class Console implements CaretListener, HyperlinkListener, ComponentListener,
Fo
     void threadInterruption(EventObject evt) {
         threadInterrupt = evt.source.selected
         prefs.putBoolean('threadInterrupt', threadInterrupt)
-        def customizers = config.compilationCustomizers
-        customizers.clear()
+        def customizers = config.compilationCustomizers.iterator()
+        while (customizers.hasNext()) {
+            def next = customizers.next()
+            if (next instanceof ASTTransformationCustomizer) {
+                ASTTransformationCustomizer astCustomizer = next
+                if (astCustomizer.transformation instanceof ThreadInterruptibleASTTransformation)
{
+                    customizers.remove()
+                }
+            }
+        }
         if (threadInterrupt) {
             config.addCompilationCustomizers(new ASTTransformationCustomizer(ThreadInterrupt))
         }
@@ -910,7 +935,7 @@ class Console implements CaretListener, HyperlinkListener, ComponentListener,
Fo
     }
 
     void inspectAst(EventObject evt = null) {
-        new AstBrowser(inputArea, rootElement, shell.getClassLoader()).run({ inputArea.getText()
} )
+        new AstBrowser(inputArea, rootElement, shell.getClassLoader(), config).run({ inputArea.getText()
} )
     }
 
     void inspectTokens(EventObject evt = null) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/81a684bb/subprojects/groovy-console/src/main/resources/groovy/ui/Console.properties
----------------------------------------------------------------------
diff --git a/subprojects/groovy-console/src/main/resources/groovy/ui/Console.properties b/subprojects/groovy-console/src/main/resources/groovy/ui/Console.properties
index 3e1436b..f98f237 100644
--- a/subprojects/groovy-console/src/main/resources/groovy/ui/Console.properties
+++ b/subprojects/groovy-console/src/main/resources/groovy/ui/Console.properties
@@ -30,6 +30,8 @@ cli.option.indy.description=Enable InvokeDynamic (Indy) compilation for
scripts
 
 cli.option.define.description=Define a system property
 
+cli.option.configscript.description=A script for tweaking the compiler configuration options
+
 cli.info.version=GroovyConsole {0}
 
 # Preferences Dialog


Mime
View raw message