Skip to content

About

No description, website, or topics provided.

Resources

Stars

17 stars

Watchers

3 watching

Forks

Latest commit

 

History

393 Commits

Folders and files

Repository files navigation

Kotlin Compiler Plugin DevKit

Kotlin Experimental JetBrains incubator Kotlin GitHub License

Warning

Here be dragons!

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

Features

  • 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 or NoSuchMethodErrors
  • expect/actual support: Each compiler/IDE version is treated as a separate "platform" (in the KMP sense), so you can expect some methods to exist, and actualize 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.

Getting Started

Use the compiler-plugin-template's devkit branch.

Alternatively, for a pre-existing project, use the Migration guide

Compatibility

The DevKit supports Kotlin 2.2.20+, Gradle 9.2+, and IntelliJ 2025.2+

Further Info

There's a spec

Attributions

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

About

No description, website, or topics provided.

Resources

Stars

17 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages