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
+4
-3
@@ -18,9 +18,8 @@
|
||||
|
||||
package kotlin.script.experimental.host
|
||||
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import kotlin.script.experimental.api.*
|
||||
import kotlin.script.experimental.impl.internalScriptingRunSuspend
|
||||
|
||||
/**
|
||||
* The base class for scripting host implementations
|
||||
@@ -32,7 +31,9 @@ abstract class BasicScriptingHost(
|
||||
/**
|
||||
* The overridable wrapper for executing evaluation in a desired coroutines context
|
||||
*/
|
||||
open fun <T> runInCoroutineContext(block: suspend CoroutineScope.() -> T): T = runBlocking { block() }
|
||||
open fun <T> runInCoroutineContext(block: suspend () -> T): T =
|
||||
@Suppress("DEPRECATION_ERROR")
|
||||
internalScriptingRunSuspend { block() }
|
||||
|
||||
/**
|
||||
* The default implementation of the evaluation function
|
||||
|
||||
Reference in New Issue
Block a user