So I may be a unicorn, but I love code generation. I have a project critter that I use to generate some code for use with Morphia. Currently, i'm using a project called roaster to parse my Morphia entities and then generate some code around that. I'm in the process of migrating a project that uses critter to Kotlin and am presented with a problem. With no more Java code to parse, i have to either stop using this generated code or maintain it by hand. I *could* do weird things with maven lifecycles and plugins and leave small segments of code in Java and, thus, parseable. That's entirely doable but decidedly ugh.
Now what I’d love is to update critter to be able to do the same for Kotlin files but that’s where I hit the roadblock. Is there some API I could use or is my only option at this point to shoehorn the kotlin-compiler API in to something that sort of fits the bill? This is not a great option for obvious reasons but not necessarily out of the realm of possibility. Roaster leverages Eclipse’s AST libs for doing its magic. How accessible are the Kotlin bits like this?