Support -Xmodule-path and -Xadd-modules command line arguments

#KT-18598 In Progress
 #KT-18599 Fixed
This commit is contained in:
Alexander Udalov
2017-05-26 15:20:05 +03:00
parent e32880d9a3
commit 03d83db660
43 changed files with 355 additions and 14 deletions
@@ -912,6 +912,27 @@ public class KotlinTestUtils {
}
}
public static boolean compileJavaFilesExternallyWithJava9(@NotNull Collection<File> files, @NotNull List<String> options) {
File jdk9 = getJdk9HomeIfPossible();
assert jdk9 != null : "Environment variable JDK_19 is not set";
List<String> command = new ArrayList<>();
command.add(new File(jdk9, "bin/javac").getPath());
command.addAll(options);
for (File file : files) {
command.add(file.getPath());
}
try {
Process process = new ProcessBuilder().command(command).inheritIO().start();
process.waitFor();
return process.exitValue() == 0;
}
catch (Exception e) {
throw ExceptionUtilsKt.rethrow(e);
}
}
@NotNull
private static String errorsToString(@NotNull DiagnosticCollector<JavaFileObject> diagnosticCollector, boolean humanReadable) {
StringBuilder builder = new StringBuilder();