Introduce classpath for compiler with scripting in KotlinPaths, fix JSR-223 for Idea
This commit is contained in:
@@ -92,11 +92,15 @@ interface KotlinPaths {
|
|||||||
SamWithReceiver(PathUtil.SAM_WITH_RECEIVER_PLUGIN_NAME),
|
SamWithReceiver(PathUtil.SAM_WITH_RECEIVER_PLUGIN_NAME),
|
||||||
Trove4j(PathUtil.TROVE4J_NAME),
|
Trove4j(PathUtil.TROVE4J_NAME),
|
||||||
Compiler(PathUtil.KOTLIN_COMPILER_NAME),
|
Compiler(PathUtil.KOTLIN_COMPILER_NAME),
|
||||||
|
ScriptingPlugin(PathUtil.KOTLIN_SCRIPTING_COMPILER_PLUGIN_NAME),
|
||||||
|
ScriptingLib(PathUtil.KOTLIN_SCRIPTING_COMMON_NAME),
|
||||||
|
ScriptingJvmLib(PathUtil.KOTLIN_SCRIPTING_JVM_NAME),
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class ClassPaths(val contents: List<Jar> = emptyList()) {
|
enum class ClassPaths(val contents: List<Jar> = emptyList()) {
|
||||||
Empty(),
|
Empty(),
|
||||||
Compiler(Jars.Compiler, Jars.StdLib, Jars.Reflect, Jars.ScriptRuntime, Jars.Trove4j),
|
Compiler(Jar.Compiler, Jar.StdLib, Jar.Reflect, Jar.ScriptRuntime, Jar.Trove4j),
|
||||||
|
CompilerWithScripting(Compiler, Jar.ScriptingPlugin, Jar.ScriptingLib, Jar.ScriptingJvmLib)
|
||||||
;
|
;
|
||||||
|
|
||||||
constructor(vararg jars: Jar) : this(jars.asList())
|
constructor(vararg jars: Jar) : this(jars.asList())
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import org.jetbrains.kotlin.daemon.client.DaemonReportingTargets
|
|||||||
import org.jetbrains.kotlin.daemon.client.KotlinCompilerClient
|
import org.jetbrains.kotlin.daemon.client.KotlinCompilerClient
|
||||||
import org.jetbrains.kotlin.daemon.client.KotlinRemoteReplCompilerClient
|
import org.jetbrains.kotlin.daemon.client.KotlinRemoteReplCompilerClient
|
||||||
import org.jetbrains.kotlin.daemon.common.*
|
import org.jetbrains.kotlin.daemon.common.*
|
||||||
|
import org.jetbrains.kotlin.utils.KotlinPaths
|
||||||
import org.jetbrains.kotlin.utils.PathUtil
|
import org.jetbrains.kotlin.utils.PathUtil
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.util.concurrent.locks.ReentrantReadWriteLock
|
import java.util.concurrent.locks.ReentrantReadWriteLock
|
||||||
@@ -44,9 +45,9 @@ class KotlinJsr223JvmScriptEngine4Idea(
|
|||||||
) : KotlinJsr223JvmScriptEngineBase(factory) {
|
) : KotlinJsr223JvmScriptEngineBase(factory) {
|
||||||
|
|
||||||
private val daemon by lazy {
|
private val daemon by lazy {
|
||||||
val path = PathUtil.kotlinPathsForIdeaPlugin.compilerPath
|
val classPath = PathUtil.kotlinPathsForIdeaPlugin.classPath(KotlinPaths.ClassPaths.CompilerWithScripting)
|
||||||
assert(path.exists())
|
assert(classPath.all { it.exists() })
|
||||||
val compilerId = CompilerId.makeCompilerId(path)
|
val compilerId = CompilerId.makeCompilerId(classPath)
|
||||||
val daemonOptions = configureDaemonOptions()
|
val daemonOptions = configureDaemonOptions()
|
||||||
val daemonJVMOptions = DaemonJVMOptions()
|
val daemonJVMOptions = DaemonJVMOptions()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user