KT-33052: Fix KAPT stub generation for enums on JDK11

When using JDK11, generating stubs for enums is broken.
This commit handles the faulty generation by JDK11 by
fully printing enums in custom implementation of tree
printing.

Test: added JDK11 tests for KAPT stub  generation
This commit is contained in:
Ivan Gavrilovic
2019-08-29 16:59:42 +02:00
committed by Yan Zhulanow
parent 58efa34a33
commit 0cdfe89a26
6 changed files with 45 additions and 8 deletions
@@ -605,6 +605,15 @@ public class KotlinTestUtils {
return new File(jdk9);
}
@NotNull
public static File getJdk11Home() {
String jdk11 = System.getenv("JDK_11");
if (jdk11 == null) {
throw new AssertionError("Environment variable JDK_11 is not set!");
}
return new File(jdk11);
}
public static void resolveAllKotlinFiles(KotlinCoreEnvironment environment) throws IOException {
List<KotlinSourceRoot> roots = ContentRootsKt.getKotlinSourceRoots(environment.getConfiguration());
if (roots.isEmpty()) return;