Hi, before I dive in head first... Is something li...
# scripting
c
Hi, before I dive in head first... Is something like this possible with reasonable amount of effort with Kotlin instead of Groovy?
Copy code
val scriptText: String = /* loaded from somewhere, e.g. resource or even http request */
val shell = GroovyShell()
val script = shell.parse(scriptText).run()
This basically allows to load scripts into a running application and allows the script to seemlessly interface with all classes and instances in the running application. We currently use this mechanism to load kind of lightweight plugins into our spring boot app, even autowiring works:
Copy code
val script = shell.parse(scriptText).let(autowireBeanFactory::autowireBean).run()