public class Groovy2CompilerHelper
extends java.lang.Object
ScriptArchive
s and outputs a GroovyClassLoader
with the classes pre-loaded into it.
If a parent ClassLoader
is not provided, the current thread context classloader is used.Constructor and Description |
---|
Groovy2CompilerHelper(java.nio.file.Path targetDir) |
Modifier and Type | Method and Description |
---|---|
Groovy2CompilerHelper |
addScriptArchive(ScriptArchive archive) |
Groovy2CompilerHelper |
addSourceFile(java.nio.file.Path groovyFile) |
java.util.Set<org.codehaus.groovy.tools.GroovyClass> |
compile()
Compile the given source and load the resultant classes into a new
ClassNotFoundException |
Groovy2CompilerHelper |
withConfiguration(org.codehaus.groovy.control.CompilerConfiguration compilerConfig) |
Groovy2CompilerHelper |
withParentClassloader(java.lang.ClassLoader parentClassLoader) |
public Groovy2CompilerHelper withParentClassloader(java.lang.ClassLoader parentClassLoader)
public Groovy2CompilerHelper addSourceFile(java.nio.file.Path groovyFile)
public Groovy2CompilerHelper addScriptArchive(ScriptArchive archive)
public Groovy2CompilerHelper withConfiguration(org.codehaus.groovy.control.CompilerConfiguration compilerConfig)
public java.util.Set<org.codehaus.groovy.tools.GroovyClass> compile() throws ScriptCompilationException
ClassNotFoundException
ScriptCompilationException