File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Reply 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: 521
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: 521
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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Using ant to over multiple packages
 
Similar Threads
Ant - compile task and source directory setup
Class files generated in web-inf directory as well as in base directory
Apache Ant add property file and policy file
Warning Message When I Ran My ANT build.xml File
How to excute the build.xml for the ant script