UberCompileTask -> genstubs + javac + grooyc

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

UberCompileTask -> genstubs + javac + grooyc

Jason Dillon
Hi folks, I took a stab at adding Ant tasks to support the same style  
of compilation that the latest groovy-maven-plugin (1.0-beta-2-
SNAPSHOT) supports.  For lack of a better name I called it  
UberCompileTask... and here is what it does:

  1) uses the new GenerateStubsTask to render .java sources  
for .groovy bits.
  2) compiles all .java sources (including stubs) using the standard  
javac task
  3) the finally compiles all .groovy sources with a simpler GroovycTask

This has some significant advantages IMO... mainly that the  
configuration for .java -> .class compilation supports anything that  
is in the javac task, and doesn't require any CLI option parsing or  
introduce other configuration semantics that users have to learn or  
understand.  Additionally, I've just exposed the  
CompilerConfiguration object to be configured as any other Ant  
object, so that the Ant tasks can now support any configuration  
settings that are allowed.

I've *not* hooked this by default, but I did at a 'ubercompile'  
target, and its helper 'ubercompile:bootstrap' , to the main  
build.xml so that folks can try it out.

It seems to be working well, and should allow more of groovy-core to  
actually be written in Groovy too... not that the current  
implementation couldn't be used in that manner though, just that the  
uber compiler tasks configuration is richer, providing users with  
more features with less code.

I'll probably tidy things up a little, and figure out how to get that  
forking/max-mem muck working next week... as I'm off to Tahoe for  
some fun in the sun this weekend.

Anyways, please have a look.  I think that this is probably the best  
direction for the groovy-core compile wrt building w/Ant.  Lemme know  
what you think.

Cheers,

--jason

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: UberCompileTask -> genstubs + javac + grooyc

Guillaume Laforge
Administrator
I'm not sure I really understood what you did...

On 8/17/07, Jason Dillon <[hidden email]> wrote:

> Hi folks, I took a stab at adding Ant tasks to support the same style
> of compilation that the latest groovy-maven-plugin (1.0-beta-2-
> SNAPSHOT) supports.  For lack of a better name I called it
> UberCompileTask... and here is what it does:
>
>   1) uses the new GenerateStubsTask to render .java sources
> for .groovy bits.
>   2) compiles all .java sources (including stubs) using the standard
> javac task
>   3) the finally compiles all .groovy sources with a simpler GroovycTask
>
> This has some significant advantages IMO... mainly that the
> configuration for .java -> .class compilation supports anything that
> is in the javac task, and doesn't require any CLI option parsing or
> introduce other configuration semantics that users have to learn or
> understand.  Additionally, I've just exposed the
> CompilerConfiguration object to be configured as any other Ant
> object, so that the Ant tasks can now support any configuration
> settings that are allowed.
>
> I've *not* hooked this by default, but I did at a 'ubercompile'
> target, and its helper 'ubercompile:bootstrap' , to the main
> build.xml so that folks can try it out.
>
> It seems to be working well, and should allow more of groovy-core to
> actually be written in Groovy too... not that the current
> implementation couldn't be used in that manner though, just that the
> uber compiler tasks configuration is richer, providing users with
> more features with less code.
>
> I'll probably tidy things up a little, and figure out how to get that
> forking/max-mem muck working next week... as I'm off to Tahoe for
> some fun in the sun this weekend.
>
> Anyways, please have a look.  I think that this is probably the best
> direction for the groovy-core compile wrt building w/Ant.  Lemme know
> what you think.
>
> Cheers,
>
> --jason
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>


--
Guillaume Laforge
Groovy Project Manager
http://glaforge.free.fr/blog/groovy

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: UberCompileTask -> genstubs + javac + grooyc

Jason Dillon
On Aug 17, 2007, at 5:19 AM, Guillaume Laforge wrote:
> I'm not sure I really understood what you did...

Well, I did a few things.  First, I created a task to generate .java  
stubs from .groovy sources, w/o any compilation bits (as the current  
joint compile works).  Then I created a new groovyc task that only  
provides .groovy compilation and then I created a task, ubercompile,  
which orchestrates invoking the stub compiler, javac and groovyc  
tasks.  Ubercompile shares some common configuration, like the class  
output dir and classpath between nested tasks.

I also setup a simple bootstrap whoch compiles the ubercompile task  
(and related classes) with javac, then compiles everything else with  
ubercompile.

Have a look at the ubercompile:bootstrap and ubercompile targets for  
more details.... or ask ;-)

Cheers,

--jason


> On 8/17/07, Jason Dillon <[hidden email]> wrote:
>> Hi folks, I took a stab at adding Ant tasks to support the same style
>> of compilation that the latest groovy-maven-plugin (1.0-beta-2-
>> SNAPSHOT) supports.  For lack of a better name I called it
>> UberCompileTask... and here is what it does:
>>
>>   1) uses the new GenerateStubsTask to render .java sources
>> for .groovy bits.
>>   2) compiles all .java sources (including stubs) using the standard
>> javac task
>>   3) the finally compiles all .groovy sources with a simpler  
>> GroovycTask
>>
>> This has some significant advantages IMO... mainly that the
>> configuration for .java -> .class compilation supports anything that
>> is in the javac task, and doesn't require any CLI option parsing or
>> introduce other configuration semantics that users have to learn or
>> understand.  Additionally, I've just exposed the
>> CompilerConfiguration object to be configured as any other Ant
>> object, so that the Ant tasks can now support any configuration
>> settings that are allowed.
>>
>> I've *not* hooked this by default, but I did at a 'ubercompile'
>> target, and its helper 'ubercompile:bootstrap' , to the main
>> build.xml so that folks can try it out.
>>
>> It seems to be working well, and should allow more of groovy-core to
>> actually be written in Groovy too... not that the current
>> implementation couldn't be used in that manner though, just that the
>> uber compiler tasks configuration is richer, providing users with
>> more features with less code.
>>
>> I'll probably tidy things up a little, and figure out how to get that
>> forking/max-mem muck working next week... as I'm off to Tahoe for
>> some fun in the sun this weekend.
>>
>> Anyways, please have a look.  I think that this is probably the best
>> direction for the groovy-core compile wrt building w/Ant.  Lemme know
>> what you think.
>>
>> Cheers,
>>
>> --jason
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>
>
>
> --
> Guillaume Laforge
> Groovy Project Manager
> http://glaforge.free.fr/blog/groovy
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email