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:
@@ -194,28 +194,28 @@ public class K2JVMCompiler extends CLICompiler<K2JVMCompilerArguments> {
|
|||||||
if (!arguments.noJdk) {
|
if (!arguments.noJdk) {
|
||||||
classpath.addAll(PathUtil.getJdkClassesRoots());
|
classpath.addAll(PathUtil.getJdkClassesRoots());
|
||||||
}
|
}
|
||||||
if (!arguments.noStdlib) {
|
|
||||||
classpath.add(paths.getRuntimePath());
|
|
||||||
}
|
|
||||||
if (arguments.classpath != null) {
|
if (arguments.classpath != null) {
|
||||||
for (String element : Splitter.on(File.pathSeparatorChar).split(arguments.classpath)) {
|
for (String element : Splitter.on(File.pathSeparatorChar).split(arguments.classpath)) {
|
||||||
classpath.add(new File(element));
|
classpath.add(new File(element));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!arguments.noStdlib) {
|
||||||
|
classpath.add(paths.getRuntimePath());
|
||||||
|
}
|
||||||
return classpath;
|
return classpath;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private static List<File> getAnnotationsPath(@NotNull KotlinPaths paths, @NotNull K2JVMCompilerArguments arguments) {
|
private static List<File> getAnnotationsPath(@NotNull KotlinPaths paths, @NotNull K2JVMCompilerArguments arguments) {
|
||||||
List<File> annotationsPath = Lists.newArrayList();
|
List<File> annotationsPath = Lists.newArrayList();
|
||||||
if (!arguments.noJdkAnnotations) {
|
|
||||||
annotationsPath.add(paths.getJdkAnnotationsPath());
|
|
||||||
}
|
|
||||||
if (arguments.annotations != null) {
|
if (arguments.annotations != null) {
|
||||||
for (String element : Splitter.on(File.pathSeparatorChar).split(arguments.annotations)) {
|
for (String element : Splitter.on(File.pathSeparatorChar).split(arguments.annotations)) {
|
||||||
annotationsPath.add(new File(element));
|
annotationsPath.add(new File(element));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!arguments.noJdkAnnotations) {
|
||||||
|
annotationsPath.add(paths.getJdkAnnotationsPath());
|
||||||
|
}
|
||||||
return annotationsPath;
|
return annotationsPath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user