logo       

RE: Compiling: msg#00114

lang.groovy.user

Subject: RE: Compiling

Hi Bill,

I may not be the best person to answer as I'm still new here but
I can tell what worked for me :

My ant build below separates java sources, groovy sources and shared
sources.
Shared sources are e.g. java Interfaces that are used from within
java and groovy alike.

The prerequisite is that you have no cyclic dependencies through
these three entities. If you have, I have no idea how to compile that...

cheers
Mittie


(forget the ... lines)

<project default="dist" basedir=".">

<property name="groovy.lib.dir" value="/java/groovy-1.0-beta-6/lib"/>

<path id="groovy.classpath">
<fileset dir="${groovy.lib.dir}"/>
...
<pathelement location="classes"/>
</path>

<target name="clean">
<delete dir="classes" quiet="true"/>
<mkdir dir="classes"/>
<delete dir="dist" quiet="true"/>
<mkdir dir="dist"/>
</target>

<target name="compile.shared" >
<javac srcdir="shared" destdir="classes"
classpathref="groovy.classpath" />
</target>

<target name="compile.java" depends="compile.shared, compile.groovy">
<javac srcdir="test" destdir="classes"
classpathref="groovy.classpath" />
</target>

<target name="compile.groovy" depends="compile.shared">
<taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc"
classpathref="groovy.classpath"/>
<groovyc destdir="classes" srcdir="groovy" listfiles="true" >
<classpath refid="groovy.classpath"/>
</groovyc>
</target>

<target name="dist" depends="clean, compile.shared">
...
</project>

> -----Original Message-----
> From: Bill Odefey [mailto:wodefey-Eeb5sJ3am7w@xxxxxxxxxxxxxxxx]
> Sent: Freitag, 19. November 2004 19:27
> To: user-i9PBDF1N6cxnkHa44VUL00B+6BGkLq7r@xxxxxxxxxxxxxxxx
> Subject: [groovy-user] Compiling
>
>
> I have a couple of questions about compiling
>
> 1. From what I am reading, if you use ant, you should use groovyc as a
> task, just as you would javac. What libraries are required, and where
> do I place them to get ant to recognize groovyc as a task?
>
> 2. I have tried to use several methods of compilong, including the
> eclipse plugin and writing a script using the groovy compiler. I have
> one file that constructs a base class, and another that extends it. I
> am having great trouble getting the compilere to find the base class. I
> have made sure that the base class was already compiled. Has anyone
> else had this problem? My only work around right now is to combine the
> classes into one file, but this is not a long term solution. Any
> suggestions?
>




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise