Switch to templates in the separate script runtime

This commit is contained in:
Ilya Chernikov
2016-10-11 10:03:41 +02:00
parent c2b5c11781
commit 846797ff61
36 changed files with 99 additions and 128 deletions
@@ -187,7 +187,7 @@ private class ScriptCommandLineState(environment: ExecutionEnvironment, configur
val params = commonParameters()
val kotlinPaths = PathUtil.getKotlinPathsForIdeaPlugin()
listOf(kotlinPaths.compilerPath, kotlinPaths.reflectPath, kotlinPaths.runtimePath)
listOf(kotlinPaths.compilerPath, kotlinPaths.reflectPath, kotlinPaths.runtimePath, kotlinPaths.scriptRuntimePath)
.map { it.absolutePath }
.forEach { dependencyJar -> params.classPath.add(dependencyJar) }
@@ -125,6 +125,7 @@ private fun updateJar(
val jarPath: File = when (libraryJarDescriptor) {
LibraryJarDescriptor.RUNTIME_JAR -> paths.runtimePath
LibraryJarDescriptor.REFLECT_JAR -> paths.reflectPath
LibraryJarDescriptor.SCRIPT_RUNTIME_JAR -> paths.scriptRuntimePath
LibraryJarDescriptor.TEST_JAR -> paths.kotlinTestPath
LibraryJarDescriptor.RUNTIME_SRC_JAR -> paths.runtimeSourcesPath
LibraryJarDescriptor.JS_STDLIB_JAR -> paths.jsStdLibJarPath
@@ -160,6 +161,7 @@ fun findAllUsedLibraries(project: Project): MultiMap<Library, Module> {
private enum class LibraryJarDescriptor private constructor(val jarName: String, val shouldExist: Boolean) {
RUNTIME_JAR(PathUtil.KOTLIN_JAVA_RUNTIME_JAR, true),
REFLECT_JAR(PathUtil.KOTLIN_JAVA_REFLECT_JAR, false),
SCRIPT_RUNTIME_JAR(PathUtil.KOTLIN_JAVA_SCRIPT_RUNTIME_JAR, true),
TEST_JAR(PathUtil.KOTLIN_TEST_JAR, false),
RUNTIME_SRC_JAR(PathUtil.KOTLIN_JAVA_RUNTIME_SRC_JAR, false),
JS_STDLIB_JAR(PathUtil.JS_LIB_JAR_NAME, true),
@@ -52,6 +52,7 @@ class KotlinUpdatePluginComponent : ApplicationComponent {
// Force refresh jar handlers
requestFullJarUpdate(ideaPluginPaths.runtimePath)
requestFullJarUpdate(ideaPluginPaths.reflectPath)
requestFullJarUpdate(ideaPluginPaths.scriptRuntimePath)
requestFullJarUpdate(ideaPluginPaths.runtimeSourcesPath)
requestFullJarUpdate(ideaPluginPaths.jsStdLibJarPath)