I have created a DSL based Kotlin Code generation library called Kotlin-Robot. I know about KotlinPoet, but this library didn’t fill my needs, because it takes a very Java-like approach to builders, instead of making use of Kotlin’s excellent DSL support.
I already use kotlin-robot in another project of mine, where I wrote a pretty big annotation processor using the kotlin-robot DSL to generate Kotlin source files. It works out very well, and I think writing my own library was really worth it.
If somebody wants to use kotlin-robot, feel free to follow the instructions in the README, to build the project locally. Any contributions, comments or questions about the library are very welcome!