Thank you Jochen for your reply

some followup

   - My source files may be in different locations (I want to say here's
   three different source directories, they form the source closure. But
   compile only foo.groovy and let the compiler decide what other files in
   what locations need to be pulled up for the compile). I saw that groovyc is
   backed by FileSystemCompiler.java and it is doing the same thing I am doing
   I think (it adds all source files passed in the command line args to the
   compile unit). What's the way to pass in only foo.groovy but then say here
   are other source units/files one of which is bar.groovy, just use the ones
   you need and leave out the others

If it helps,

   - I assume every file will only have one class defined (these are java
   files that are being compiled with the Groovy compiler, so java limitations
   will help)
   - I can also do multi pass compiles, time to compile is not a limitation

regards
Saravanan

On Mon, Jun 9, 2025 at 4:21 AM Jochen Theodorou <blackd...@gmx.org> wrote:

> On 09.06.25 09:21, Saravanan Palanichamy wrote:
> > Hello Groovy devs
> >
> > I am trying to understand how to do this with the Groovy Compiler
> >
> >   * I have say 20 files in my project
> >   * I know I have to compile just one of those files
>
> groovyc foo.groovy
>
> will compile foo.groovy and potentially its dependencies. A dependency
> should be compiled filed in class format, or source file. If both are
> available then which is newer decide if recompilation happens. If a
> dependency is not found compilation will fail.
>
> bye Jochen
>

Reply via email to