Introduce FULL_JDK_15 TestJdkKind
This commit is contained in:
@@ -365,6 +365,9 @@ public class KotlinTestUtils {
|
||||
else if (jdkKind == TestJdkKind.FULL_JDK_9) {
|
||||
configuration.put(JVMConfigurationKeys.JDK_HOME, getJdk9Home());
|
||||
}
|
||||
else if (jdkKind == TestJdkKind.FULL_JDK_15) {
|
||||
configuration.put(JVMConfigurationKeys.JDK_HOME, getJdk15Home());
|
||||
}
|
||||
else if (SystemInfo.IS_AT_LEAST_JAVA9) {
|
||||
configuration.put(JVMConfigurationKeys.JDK_HOME, new File(System.getProperty("java.home")));
|
||||
}
|
||||
@@ -408,6 +411,15 @@ public class KotlinTestUtils {
|
||||
return new File(jdk11);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static File getJdk15Home() {
|
||||
String jdk15 = System.getenv("JDK_15");
|
||||
if (jdk15 == null) {
|
||||
throw new AssertionError("Environment variable JDK_15 is not set!");
|
||||
}
|
||||
return new File(jdk15);
|
||||
}
|
||||
|
||||
public static void resolveAllKotlinFiles(KotlinCoreEnvironment environment) throws IOException {
|
||||
List<KotlinSourceRoot> roots = ContentRootsKt.getKotlinSourceRoots(environment.getConfiguration());
|
||||
if (roots.isEmpty()) return;
|
||||
@@ -669,7 +681,7 @@ public class KotlinTestUtils {
|
||||
|
||||
public static boolean compileJavaFilesExternallyWithJava9(@NotNull Collection<File> files, @NotNull List<String> options) {
|
||||
List<String> command = new ArrayList<>();
|
||||
command.add(new File(getJdk9Home(), "bin/javac").getPath());
|
||||
command.add(new File(jdkHome, "bin/javac").getPath());
|
||||
command.addAll(options);
|
||||
for (File file : files) {
|
||||
command.add(file.getPath());
|
||||
|
||||
@@ -26,6 +26,8 @@ public enum TestJdkKind {
|
||||
FULL_JDK_6,
|
||||
// JDK found at $JDK_19
|
||||
FULL_JDK_9,
|
||||
// JDK found at $JDK_15
|
||||
FULL_JDK_15,
|
||||
// JDK found at java.home
|
||||
FULL_JDK,
|
||||
ANDROID_API,
|
||||
|
||||
Reference in New Issue
Block a user