How can I call a target from within another target.

I would like to set up an ant build file that defines several targets. Each
of these targets (such as task1 and task2) below set intial parameters and
then run a basetask. I do not think depends is sufficient because I need to
set the property BEFORE the dependent task is called.

I currently have something working, but I need to define the initial
parameter on the command line -DSomeKeyParam="xyz". 

Is there someway to call the target from within another target to accomplish
what I want?


<target name="task1">
   <property name="SomeKeyParam" value="t1">
   <call to basetask>
</target>

<target name="task2">
   <propertu name="SomeKeyParam" value="t2"> 
   <call to basetask>
</target>

<target name="basetask">
   <do something based on "SomeKeyParam">
</target>


Thanks alot,
Dave Lin
[EMAIL PROTECTED]

Reply via email to