Maybe a simple example explains the new feature in 1.3.0 best:

  def gren = new Grengine(myScriptDir)
  def shell = new GroovyShell(gren.asClassLoader)
  shell.evaluate("<use any Groovy classes in myScriptDir>")

So you can use any Grengine instance as a class loader,
e.g. for GroovyShell or GroovyClassLoader.

(You loose speed if you evaluate Groovy expressions multiple times
compared to using e.g. gren.run("<some Groovy expression>"), but
on the other hand you can dynamically accumulate classes in the shell,
i.e. things are more dynamic "on top", but rock-solid "at the bottom".)

https://www.grengine.ch/

Release Notes

1.3.0 (20 Jul 2017)

* New methods asClassLoader() for Grengine and Engine that allow to use
  a Grengine resp. its engine as parent class loader for GroovyShell or
  GroovyClassLoader (or any other class loader).

Reply via email to