This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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 Murach's Java Servlets and JSP this week in the Servlets 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: 573
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: 573
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
 
Similar Threads
Warning Message When I Ran My ANT build.xml File
Apache Ant add property file and policy file
Class files generated in web-inf directory as well as in base directory
How to excute the build.xml for the ant script
Ant - compile task and source directory setup