Remembering imports between script invocations

2018-02-08 Thread David Ekholm
We're considering supporting Groovy as an additional scripting language to our web gallery software jAlbum (http://jalbum.net ), but one aspect bugs me: It doesn't seem like import statements are remembered between script invocations. This makes it far harder to use Groovy to

Re: Remembering imports between script invocations

2018-02-08 Thread David Ekholm
9. JShell unfortunately cannot run embedded via the javax.script API :-( Regards /David > On 8 Feb 2018, at 21:34, eric.mil...@thomsonreuters.com wrote: > > You can add all the imports you want to your compiler configuration and they > will be consistently available for all scripts. &g

Re: Remembering imports between script invocations

2018-02-09 Thread David Ekholm
Who can I contact? Regards /David > On 8 Feb 2018, at 23:25, > wrote: > > Sounds more like the Groovy Shell or Groovy Console. Not too sure myself how > the javax.script stuff is tied in. > > From: David Ekholm [mailto:da...@jalbum.net <mailto:da...@jalbum

Re: Remembering imports between script invocations

2018-02-12 Thread David Ekholm
new ExpandoMetaClass(script.class, false) > metaClass.include = { String name -> > ImportCustomizer includes = new ImportCustomizer() > includes.addStarImports(name) > configuration.addCompilationCustomizers(includes) > "

Re: Remembering imports between script invocations

2018-10-31 Thread David Ekholm
t script = compiler.parse(code) > ExpandoMetaClass metaClass = new ExpandoMetaClass(script.class, false) > metaClass.include = { String name -> > ImportCustomizer includes = new ImportCustomizer() > includes.addStarImports(name) > configurat