CLI compiler: add runtime after user's classpath

Otherwise weird compilation errors in our project are expected as soon as
kotlin-runtime.jar will contain modules from "core". Suppose a Java class from
core/ has changed; the CLI compiler will then see its own (old) version of that
class from kotlin-runtime.jar before the actual new version from sources
This commit is contained in:
Alexander Udalov
2015-01-21 17:00:17 +03:00
parent d6b67523f6
commit 59937aad14
@@ -194,28 +194,28 @@ public class K2JVMCompiler extends CLICompiler<K2JVMCompilerArguments> {
if (!arguments.noJdk) {
classpath.addAll(PathUtil.getJdkClassesRoots());
}
if (!arguments.noStdlib) {
classpath.add(paths.getRuntimePath());
}
if (arguments.classpath != null) {
for (String element : Splitter.on(File.pathSeparatorChar).split(arguments.classpath)) {
classpath.add(new File(element));
}
}
if (!arguments.noStdlib) {
classpath.add(paths.getRuntimePath());
}
return classpath;
}
@NotNull
private static List<File> getAnnotationsPath(@NotNull KotlinPaths paths, @NotNull K2JVMCompilerArguments arguments) {
List<File> annotationsPath = Lists.newArrayList();
if (!arguments.noJdkAnnotations) {
annotationsPath.add(paths.getJdkAnnotationsPath());
}
if (arguments.annotations != null) {
for (String element : Splitter.on(File.pathSeparatorChar).split(arguments.annotations)) {
annotationsPath.add(new File(element));
}
}
if (!arguments.noJdkAnnotations) {
annotationsPath.add(paths.getJdkAnnotationsPath());
}
return annotationsPath;
}
}