From 7d2a23ffd6ee81409c1fb27727446a355a1349f0 Mon Sep 17 00:00:00 2001 From: Dmitry Kandalov Date: Thu, 29 Aug 2024 11:26:51 +0100 Subject: [PATCH] use jdk21 in groovy and kotlin plugin runners --- .../implementation/pluginrunner/groovy/GroovyPluginRunner.kt | 2 +- .../pluginrunner/kotlin/LivePluginScriptInternal.kt | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/liveplugin/implementation/pluginrunner/groovy/GroovyPluginRunner.kt b/src/main/liveplugin/implementation/pluginrunner/groovy/GroovyPluginRunner.kt index baf32492..23367ce5 100644 --- a/src/main/liveplugin/implementation/pluginrunner/groovy/GroovyPluginRunner.kt +++ b/src/main/liveplugin/implementation/pluginrunner/groovy/GroovyPluginRunner.kt @@ -49,7 +49,7 @@ class GroovyPluginRunner( // Assume that GroovyScriptEngine is thread-safe // (according to this http://groovy.329449.n5.nabble.com/Is-the-GroovyScriptEngine-thread-safe-td331407.html) val scriptEngine = GroovyScriptEngine(pluginFolderUrl, classLoader) - scriptEngine.config.targetBytecode = "17" + scriptEngine.config.targetBytecode = "21" try { scriptEngine.loadScriptByName(mainScript.toUrlString()) } catch (e: Exception) { diff --git a/src/main/liveplugin/implementation/pluginrunner/kotlin/LivePluginScriptInternal.kt b/src/main/liveplugin/implementation/pluginrunner/kotlin/LivePluginScriptInternal.kt index 99b58dc6..3e670cdc 100644 --- a/src/main/liveplugin/implementation/pluginrunner/kotlin/LivePluginScriptInternal.kt +++ b/src/main/liveplugin/implementation/pluginrunner/kotlin/LivePluginScriptInternal.kt @@ -9,6 +9,7 @@ import liveplugin.implementation.common.toFilePath import java.io.File import kotlin.script.experimental.annotations.KotlinScript import kotlin.script.experimental.api.* +import kotlin.script.experimental.api.ScriptAcceptedLocation.Everywhere import kotlin.script.experimental.host.FileScriptSource import kotlin.script.experimental.intellij.ScriptDefinitionsProvider import kotlin.script.experimental.jvm.JvmDependency @@ -36,8 +37,8 @@ open class LivePluginScriptConfig( beforeCompiling { context -> ResultWithDiagnostics.Success(createConfig(context), reports = emptyList()) } } ide { - compilerOptions("-jvm-target", "17") - acceptedLocations(ScriptAcceptedLocation.Everywhere) + compilerOptions("-jvm-target", "21") + acceptedLocations(Everywhere) dependenciesSources(JvmDependency(livePluginLibAndSrcFiles())) // dependenciesSources(JvmDependency(listOf( // This doesn't work 😠 // File(".../Application Support/JetBrains/IntelliJIdea2021.1/plugins/live-plugins/multiple-src-files/foo.kt"),