You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/topics/kapt.md
+28-2Lines changed: 28 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,13 +78,28 @@ Follow these steps:
78
78
{style="warning"}
79
79
80
80
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/),
81
-
which brings performance improvements and many other benefits. To use the K2 compiler in your project, add the following
82
-
options to your `gradle.properties` file:
81
+
which brings performance improvements and many other benefits. To use the K2 compiler in your Gradle project, add the following
82
+
option to your `gradle.properties` file:
83
83
84
84
```kotlin
85
85
kapt.use.k2=true
86
86
```
87
87
88
+
If you use the Maven build system, update your `pom.xml` file:
89
+
90
+
```xml
91
+
<configuration>
92
+
...
93
+
<args>
94
+
<arg>-Xuse-k2-kapt</arg>
95
+
</args>
96
+
</configuration>
97
+
```
98
+
99
+
> To enable the kapt plugin in your Maven project, see [](#use-in-maven).
100
+
>
101
+
{style="tip"}
102
+
88
103
If you encounter any issues when using kapt with the K2 compiler, please report them to our
89
104
[issue tracker](http://kotl.in/issue).
90
105
@@ -370,6 +385,17 @@ For example:
370
385
</configuration>
371
386
```
372
387
388
+
To enable the kapt plugin with the K2 compiler, add the `-Xuse-k2-kapt` compiler option:
389
+
390
+
```xml
391
+
<configuration>
392
+
...
393
+
<args>
394
+
<arg>-Xuse-k2-kapt</arg>
395
+
</args>
396
+
</configuration>
397
+
```
398
+
373
399
## Use in IntelliJ build system
374
400
375
401
kapt is not supported for IntelliJ IDEA's own build system. Launch the build from the "Maven Projects"
0 commit comments