Add tests for running incremental KAPT on JDK9
Add test for aggregating incremental annotation processors and JDK9. This makes sure the implementation is not using any types that have been removed in JDK 9.
This commit is contained in:
committed by
Yan Zhulanow
parent
4da6675640
commit
f89885224e
@@ -118,6 +118,7 @@ tasks.withType<Test> {
|
||||
|
||||
systemProperty("kotlinVersion", rootProject.extra["kotlinVersion"] as String)
|
||||
systemProperty("runnerGradleVersion", gradle.gradleVersion)
|
||||
systemProperty("jdk9Home", rootProject.extra["JDK_9"] as String)
|
||||
systemProperty("jdk10Home", rootProject.extra["JDK_10"] as String)
|
||||
systemProperty("jdk11Home", rootProject.extra["JDK_11"] as String)
|
||||
|
||||
|
||||
+28
@@ -8,7 +8,9 @@ package org.jetbrains.kotlin.gradle
|
||||
import org.jetbrains.kotlin.gradle.util.modify
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Assume
|
||||
import org.junit.Test
|
||||
import java.io.File
|
||||
import kotlin.test.assertFalse
|
||||
|
||||
class KaptIncrementalWithAggregatingApt : KaptIncrementalIT() {
|
||||
@@ -73,6 +75,32 @@ class KaptIncrementalWithAggregatingApt : KaptIncrementalIT() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testIncrementalChangesWithJdk9() {
|
||||
val javaHome = File(System.getProperty("jdk9Home")!!)
|
||||
Assume.assumeTrue("JDK 9 isn't available", javaHome.isDirectory)
|
||||
val options = defaultBuildOptions().copy(javaHome = javaHome)
|
||||
val project = getProject()
|
||||
|
||||
project.build("clean", "build", options = options) {
|
||||
assertSuccessful()
|
||||
}
|
||||
|
||||
project.projectFile("useB.kt").modify { current -> "$current\nfun otherFunction() {}" }
|
||||
project.build("build", options = options) {
|
||||
assertSuccessful()
|
||||
|
||||
assertEquals(
|
||||
setOf(
|
||||
fileInWorkingDir("build/tmp/kapt3/stubs/main/bar/UseBKt.java").canonicalPath,
|
||||
fileInWorkingDir("build/tmp/kapt3/stubs/main/bar/B.java").canonicalPath,
|
||||
fileInWorkingDir("build/tmp/kapt3/stubs/main/baz/UtilKt.java").canonicalPath,
|
||||
fileInWorkingDir("build/tmp/kapt3/stubs/main/foo/A.java").canonicalPath
|
||||
), getProcessedSources(output)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testClasspathChanges() {
|
||||
val project = Project(
|
||||
|
||||
Reference in New Issue
Block a user