This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills: The software developer's life manual and have John Sonmez on-line!
See this thread for details.
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using ant to over multiple packages

 
Tony Evans
Ranch Hand
Posts: 597
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 597
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic