https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
g

galex

02/13/2019, 10:57 AM
Could we hope for annotation processing one day in non-jvm projects? Is that too far fetched?
👍 2
i

ian.shaun.thomas

02/13/2019, 11:08 AM
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

olonho

02/13/2019, 11:20 AM
Guess IR compiler plugins are MPP way of annotation processing
g

galex

02/19/2019, 10:00 AM
@olonho Do you have any example of generating complete classes (hopefully with KotlinPoet) and using it in a project?
g

galex

02/19/2019, 10:42 AM
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

svyatoslav.scherbina

02/19/2019, 11:23 AM
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

galex

02/19/2019, 12:00 PM
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

svyatoslav.scherbina

02/19/2019, 2:01 PM
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.
2 Views