Avoid using reflected types in the scripting API
since it causes numerous classloading issues. Using the wrapping types and reload them in the proper context when needed. Note: this version supports only classes, but the wrapping type could be extended to support other types in the future. + numerous fixes related to proper loading and handling of the templates.
This commit is contained in:
+4
-1
@@ -25,7 +25,10 @@ val myJvmConfigParams = jvmJavaHomeParams + with(ScriptCompileConfigurationPrope
|
||||
fun evalFile(scriptFile: File): ResultWithDiagnostics<EvaluationResult> {
|
||||
val scriptCompiler = JvmScriptCompiler(KJVMCompilerImpl(), DummyCompiledJvmScriptCache())
|
||||
val scriptDefinition = ScriptDefinitionFromAnnotatedBaseClass(
|
||||
ScriptingEnvironment(ScriptingEnvironmentProperties.baseClass to MyScript::class)
|
||||
ScriptingEnvironment(
|
||||
ScriptingEnvironmentProperties.baseClass<MyScript>(),
|
||||
ScriptingEnvironmentProperties.getScriptingClass(JvmGetScriptingClass())
|
||||
)
|
||||
)
|
||||
|
||||
val host = JvmBasicScriptingHost(
|
||||
|
||||
Reference in New Issue
Block a user