@raulraja I believe that’s the approach the “built-in” Kotlin compiler plugins use. To see this in action for third-party plugins, you can take a look at a compiler plugin I built:
https://github.com/fabianishere/kotlin-plugin-generated. It includes both an IDEA and Gradle plugin