Kotlin Help

Compiler plugins

Compiler plugins hook into the compilation process to analyze or change code while it's being compiled, without modifying the compiler itself. For example, they can annotate code or generate new code to make it compatible with other frameworks or APIs.

This page explains the Kotlin compiler plugins available to you and what you can do if none of them suits your use case.

The Kotlin team maintains the following compiler plugins:

Plugin

Description

All-open

Automatically makes annotated classes and their members open so frameworks can extend them at runtime.

AtomicFU

Transforms atomic operations into efficient, platform-specific implementations for lock-free concurrency.

DataFrame

Generates typed APIs that let you work with a DataFrame in a safe, Kotlin-friendly way.

jvm-abi-gen

Generates Application Binary Interface (ABI) JARs.

js-plain-objects

Exposes Kotlin classes as plain JavaScript objects to improve interop with JS tooling and libraries.

kapt

Runs Java annotation processors on Kotlin code and generates additional source files.

Lombok

Enables Kotlin code to understand and use code generated by Lombok annotations in Java sources.

no-arg

Generates no-argument constructors for annotated classes to support frameworks that require them.

Power-assert

Enhances assertion failures by showing detailed values for each part of an expression.

SAM with receiver

Allows SAM interfaces to use lambdas with receivers for a more DSL-like syntax.

Serialization

Generates code that serializes and deserializes Kotlin objects without reflection.

The Android team at Google maintains:

Plugin

Description

Compose compiler Gradle plugin

Integrates the Compose compiler with Gradle to enable declarative UI features and Compose-specific optimizations.

Parcelize plugin

Generates Parcelable implementations automatically so you can pass Kotlin objects between Android components.

If you need to adapt the compilation process in a way that these plugins don't cover, first check whether you can use the Kotlin Symbol Processing (KSP) API or an external linter such as Android lint. You can browse our Kotlin Slack or reach out and ask for advice about your use case.

If you still can't find what you need, you can create a custom compiler plugin. Use this approach only as a last resort, because the Kotlin compiler plugin API is unstable. If you create a custom compiler plugin, you need to invest significant ongoing effort to maintain it, since each new compiler release introduces breaking changes.

02 February 2026