Skip to content

Commit

Permalink
Experimental | JSR223死活不行。
Browse files Browse the repository at this point in the history
  • Loading branch information
TheFloodDragon committed Jul 14, 2024
1 parent bc542e8 commit 81975d4
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 18 deletions.
8 changes: 1 addition & 7 deletions project/module-script/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
dependencies {
// Kotlin Script
compileOnly(kotlin("main-kts"))
compileOnly(kotlin("scripting-common"))
compileOnly(kotlin("scripting-jvm"))
compileOnly(kotlin("scripting-jvm-host"))
compileOnly(kotlin("scripting-compiler"))
compileOnly(kotlin("scripting-jsr223"))
compileOnly("org.jetbrains.kotlin:kotlin-main-kts:$kotlinVersion")
compileOnly("org.jetbrains.kotlin:kotlin-scripting-common:$kotlinVersion")
compileOnly("org.jetbrains.kotlin:kotlin-scripting-jvm:$kotlinVersion")
compileOnly("org.jetbrains.kotlin:kotlin-scripting-jvm-host:$kotlinVersion")
compileOnly("org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:$kotlinVersion")
compileOnly("org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:$kotlinVersion")
// Kether: Taboolib
compileTaboo("module-kether")
// JavaScript: Nashorn Engine
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,46 @@
*/
@RuntimeDependencies({
// Kotlin Script
@RuntimeDependency(
value = "!org.jetbrains.kotlin:kotlin-reflect:" + CoreEnv.KOTLIN_VERSION,
test = "!kotlin.reflect.jvm.ReflectLambdaKt",
transitive = false
),
@RuntimeDependency(
value = "!org.jetbrains.kotlin:kotlin-compiler-embeddable:" + CoreEnv.KOTLIN_VERSION,
transitive = false
),
@RuntimeDependency(
value = "!org.jetbrains.kotlin:kotlin-script-runtime:" + CoreEnv.KOTLIN_VERSION,
transitive = false
),
@RuntimeDependency(
value = "!org.jetbrains.kotlin:kotlin-script-common:" + CoreEnv.KOTLIN_VERSION,
value = "!org.jetbrains.kotlin:kotlin-scripting-common:" + CoreEnv.KOTLIN_VERSION,
transitive = false
),
@RuntimeDependency(
value = "!org.jetbrains.kotlin:kotlin-script-jvm:" + CoreEnv.KOTLIN_VERSION,
value = "!org.jetbrains.kotlin:kotlin-scripting-jvm:" + CoreEnv.KOTLIN_VERSION,
transitive = false
),
@RuntimeDependency(
value = "!org.jetbrains.kotlin:kotlin-script-jvm-host:" + CoreEnv.KOTLIN_VERSION,
value = "!org.jetbrains.kotlin:kotlin-scripting-jvm-host:" + CoreEnv.KOTLIN_VERSION,
transitive = false
),
@RuntimeDependency(
value = "!org.jetbrains.kotlin:kotlin-script-compiler:" + CoreEnv.KOTLIN_VERSION,
value = "!org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:" + CoreEnv.KOTLIN_VERSION,
transitive = false
),
@RuntimeDependency(
value = "!org.jetbrains.kotlin:kotlin-script-jsr233:" + CoreEnv.KOTLIN_VERSION,
value = "!org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:" + CoreEnv.KOTLIN_VERSION,
transitive = false
),
@RuntimeDependency(
value = "!org.jetbrains.kotlin:kotlin-scripting-jsr223:" + CoreEnv.KOTLIN_VERSION,
transitive = false
),
@RuntimeDependency(
value = "!org.jetbrains.intellij.deps:trove4j:1.0.20200330",
test = "!gnu.trove.TObjectHashingStrategy",
transitive = false
),
// JavaScript
Expand All @@ -43,8 +61,9 @@
// Jexl
@RuntimeDependency(
value = "!org.apache.commons:commons-jexl3:3.4.0",
test = "!org.apache.commons.jexl3.JexlEngine"
)}
)
test = "!org.apache.commons.jexl3.JexlEngine",
transitive = false
)
})
public class ScriptEnv {
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ package cn.fd.ratziel.script
* @since 2024/7/14 15:40
*/
object KotlinScriptLang : EnginedScriptLanguage(
"kts", // 引擎名称
"kts", "KTS", "KotlinScript", "kotlin-script", "KotlinScripting", "kotlin-scripting" // 语言名称
"kotlin", // 引擎名称
"Kotlin", "kotlin", "kts", "KTS" // 语言名称
)
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ object ScriptManager {

/**
* 使用的脚本语言
* |- Kether, JavaScript, Jexl3
* |- Kether, JavaScript, Jexl3, Kotlin Script
*/
@JvmStatic
var scriptLanguages: Array<ScriptLanguage> = arrayOf(KetherLang, JavaScriptLang, JexlLang, KotlinScriptLang)
Expand Down

0 comments on commit 81975d4

Please sign in to comment.