Fix creating of the script definition from legacy template
adding classpath needed to load template and related class to the appropriate host configuration fixes tests
This commit is contained in:
+4
-4
@@ -240,14 +240,14 @@ fun loadDefinitionsFromTemplates(
|
||||
// TODO: drop class loading here - it should be handled downstream
|
||||
// as a compatibility measure, the asm based reading of annotations should be implemented to filter classes before classloading
|
||||
val template = loader.loadClass(templateClassName).kotlin
|
||||
val hostConfiguration = ScriptingHostConfiguration(baseHostConfiguration) {
|
||||
configurationDependencies(JvmDependency(classpath))
|
||||
}
|
||||
when {
|
||||
template.annotations.firstIsInstanceOrNull<kotlin.script.templates.ScriptTemplateDefinition>() != null -> {
|
||||
ScriptDefinition.FromLegacyTemplate(baseHostConfiguration, template, templateClasspath)
|
||||
ScriptDefinition.FromLegacyTemplate(hostConfiguration, template, templateClasspath)
|
||||
}
|
||||
template.annotations.firstIsInstanceOrNull<kotlin.script.experimental.annotations.KotlinScript>() != null -> {
|
||||
val hostConfiguration = ScriptingHostConfiguration(baseHostConfiguration) {
|
||||
configurationDependencies(JvmDependency(classpath))
|
||||
}
|
||||
ScriptDefinition.FromTemplate(hostConfiguration, template, ScriptDefinition::class)
|
||||
}
|
||||
else -> {
|
||||
|
||||
Reference in New Issue
Block a user