I usually use kotlinpoet as part of an annotation ...
# squarelibraries
d
I usually use kotlinpoet as part of an annotation processor (using kapt or ksp) which has a mechanism to include newly generated kotlin code into the compile process