I spent some time playing with compiler plugin, and I put up a sample project that uses
- IR transformation
- Works for JVM and Konan (Kotlin/Native)
- Publish an unshaded version of the plugin for Konan
- Works with Kotlin 1.3.61 (since Symbol lookups are broken in Kotlin 1.3.71 onward)
The plugin performs a simple transformation of String property accessor of a field, to make it return the backing field value with a prefix.
I hope this could be useful for people trying to start playing with the compiler plugin API, since there's no official documentation yet, PR welcomed 🙂
https://github.com/nhachicha/sample-KMP-compiler-plugin/