Move scripting support classes to the scripting compiler impl module

Original commit: a65dafc37d
This commit is contained in:
Ilya Chernikov
2019-02-26 15:38:01 +01:00
parent e6fbfcb35b
commit 0baf2dbfc5
@@ -26,6 +26,7 @@ import java.io.PrintStream
import java.lang.ref.SoftReference
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity.ERROR
import org.jetbrains.kotlin.utils.KotlinPathsFromBaseDirectory
import org.jetbrains.kotlin.utils.SmartList
object CompilerRunnerUtil {
@@ -114,10 +115,9 @@ object CompilerRunnerUtil {
environment: JpsCompilerEnvironment,
fn: (ClassLoader) -> T
): T? {
val paths = SmartList<File>()
val libPath = getLibPath(environment.kotlinPaths, environment.messageCollector) ?: return null
paths.add(File(libPath, "kotlin-compiler.jar"))
val kotlinPaths = KotlinPathsFromBaseDirectory(libPath)
val paths = kotlinPaths.classPath(KotlinPaths.ClassPaths.CompilerWithScripting).toMutableList()
jdkToolsJar?.let { paths.add(it) }
val classLoader = getOrCreateClassLoader(environment, paths)