Warning
The DevKit is very experimental! Try it out and give feedback!
For questions, issues, etc, use the KotlinLang Slack #compiler channel, or file a GitHub issue
A DevKit for Kotlin compiler plugin development
- Multiversioning: your plugin is built, tested, and published for a plethora of compiler and IDE versions. Simply specify a range of supported versions, and the DevKit works out the relevant compiler and IDE versions, compiling your code against each one.
- Source compatibility: your code is compiled against each version's compiler, meaning that source-compatible changes in the compiler (a new default parameter, for example) don't break your plugin! In other words, you won't get any
ClassNotFoundExceptions orNoSuchMethodErrors expect/actualsupport: Each compiler/IDE version is treated as a separate "platform" (in the KMP sense), so you canexpectsome methods to exist, andactualize them for particular compiler versions- Testing: JVM, JS, and Gradle functional tests at the palm of your hand! No complex setup necessary; the DevKit configures the needed Kotlin libraries for
kotlin-compiler-internal-test-framework. Did I mention the tests are multi-versioned too?- There's even multi-versioned dump files!
- IDE support out-of-the-box: your compiler plugin "just works" in IntelliJ-based IDEs (2026.3+). No registry options necessary.
Use the compiler-plugin-template's devkit branch.
Alternatively, for a pre-existing project, use the Migration guide
The DevKit supports Kotlin 2.2.20+, Gradle 9.2+, and IntelliJ 2025.2+
There's a spec
A significant amount of code, particularly version resolution and gradle plugin testing, is inspired by or copied from Metro
Some Gradle incantations were adapted from TestBalloon, Kotlin Gradle Plugin, and Gradle itself