Does anyone know where to find documentation on how to write a Kotlin compiler plugin? Or at least some general information about the architecture of those plugins. I am currently using JSON-B (Yasson impl) in my project but it can only instantiate a data class when I annotate the constructor and all parameters (providing the parameter name). As a fallback I could of course use the noarg compiler plugin but I was wondering if annotating constructor parameters using a compiler plugin is possible.
y
yole
02/09/2018, 3:10 PM
there is no documentation. compiler plugins are an unsupported and intentionally undocumented feature
g
Gerard de Leeuw
02/09/2018, 3:15 PM
Thanks for the info, I'll see if the noarg plugin will do for now 🙂
c
Czar
02/09/2018, 4:05 PM
Actually you're better off contributing to Yasson impl that to Kotlin compiler, this same problem in Jackson was solved on Jackson side via Kotlin module you could take a look at it for inspiration. I don't know anything about Yasson impl though, so no idea if it's doable
âž• 1
g
gildor
02/12/2018, 2:41 AM
Also Kotlinx.Serialization is good option, at least in the future
And better to invest contribution effort to kotlinx.serialization than to a separate compiler plugin
#C7A1U5PTM
g
Gerard de Leeuw
02/16/2018, 8:55 AM
Thanks for mentioning kotlinx.serialization, that is exactly what I was looking for. Didn't know something like that was already being worked on 🙂
Gerard de Leeuw
02/16/2018, 8:57 AM
The Yasson impl is still being actively developed and as far as I know it doesn't have a plugin/modular architecture like Jackson. So that will be a bit harder to implement than it is in Jackson. So I geuss kotlinx.serialization is the way to go for me.