Run KAPT non-incrementally if annotation processor classpath changes
Annotation processor classpath for a KAPT run is recorded, and the current run is compared against the previous one. If those differ, KAPT should run non-incrementally. Test: KaptIncrementalWithIsolatingApt.testChangingAnnotationProcessorClasspath
This commit is contained in:
committed by
Yan Zhulanow
parent
2412b5f992
commit
0a26742501
+22
-1
@@ -8,7 +8,6 @@ package org.jetbrains.kotlin.gradle
|
||||
import org.jetbrains.kotlin.gradle.incapt.IncrementalProcessor
|
||||
import org.jetbrains.kotlin.gradle.util.modify
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
import java.io.File
|
||||
import java.util.zip.ZipEntry
|
||||
@@ -65,6 +64,28 @@ class KaptIncrementalWithIsolatingApt : KaptIncrementalIT() {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testChangingAnnotationProcessorClasspath() {
|
||||
val project = getProject()
|
||||
|
||||
project.build("clean", "build") {
|
||||
assertSuccessful()
|
||||
}
|
||||
|
||||
project.gradleBuildScript().appendText(
|
||||
"""
|
||||
|
||||
dependencies {
|
||||
kapt 'com.google.guava:guava:12.0'
|
||||
}
|
||||
""".trimIndent()
|
||||
)
|
||||
project.build("build") {
|
||||
assertSuccessful()
|
||||
assertContains("Unable to use existing data, re-initializing classpath information for KAPT.")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private const val patternApt = "Processing java sources with annotation processors:"
|
||||
|
||||
Reference in New Issue
Block a user