Get rid of kotlinx-coroutines usage in scripting libs and plugins
the dependency on the coroutines library caused various problems like KT-30778, or stdlib/runtime version conflicts. The only function used was `runBlocking`, so this change replaces it with the internal implementation based on the similar internal thing from the stdlib. #KT-30778 fixed
This commit is contained in:
committed by
TeamCityServer
parent
9b1de90452
commit
0cd29adcc7
+3
-2
@@ -17,7 +17,6 @@
|
||||
package org.jetbrains.kotlin.script.util
|
||||
|
||||
import com.intellij.openapi.util.Disposer
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys
|
||||
import org.jetbrains.kotlin.cli.common.config.addKotlinSourceRoot
|
||||
import org.jetbrains.kotlin.cli.common.messages.*
|
||||
@@ -55,6 +54,7 @@ import kotlin.reflect.KClass
|
||||
import kotlin.script.experimental.api.onSuccess
|
||||
import kotlin.script.experimental.api.valueOr
|
||||
import kotlin.script.experimental.host.toScriptSource
|
||||
import kotlin.script.experimental.impl.internalScriptingRunSuspend
|
||||
import kotlin.script.experimental.jvm.defaultJvmScriptingHostConfiguration
|
||||
import kotlin.script.experimental.jvm.util.scriptCompilationClasspathFromContext
|
||||
|
||||
@@ -199,7 +199,8 @@ done
|
||||
val script = File(scriptPath).toScriptSource()
|
||||
val newScriptDefinition = ScriptDefinitionProvider.getInstance(environment.project)!!.findDefinition(script)!!
|
||||
val compiledScript = scriptCompiler.compile(script, newScriptDefinition.compilationConfiguration).onSuccess {
|
||||
runBlocking {
|
||||
@Suppress("DEPRECATION_ERROR")
|
||||
internalScriptingRunSuspend {
|
||||
it.getClass(newScriptDefinition.evaluationConfiguration)
|
||||
}
|
||||
}.valueOr {
|
||||
|
||||
Reference in New Issue
Block a user