public class GroovyCompiler extends Object
Compiler for Groovy sources. Primarily a simple Facade for GroovyClassLoader.parseClass with the following additional features:
META-INF/services/org.grails.cli.compiler.CompilerAutoConfiguration
(per the standard java ServiceLoader contract) and applied during compilation
Constructor and description |
---|
GroovyCompiler(GroovyCompilerConfiguration configuration) Create a new GroovyCompiler instance. |
Type Params | Return Type | Name and description |
---|---|---|
|
public void |
addCompilationCustomizers(CompilationCustomizer customizers) |
|
public void |
call(SourceUnit source) |
|
public Class<?>[] |
compile(String sources) Compile the specified Groovy sources, applying any CompilerAutoConfigurations. |
|
public List<ASTTransformation> |
getAstTransformations() Return a mutable list of the ASTTransformations to be applied during compile(String...). |
|
public ExtendedGroovyClassLoader |
getLoader() |
Create a new GroovyCompiler instance.
configuration
- the compiler configurationCompile the specified Groovy sources, applying any CompilerAutoConfigurations. All classes defined in the sources will be returned from this method.
sources
- the sources to compileReturn a mutable list of the ASTTransformations to be applied during compile(String...).