Hi <@U0CHHN4F4>, in the previous versions I use `a...
# scripting
s
Hi @ilya.chernikov, in the previous versions I use
actualClassLoader
in the Evaluation Configuration, but now, it is not available with public access, there is any alternative to it? to load the script in a my custom classloader?
i
Yes,
actualClassloader
always meant to be an internal thing for the evaluator. The
baseClassloader
is the one you need.
s
Do you have any examples using
baseClassLoader
? In my old implementation I was doing this using `actualClassLoader`: https://github.com/DevSrSouza/Bukkript/blob/master/host/src/main/kotlin/br/com/devsrsouza/bukkript/host/loader/BukkriptScriptClassLoaderImpl.kt#L20
The idea here is that I have Script in separated classloader but a other script can access the classes from the other script.
i
Just set the
ScriptEvaluationConfiguration.jvm.baseClassLoader
the same way you did it with
actualClassloader
. The
actualClassloader
is built on top of the base one by adding dependencies and other scopes when needed. It is saved into configuration to reuse it between imported scripts, and I see no reasons so far to make it open for modifications, it may lead to the subtly broken evaluations instead.