I'm doing some work with an AST transformation, and it appears that when using the Groovy-Eclipse compiler, the targetDirectory property is not being set correctly when the transform is executed. The property is set correctly when the same transform is executed from a Gradle project. The sample project/s attached demonstrates the issue.
@CompileStatic
@GroovyASTTransformation(phase = CompilePhase.SEMANTIC_ANALYSIS)
class GroovyAST implements ASTTransformation, CompilationUnitAware {
CompilationUnit unit
@Override
void visit(ASTNode[] nodes, SourceUnit source) {
println "targetDirectory: ${source.configuration.targetDirectory}" // null when executed by Groovy-Eclipse compiler
}
@Override
void setCompilationUnit(CompilationUnit unit) {
this.unit = unit
}
}
I'm doing some work with an AST transformation, and it appears that when using the Groovy-Eclipse compiler, the
targetDirectoryproperty is not being set correctly when the transform is executed. The property is set correctly when the same transform is executed from a Gradle project. The sample project/s attached demonstrates the issue.Sample project: https://github.com/ZacharyKlein/groovy-ast-demo
AST lib (JAR included in the above project): https://github.com/ZacharyKlein/groovy-ast-lib