This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Customer Requirements for Developers and have Marcho Behler on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes Using ant to over multiple packages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Using ant to over multiple packages" Watch "Using ant to over multiple packages" New topic
Author

Using ant to over multiple packages

Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 588
Is there a ant guide or tutorial to show how to use ant to complile multiple packages i.e

If I have
src/revision/testA/test1.java
src/revision/testA/test2.java
src/revision/testB/test1.java
src/revision/testB/test2.java
src/revision/testC/test1.java
src/revision/testC/test2.java

and

classes/revision/testA/
classes/revision/testA/
classes/revision/testB/
classes/revision/testB/
classes/revision/testC/
classes/revision/testC/

I want to compile the java classes into thwere corresponding classes directory.

I have tried

<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="revision" basedir=".">

<property name="src.dir" value="src"/>
<property name="classes.dir" value="classes"/>

<target name="compile">
<javac scrdir="${src.dir}/*" destdir="${classes.dir}/*"/>
</target>
</project>

which failed.

Thanks for any help

Tony
Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 588
Sorted the problem out:

<?xml version="1.0"?>
<project name="revision" default="all" basedir=".">

<target name="init">
<property name="dirsbase" value="${basedir}/WEB-INF"/>
<property name="srcdir" value="${dirsbase}/src"/>
<property name="classdir" value="${dirsbase}/classes"/>
</target>

<!-- Main target -->
<target name="all" depends="init,build"/>

<target name="build" depends="init">
<javac srcdir="${srcdir}" destdir="${classdir}" debug="true" includes="**/*.java" />
</target>
</project>

Tony
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using ant to over multiple packages
 
jQuery in Action, 3rd edition