Re: Running groovy programs

Andriy Rysin <[email protected]>
Newsgroups gmane.comp.lang.groovy.user
Message-ID <CAOZT1o1PXbsA+3bvVp7gs=G51TqQ1wAfg7U_zUqDou-nj03_6A@mail.gmail.com>
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]> 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
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.