[KAPT] KT-62059 Disable incremental stub generation in K2

This commit is contained in:
strangepleasures
2023-10-12 13:37:23 +00:00
committed by Space Team
parent a8c6074c45
commit 2319e11ff1
3 changed files with 11 additions and 6 deletions
@@ -351,13 +351,13 @@ open class Kapt3IT : Kapt3BaseIT() {
@DisplayName("Kapt is working with incremental compilation")
@GradleTest
fun testSimpleWithIC(gradleVersion: GradleVersion) {
open fun testSimpleWithIC(gradleVersion: GradleVersion) {
doTestSimpleWithIC(gradleVersion)
}
@DisplayName("Kapt is working with incremental compilation, when kotlin.incremental.useClasspathSnapshot=true")
@GradleTest
fun testSimpleWithIC_withClasspathSnapshot(gradleVersion: GradleVersion) {
open fun testSimpleWithIC_withClasspathSnapshot(gradleVersion: GradleVersion) {
doTestSimpleWithIC(gradleVersion, useClasspathSnapshot = true)
}
@@ -21,10 +21,6 @@ class Kapt4IT : Kapt3IT() {
forceKapt4()
}
@Disabled("Enable when KT-61845 is fixed")
override fun testKt18799(gradleVersion: GradleVersion) {}
@Disabled("Doesn't make sense in Kapt 4")
override fun useGeneratedKotlinSourceK2(gradleVersion: GradleVersion) {}
@@ -78,6 +74,12 @@ class Kapt4ClassLoadersCacheIT : Kapt3ClassLoadersCacheIT() {
@Disabled("Doesn't work in 2.0. Neither with Kapt 3 nor with Kapt 4")
override fun testMPPKaptPresence(gradleVersion: GradleVersion) {}
@Disabled("Incremental compilation doesn't work in 2.0")
override fun testSimpleWithIC(gradleVersion: GradleVersion) {}
@Disabled("Incremental compilation doesn't work in 2.0")
override fun testSimpleWithIC_withClasspathSnapshot(gradleVersion: GradleVersion) {}
}
fun TestProject.forceKapt4() {
@@ -152,4 +152,7 @@ abstract class KaptGenerateStubsTask @Inject constructor(
args.freeArgs += (scriptSources.asFileTree.files + javaSources.files + sources.asFileTree.files).map { it.absolutePath }
}
}
override fun isIncrementalCompilationEnabled(): Boolean =
super.isIncrementalCompilationEnabled() && !useK2Kapt.get() && ("-Xuse-kapt4" !in compilerOptions.freeCompilerArgs.get())
}