Title: RE: Having trouble getting multiple targets to execute

&> ant compile

should work, since it depends on "init"

&> ant init

should result on the "init" target being executed ONLY.


--Lorenzo


-----Original Message-----
From: Allan McNeil [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 20, 2001 5:03 PM
To: [EMAIL PROTECTED]
Subject: Having trouble getting multiple targets to execute


I can only get the default target to execute.
Subsequent target elements are not executed.
Does anyone have any solutions?

Here's the scenario:

_______________________________
My Setup:
OS:  Windows 2000 Professional
Ant Version:  akarta-ant-1.3
JDK Version:  1.3.1
_______________________________

I have an XML file to create a simple build.
It has 2 target elements.
The default element executes, but the other target element does not.
If I change the default element to be the second target element, then
the second target element executes but not the first one.

Here is my xml file I'm passing to ant:

<project name="GetRequestURI" default="init" basedir="C:\apps\projects\build">

<!-- Set Global Properties For This Build -->
       
<property name="dir_basedir" value="C:\apps\projects\build" />
       
<!-- Begin:  Set Directory Names -->
<property name="dir_webapp" value="test1"/>
<property name="dir_web_inf" value="WEB-INF"/>
<property name="dir_images" value="images"/>
<property name="dir_jsp" value="jsp"/>
<property name="dir_meta_inf" value="META-INF"/>
<property name="dir_lib" value="lib"/>
<property name="dir_classes" value="classes"/>
<!-- End:  Set Directory Names -->
               
<!-- Begin:  Set Java Class Paths -->
<property name="clspth_jdk" value="C:\jdk1.3.1" />
<property name="clspth_Tomcat_Servlet" value="C:\apps\tomcat\lib\servlet.jar"
/>
<property name="clspth_GetRequestURI" value="C:\apps\projects\Java_Files\examples\GetRequestURI"
/>
<!-- End:  Set Java Class Paths -->

<!-- Begin:  Set Java Destination Paths -->
<property name="destpth_GetRequestURI" value="C:\apps\projects\Java_Files\examples\GetRequestURI"
/>
<!-- End:  Set Java Destination Paths -->
       
<!-- End:  Set Global Properties For This Build -->

 
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the directory structure for a tomcat web application -->
<mkdir dir="${dir_webapp}"/>
<mkdir dir="${dir_webapp}\${dir_web_inf}"/>    
<mkdir dir="${dir_webapp}\${dir_web_inf}\${dir_classes}"/>
<mkdir dir="${dir_webapp}\${dir_web_inf}\${dir_lib}"/>
<mkdir dir="${dir_webapp}\${dir_meta_inf}"/>
<mkdir dir="${dir_webapp}\${dir_jsp}"/>
<mkdir dir="${dir_webapp}\${dir_images}"/>     
</target>

<target name="compile" depends="init">
<javac  srcdir="${clspth_GetRequestURI}"
destdir="${dir_basedir}\${dir_webapp}\${dir_web_inf}\${dir_classes}"
classpath="${clspth_jdk};${clspth_GetRequestURI};${clspth_Tomcat_Servlet}"
debug="off"
/>
</target>
</project>

--
Allan M.
[EMAIL PROTECTED] - email




__________________________________________________
FREE voicemail, email, and fax...all in one place.
Sign Up Now! http://www.onebox.com

Reply via email to