Kapt: Fix NPE on JDK 10-11 (KT-26203)
Gradle worker throws NPE when the parameter to the runnable is null. This patch works that around by passing URL spec as String instead of File?
This commit is contained in:
committed by
Yan Zhulanow
parent
2314ca7a94
commit
4f64a52d33
@@ -125,6 +125,8 @@ tasks.withType<Test> {
|
||||
|
||||
systemProperty("kotlinVersion", rootProject.extra["kotlinVersion"] as String)
|
||||
systemProperty("runnerGradleVersion", gradle.gradleVersion)
|
||||
systemProperty("jdk10Home", rootProject.extra["JDK_10"] as String)
|
||||
systemProperty("jdk11Home", rootProject.extra["JDK_11"] as String)
|
||||
|
||||
val mavenLocalRepo = System.getProperty("maven.repo.local")
|
||||
if (mavenLocalRepo != null) {
|
||||
|
||||
+25
@@ -19,6 +19,7 @@ package org.jetbrains.kotlin.gradle
|
||||
import org.jetbrains.kotlin.gradle.tasks.USING_JVM_INCREMENTAL_COMPILATION_MESSAGE
|
||||
import org.jetbrains.kotlin.gradle.util.*
|
||||
import org.junit.Assert
|
||||
import org.junit.Assume
|
||||
import org.junit.Test
|
||||
import java.io.File
|
||||
import java.util.zip.ZipFile
|
||||
@@ -67,6 +68,30 @@ class Kapt3WorkersIT : Kapt3IT() {
|
||||
assertSuccessful()
|
||||
}
|
||||
}
|
||||
|
||||
private fun testSimpleWithCustomJdk(gradleVersion: String, javaHome: File, jdkDescription: String) {
|
||||
val gradleVersionRequired = GradleVersionRequired.AtLeast(gradleVersion)
|
||||
|
||||
Assume.assumeTrue("$jdkDescription isn't available", javaHome.isDirectory)
|
||||
val options = defaultBuildOptions().copy(javaHome = javaHome)
|
||||
|
||||
val project =
|
||||
Project("simple", directoryPrefix = "kapt2", gradleVersionRequirement = gradleVersionRequired)
|
||||
project.build("build", options = options) {
|
||||
assertSuccessful()
|
||||
assertKaptSuccessful()
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testSimpleWithJdk10() {
|
||||
testSimpleWithCustomJdk("4.7", File(System.getProperty("jdk10Home")!!), "JDK 10")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testSimpleWithJdk11() {
|
||||
testSimpleWithCustomJdk("5.0", File(System.getProperty("jdk11Home")!!), "JDK 11")
|
||||
}
|
||||
}
|
||||
|
||||
open class Kapt3IT : Kapt3BaseIT() {
|
||||
|
||||
Reference in New Issue
Block a user