I was looking into writing a kotlin compiler plugin that could add custom annotations to the INSTANCE field of singleton classes in kotlin (aka kotlin objects).
As I couldn’t find any information on the complete API with javadoc and what methods I need to extend/implement in general to achieve this, I wanted to reach out here to get some help.
I am fairly new to bytecode manipulation. I did some small amount in Java using ASM.
Any hints on how to actually intercept any object compilation (which files do I need to implement) would be a good hint! later on I would love to move it to a gradle plugin so it gets automatically called during compilation. Not sure if this is possible by default or if there is already a library that can do that.
I did dig around kotlin’s allopen gradle compiler plugin but I coudln’t find any code that actually changed the modifier to open.
Thanks for your help!