I’m wondering what’s the current state of “compile-time code generation”. What I need is basically an annotation which, if applied, will generate a couple of boilerplate methods for that object/class.
@Hashcode class Foo( val i: Int, val s: String, val b: Boolean)
This is just an example, I know that data classes have
hashCode implementation already. But my case is very similar and I would like to generate a couple of boilerplate methods if the annotation is present.
Where are we currently? Is this supported? Where can I check for a minimal setup to make it work?
I suspect that Moshi and Kotlin Serialization are already doing something like this.