Introduce and use KotlinPaths.getStdlibPath()

Also support renaming .jar file when updating an existing library
This commit is contained in:
Dmitry Jemerov
2017-03-31 12:47:19 +02:00
parent 344f372327
commit f9495aa0d7
17 changed files with 82 additions and 62 deletions
@@ -49,7 +49,7 @@ open class KotlinJvmReplService(
protected val configuration = CompilerConfiguration().apply {
addJvmClasspathRoots(PathUtil.getJdkClassesRoots())
addJvmClasspathRoots(PathUtil.getKotlinPathsForCompiler().let { listOf(it.runtimePath, it.reflectPath, it.scriptRuntimePath) })
addJvmClasspathRoots(PathUtil.getKotlinPathsForCompiler().let { listOf(it.stdlibPath, it.reflectPath, it.scriptRuntimePath) })
addJvmClasspathRoots(templateClasspath)
put(CommonConfigurationKeys.MODULE_NAME, "kotlin-script")
languageVersionSettings = LanguageVersionSettingsImpl(LanguageVersion.LATEST_STABLE, ApiVersion.LATEST_STABLE).apply {
@@ -27,9 +27,15 @@ public interface KotlinPaths {
@NotNull
File getLibPath();
/**
* @deprecated Use getStdlibPath() instead
*/
@NotNull
File getRuntimePath();
@NotNull
File getStdlibPath();
@NotNull
File getReflectPath();
@@ -46,6 +46,12 @@ public class KotlinPathsFromHomeDir implements KotlinPaths {
return getLibraryFile(PathUtil.KOTLIN_JAVA_RUNTIME_JAR);
}
@NotNull
@Override
public File getStdlibPath() {
return getLibraryFile(PathUtil.KOTLIN_JAVA_STDLIB_JAR);
}
@NotNull
@Override
public File getReflectPath() {