I was not touching my scripting example for some t...
# scripting
a
I was not touching my scripting example for some time and not (probably after version upgrade I get
Copy code
Expecting 'hostConfiguration' property in the script compilation configuration for the script KtFile: script.kts
I tried to somehow provide this
hostConfiguration
, but I just do not understand how it works. My configuration looks like this:
Copy code
val workspaceScriptConfiguration = ScriptCompilationConfiguration {
            baseClass(Any::class)
            implicitReceivers(WorkspaceBuilder::class)
            defaultImports("hep.dataforge.workspace.*")
            jvm {
                dependenciesFromCurrentContext(wholeClasspath = true)
            }
        }

        val evaluationConfiguration = ScriptEvaluationConfiguration {
            implicitReceivers(builder)
        }

        BasicJvmScriptingHost().eval(source, workspaceScriptConfiguration, evaluationConfiguration)
Solved it by adding
hostConfiguration(defaultJvmScriptingHostConfiguration)
to compilation configuration, but I can't understand why it is needed since it is already passed to host during its creation.
i
It should be added automatically along the way. E.g. the following example works for me (on the latest build of 1.3.50, but eap should work the same way):
Copy code
val compilationConfiguration = ScriptCompilationConfiguration {}
        val evaluationConfiguration = ScriptEvaluationConfiguration {}     BasicJvmScriptingHost().eval(script, compilationConfiguration, evaluationConfiguration)
What version are you using?
a
Eap
Maybe I am using some obsolete dependencies. Here is the build file : https://github.com/mipt-npm/dataforge-core/blob/dev/dataforge-scripting/build.gradle.kts
Plugin uses eap internally
i
doesn’t look suspicious to me. Ok, I’ll try to reproduce it with the project.