Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions docs/topics/kapt.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,28 @@ Follow these steps:
{style="warning"}

From Kotlin 1.9.20, you can try using the kapt compiler plugin with the [K2 compiler](https://blog.jetbrains.com/kotlin/2021/10/the-road-to-the-k2-compiler/),
which brings performance improvements and many other benefits. To use the K2 compiler in your project, add the following
options to your `gradle.properties` file:
which brings performance improvements and many other benefits. To use the K2 compiler in your Gradle project, add the following
option to your `gradle.properties` file:

```kotlin
kapt.use.k2=true
```

If you use the Maven build system, update your `pom.xml` file:

```xml
<configuration>
...
<args>
<arg>-Xuse-k2-kapt</arg>
</args>
</configuration>
```

> To enable the kapt plugin in your Maven project, see [](#use-in-maven).
>
{style="tip"}

If you encounter any issues when using kapt with the K2 compiler, please report them to our
[issue tracker](http://kotl.in/issue).

Expand Down Expand Up @@ -370,6 +385,17 @@ For example:
</configuration>
```

To enable the kapt plugin with the K2 compiler, add the `-Xuse-k2-kapt` compiler option:

```xml
<configuration>
...
<args>
<arg>-Xuse-k2-kapt</arg>
</args>
</configuration>
```

## Use in IntelliJ build system

kapt is not supported for IntelliJ IDEA's own build system. Launch the build from the "Maven Projects"
Expand Down
Loading