Does anyone have recommendations on libraries/arti...
# kapt
b
Does anyone have recommendations on libraries/articles that covers annotation processing of properties and objects? Is there any way to utilize Kotlin Reflect from Element/TypeElement/etc?
e
You could probably make use of https://github.com/Takhion/kotlin-metadata. Zac Sweers gave a talk about AP at KotlinConf, talked a lot about that library.
b
Yeah, I'm excited for the conf videos to go up during the week
r
Arrow has a meta tool that gives you a full kotlin AST from type element with methods to transform whatever you need and delegates code generation to Kotlin Poet
It also works with and integrates @Eugenio's library which uses extensively to read the metadata that TypeElement lacks https://github.com/arrow-kt/arrow/blob/master/modules/meta/arrow-meta/src/main/java/arrow/meta/encoder/jvm/TypeElementEncoder.kt#L37 and for any
TypeElement
you can get it's now an AST as a
Type
https://github.com/arrow-kt/arrow/blob/master/modules/meta/arrow-meta/src/main/java/arrow/meta/encoder/jvm/TypeElementEncoder.kt#L424
just need to override this method to generate code for any annotated types.