https://kotlinlang.org logo
#compiler
Title
# compiler
y

y9san9

12/06/2023, 4:44 PM
Hello guys. Trying to write my own K2 compiler plugin, but struggle with attaching it to my project. What do I do: trying to put an error on any
var
property (just for fun) Screenshot 1 – the structure of my project. Screenshot 2 – the old configuration which worked. But when doing like this, IDE do not see generated warnings on compile time, however it works well when I run the code. Screenshot 3 – how I am trying to get it work as gradle plugin Screenshot 4 – my subplugin code. isApplicable never got called. I checked that AutoService generates META-INF services. (gradle plugin itself just registers the extension) Some other info I need to provide?
t

Tóth István Zoltán

12/07/2023, 8:01 AM
Hi, Looking at your screenshots you use a quite different setup than I do. I used this one as a reference: https://github.com/demiurg906/kotlin-compiler-plugin-template Also, a complete, official FIR prototype: https://github.com/JetBrains/kotlin/tree/f266a443562d3930446ce5120efd39297751b76f/plugins/fir-plugin-prototype
I don't AutoService any more but add the service files manually.
6 Views