Skip to content

Instantly share code, notes, and snippets.

@bullshit
Forked from itzg/UsesGroovyShell.groovy
Created December 28, 2015 13:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bullshit/47450a21411bb5e86ce1 to your computer and use it in GitHub Desktop.
Save bullshit/47450a21411bb5e86ce1 to your computer and use it in GitHub Desktop.
Enabling Groovy invokedynamic ("indy") support in a Gradle build
compileJava {
sourceCompatibility = 1.7
targetCompatibility = 1.7
}
compileGroovy {
groovyOptions.optimizationOptions.indy = true
}
dependencies {
compile 'org.codehaus.groovy:groovy-all:2.2.2:indy'
}
// ....
def compilerConfig = new CompilerConfiguration()
compilerConfig.optimizationOptions.indy = true
def shell = new GroovyShell(compilerConfig)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment