Run JDK11 tests for KAPT only if JDK11 is available
Otherwise, just skip running them.
This commit is contained in:
committed by
Yan Zhulanow
parent
6e7f046471
commit
573e7f2eee
@@ -605,11 +605,11 @@ public class KotlinTestUtils {
|
||||
return new File(jdk9);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Nullable
|
||||
public static File getJdk11Home() {
|
||||
String jdk11 = System.getenv("JDK_11");
|
||||
if (jdk11 == null) {
|
||||
throw new AssertionError("Environment variable JDK_11 is not set!");
|
||||
return null;
|
||||
}
|
||||
return new File(jdk11);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ interface CustomJdkTestLauncher {
|
||||
|
||||
fun doTestWithJdk11(mainClass: Class<*>, arg: String) {
|
||||
if (isJava9OrLater()) return
|
||||
doTestCustomJdk(mainClass, arg, KotlinTestUtils.getJdk11Home())
|
||||
KotlinTestUtils.getJdk11Home()?.let { doTestCustomJdk(mainClass, arg, it) }
|
||||
}
|
||||
|
||||
private fun doTestCustomJdk(mainClass: Class<*>, arg: String, javaHome: File) {
|
||||
|
||||
Reference in New Issue
Block a user