Is there something like GroovyScriptEngine and GroovyClassLoader in Scala?

I noticed that scala corresponds to jsr 223 https://issues.scala-lang.org/browse/SI-874 ... but can it do things like GroovyScriptEngine? I am considering adding support for scala scripts for our product so that developers can write small applications / components / classes that will be loaded from a java application (ideally, with the ability to reload). I use GroovyScriptEngine for groovy applications / components / classes, but I can not find anything like it in Scala.

Basically, I will need to transfer it to a directory with scala contents, and it will load all scala classes that will be available (or at least one) for the java application.

Could you give me some pointers? This is the only way to use scala for us.

+4
source share
1 answer

Scala Script Engine

This library dynamically compiles scala source files and loads them as classes. Modified scala files will be recompiled, and the modified class will be loaded. Several source paths are supported, as well as compilation class paths and class classes of class loading classes (so that scripts can load additional libraries).

Class route detection can be automatic (efficiently using the caller's class path) or manual.

Different compilation and update strategies are for different purposes.

+5
source

All Articles