Created
July 1, 2011 18:12
-
-
Save kiy0taka/1059105 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.swing.UIManager | |
import groovy.ui.Console | |
import org.codehaus.groovy.control.CompilerConfiguration | |
import org.codehaus.groovy.control.customizers.ASTTransformationCustomizer | |
import groovy.transform.* | |
def transformations = [ThreadInterrupt, Canonical] | |
Console.metaClass.newScript = { ClassLoader parent, Binding binding -> | |
def config = new CompilerConfiguration() | |
config.addCompilationCustomizers(*transformations.collect{new ASTTransformationCustomizer(it)}) | |
delegate.shell = new GroovyShell(parent, binding, config) | |
} | |
UIManager.lookAndFeel = UIManager.systemLookAndFeelClassName | |
new Console(Console.class.classLoader.getRootLoader()).run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment