Could we hope for annotation processing one day in...
# multiplatform
g
Could we hope for annotation processing one day in non-jvm projects? Is that too far fetched?
👍 2
i
Good question. Annotation processing does work with the compiler but I'm not sure how extensible that is. For instance you can use
@Jvm*
annotations
o
Guess IR compiler plugins are MPP way of annotation processing
g
@olonho Do you have any example of generating complete classes (hopefully with KotlinPoet) and using it in a project?
g
Thanks, really interesting.
Once code is created and generated based on a compiler plugin, does the class exist on the classpath and the dev can just import it?
s
Importing is made possible by another part of the plugin which injects corresponding declarations to the frontend. IR is for the compiler backend only.
g
Would that be an IntelliJ plugin or a gradle one?
I guess I have examples of that in kotlinx-serialization as well since we can call directly serializer() ?
s
Would that be an IntelliJ plugin or a gradle one?
Technically it is compiler plugin.
I guess I have examples of that in kotlinx-serialization as well since we can call directly serializer() ? (edited)
Yes, kotlinx.serialization compiler plugin should have examples of that.