use of com.disney.groovity.compile.GroovityASTTransformation in project groovity by disney.
the class Groovity method createCompilerConfiguration.
protected CompilerConfiguration createCompilerConfiguration(Map<Integer, Integer> sourceLineNumbers, Collection<String> initDependencies) {
CompilerConfiguration compilerConfiguration = new CompilerConfiguration();
if (scriptBaseClass != null) {
compilerConfiguration.setScriptBaseClass(scriptBaseClass);
compilerConfiguration.addCompilationCustomizers(new ImportCustomizer().addImports(scriptBaseClass));
}
compilerConfiguration.addCompilationCustomizers(new ImportCustomizer().addStarImports("java.util.concurrent", "groovy.transform", "java.util.function", "com.disney.groovity.model").addImports(ClosureWritable.class.getName(), AsyncChannel.class.getName(), GroovityStatistics.class.getName(), Taggable.class.getName(), Tag.class.getName(), Attr.class.getName(), Function.class.getName(), Arg.class.getName(), SkipStatistics.class.getName()));
compilerConfiguration.addCompilationCustomizers(new ASTTransformationCustomizer(new GroovityASTTransformation(this, sourceLineNumbers, initDependencies)));
compilerConfiguration.addCompilationCustomizers(new ASTTransformationCustomizer(new StatsASTTransformation()));
Map<String, Boolean> options = compilerConfiguration.getOptimizationOptions();
options.put(CompilerConfiguration.JDK8, true);
compilerConfigurationDecorators.forEach(decorator -> {
decorator.decorate(compilerConfiguration);
});
return compilerConfiguration;
}
Aggregations