ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lopez, William" <william.lo...@eds.com>
Subject RE: Valid depends value
Date Sun, 13 Apr 2003 21:44:54 GMT
Thans Jesse!

-----Original Message-----
From: Jesse Stockall [mailto:jesse@cryptocard.com] 
Sent: Sunday, April 13, 2003 11:00 AM
To: Ant Users List
Subject: Re: Valid depends value


On Saturday, April 12, 2003, at 06:06  PM, Lopez, William wrote:

> EJ:
>
> Thanks for the response. I define a property
> <property name="copy.envnt" value="copy${envnt}"/>
>
> ...the following targets are defined to backup different directories 
> depending on an arg that is passed in via the cmd line using, "ant 
> -Denvnt="INT" >> backup.log 2>&1"
>
> <target name="copyALL"
> <target name="copyINT"
> <target name="copySYS"
> <target name="copyUAT"
>
> ...the default target is defined as:
> <target name="emailStop" depends="init,copyMisc,${copy.envnt}">
>
> But it bombs on the resolution of ${copy.envnt} in the depends
> attribute of
> target "emailStop". I have not had luck with te unless or if but if 
> that's
> the only way to go I'll give it another shot in figuring it out.

Try this:

<target name="emailStop" depends="init, copyMisc, copyAll, copyINT, 
copySYS, copyUAT"/>

<target name="copyALL" if="copyALLprop"/>
<target name="copyINT" if="copyINTprop"/>
<target name="copySYS" if="copySYSprop"/>
<target name="copyUAT" if="copyUATprop"/>

Then on the command line 'ant -DcopyALLprop=blah emailStop'

Some caveats on using if / unless

The if condition on targets do not check what the property is set to, 
only the fact that it is set or not.
All the targets listed in 'depends' of a target are executed even if 
the target will not be.

Jesse Stockall - jesse@cryptocard.com
CRYPTOCard Corp.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org

Mime
View raw message