Compile-time AST transformation


#1

I would love to port Spock to Kotlin.  As a totally subjective matter of personal taste, I prefer the label style over the nested closure style of Speck, Scalatest, specs, etc.  Spock leverages a compile-time AST transformation to generate bytecode as the Groovy compiler works, e.g:

@GroovyASTTransformation(phase = CompilePhase.SEMANTIC_ANALYSIS)

Is there a similar AST transformation hook into one of the Kotlin compiler phases now or any interest in adding one?

The only alternative is to use an annotation processor to inject AST transformations into the bytecode.  Since IntelliJ has annotation processing turned off by default, this is less than ideal.

Thanks!
Jon


#2

AST Transformations are not supported yet. Annotation processing won't really work for your case either.