KotlinPoet
A Kotlin and Java API for generating .kt Kotlin source files programmatically.
KotlinPoet is an API for generating Kotlin source files from Java or Kotlin code. It lets a program construct .kt files programmatically rather than by hand, producing classes, functions, properties, and other Kotlin constructs through a builder-style interface.
It is commonly used by code generators and annotation processors that need to emit real Kotlin source rather than assemble text directly. The project is written in Kotlin and distributed under the Apache License 2.0.