Quantcast

Using Groovy 1.6.0 in Grails 1.1 to perform ant Groovyc with joint compilation

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Using Groovy 1.6.0 in Grails 1.1 to perform ant Groovyc with joint compilation

Brian Guan
Hi all,

I am now starting to port a Grails 1.0.x app to 1.1 and I am
attempting to add a quick compilation ant task to our joint java and
groovy codebase.

But when I follow the example on
http://groovy.codehaus.org/The+groovyc+Ant+Task , I get:

  groovyc doesn't support the nested "javac" element.


I then tried to point to groovy-all-1.6.0.jar by manually downloading
groovy 1.6 source and compiled it, but the result is still the same.


I think this is the case of RTFM but google is not able to find the
right doc for me...  any advice?

Thanks

- Brian Guan

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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Using Groovy 1.6.0 in Grails 1.1 to perform ant Groovyc with joint compilation

Jochen Theodorou
Brian Guan schrieb:

> Hi all,
>
> I am now starting to port a Grails 1.0.x app to 1.1 and I am
> attempting to add a quick compilation ant task to our joint java and
> groovy codebase.
>
> But when I follow the example on
> http://groovy.codehaus.org/The+groovyc+Ant+Task , I get:
>
>   groovyc doesn't support the nested "javac" element.

this:
        <groovyc srcdir="${mainSourceDirectory}"
destdir="${mainClassesDirectory}" fork="true"
memorymaximumsize="${groovycMain_mx}">
             <classpath>
                 <pathelement path="${mainClassesDirectory}"/>
                 <path refid="compilePath"/>
             </classpath>
             <javac deprecation="on" debug="yes" source="1.5" target="1.5"/>
         </groovyc>

is from our build.xml file, so I am sure it works. Are you sure you use
the correct version of Groovy?

bye blackdrag

--
Jochen "blackdrag" Theodorou
The Groovy Project Tech Lead (http://groovy.codehaus.org)
http://blackdragsview.blogspot.com/


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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Using Groovy 1.6.0 in Grails 1.1 to perform ant Groovyc with joint compilation

Brian Guan
Hi Jochen,


Jochen Theodorou wrote
Brian Guan schrieb:
> Hi all,
>
> I am now starting to port a Grails 1.0.x app to 1.1 and I am
> attempting to add a quick compilation ant task to our joint java and
> groovy codebase.
>
> But when I follow the example on
> http://groovy.codehaus.org/The+groovyc+Ant+Task , I get:
>
>   groovyc doesn't support the nested "javac" element.

this:
        <groovyc srcdir="${mainSourceDirectory}"
destdir="${mainClassesDirectory}" fork="true"
memorymaximumsize="${groovycMain_mx}">
             <classpath>
                 <pathelement path="${mainClassesDirectory}"/>
                 <path refid="compilePath"/>
             </classpath>
             <javac deprecation="on" debug="yes" source="1.5" target="1.5"/>
         </groovyc>

is from our build.xml file, so I am sure it works. Are you sure you use
the correct version of Groovy?

Could it be my definition of groovyc is wrong then?

This is what it is:

    <taskdef name="groovyc" classname="org.codehaus.groovy.ant.GroovycTask">
        <classpath>
            <fileset dir="${extlib.dir.groovy-all-1.6.0}" includes="groovy-all-1.6.0.jar" />
        </classpath>
    </taskdef>

Where ${extlib.dir.groovy-all-1.6.0} points to where the groovy-all-1.6.0.jar is.

Thanks
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Using Groovy 1.6.0 in Grails 1.1 to perform ant Groovyc with joint compilation

Brian Guan
Hi Jochen and all,

Brian T. H. Guan wrote
Jochen Theodorou wrote
Brian Guan schrieb:
> Hi all,
>
> I am now starting to port a Grails 1.0.x app to 1.1 and I am
> attempting to add a quick compilation ant task to our joint java and
> groovy codebase.
>
> But when I follow the example on
> http://groovy.codehaus.org/The+groovyc+Ant+Task , I get:
>
>   groovyc doesn't support the nested "javac" element.

this:
        <groovyc srcdir="${mainSourceDirectory}"
destdir="${mainClassesDirectory}" fork="true"
memorymaximumsize="${groovycMain_mx}">
             <classpath>
                 <pathelement path="${mainClassesDirectory}"/>
                 <path refid="compilePath"/>
             </classpath>
             <javac deprecation="on" debug="yes" source="1.5" target="1.5"/>
         </groovyc>

is from our build.xml file, so I am sure it works. Are you sure you use
the correct version of Groovy?

Could it be my definition of groovyc is wrong then?

This is what it is:

    <taskdef name="groovyc" classname="org.codehaus.groovy.ant.GroovycTask">
        <classpath>
            <fileset dir="${extlib.dir.groovy-all-1.6.0}" includes="groovy-all-1.6.0.jar" />
        </classpath>
    </taskdef>

Where ${extlib.dir.groovy-all-1.6.0} points to where the groovy-all-1.6.0.jar is.

Thanks

OK, it turns out to be exactly that.  My taskdef is wrong.  I should be using the UberCompileTask instead of GroovycTask, like so:

    <taskdef name="groovyc" classname="org.codehaus.groovy.ant.UberCompileTask"> 
        <classpath>
            <fileset dir="${extlib.dir.groovy-all-1.6.0}" includes="groovy-all-1.6.0.jar"/>
        </classpath>
    </taskdef>



I think we need to clearly state that on the wiki page:

  http://groovy.codehaus.org/The+groovyc+Ant+Task

Currently there is no mention of the class UberCompileTask at all on it.  I wouldn't have found it if I didn't try to unpack the jar file to and grep for ant task
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Using Groovy 1.6.0 in Grails 1.1 to perform ant Groovyc with joint compilation

pledbrook
>    <taskdef name="groovyc"
> classname="org.codehaus.groovy.ant.UberCompileTask"> <!-- was GroovycTask

It should be:

  <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc"/>

Cheers,

Peter

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

    http://xircles.codehaus.org/manage_email


Loading...