K2 kapt: add kapt.use.k2 Gradle property

... and `-Kapt-use-k2` CLI flag to enable K2 kapt.

 #KT-61114 Fixed
This commit is contained in:
Alexander Udalov
2023-08-17 17:25:24 +02:00
committed by Space Team
parent 059046a2b1
commit 761221904c
12 changed files with 98 additions and 8 deletions
@@ -0,0 +1,11 @@
# kapt
-language-version 2.0
-Xsuppress-version-warnings
-Kapt-use-k2=true
-Kapt-mode=compile
../simple/Test.kt
# after
Return code: 1
error: [kapt] KAPT "compile" mode is not supported in Kotlin 2.x. Run kapt with -Kapt-mode=stubsAndApt and use kotlinc for the final compilation step.