Re: Running groovy programs
Jochen Theodorou <[email protected]>
| Newsgroups | gmane.comp.lang.groovy.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Andriy, We can add an option, that is then changing the compiler configuration and a transform could react to that to add a path to the classpath (package corrected of course) This is certainly possible. bye Jochen On 23.03.22 16:37, Andriy Rysin wrote: > I wonder if the 'groovy' executable could be smart enough to detect: if > I am running src/pkg1/main.groovy and there's "package pkg1" in that > script that we need to add src/ to classpath. > But I guess for that groovy would have to compile it first so it's a > chicken and egg problem > > Andriy > > On Mon, Mar 21, 2022 at 3:41 PM Jochen Theodorou <[email protected] > <mailto:[email protected]>> wrote: > > On 21.03.22 15:26, Andriy Rysin wrote: > > Ah, sorry I didn't get it at first. Technically if we need extra > wrapper > > to start a program I could probably do a shell/bat scripts. I was > hoping > > we could use the same command (I have other tools that are invoked by > > their groovy file, so I was trying to keep the more complex one > the same). > > It surely would not be impossible to make a global transform, which > helps the compiler with the setup. But this global transform would have > to be on the classpath. And that could be done by placing it in > ~/.groovy/lib/ > > The transform would then add the source path to the classpath for the > compiler used for the compilation during the conversion phase. Still > requires a one-time setup step of course. > > Out of the box I think we have no solution for this really. > > bye Jochen >