ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Burgess, Benjamin" <BBurg...@tiaa-cref.org>
Subject RE: <assert> doesn't work as expected
Date Wed, 07 Sep 2005 13:17:10 GMT
An easier solution would be to pull the for loop into its own target and
then add an if="your-property" to the target.

Ben

-----Original Message-----
From: Rebhan, Gilbert [mailto:Gilbert.Rebhan@huk-coburg.de] 
Sent: Wednesday, September 07, 2005 6:11 AM
To: user@ant.apache.org
Subject: <assert> doesn't work as expected



Hi,

antcontrib 1.0b2 / ant 1.6.5 

i want to use the antcontrib / assert task in my script to ensure
that a for loop is only executed if a property has been set.

so i have =

<assert name="updatelist.@{Lum}" execute="true">
<for list="${updatelist.@{Lum}}" param="copyfile">
   <sequential>
	<echo message="Kopiere Datei -> @{copyfile}" />
            ...
  </sequential>
</for>
</assert>

in my script.

Now i tested the worst case, when the property hasn't been set.
But the for loop runs nevertheless.
The property bla has not been set =

<assert name="${bla}" execute="true">
<for list="${updatelist.@{Lum}}" param="copyfile">
   <sequential>
	<echo message="Kopiere Datei -> @{copyfile}" />
            ...
  </sequential>
</for>
</assert>

I also put the assert into <sequential> ... </sequential> with same
result.

>From what i read in the antcontrib manual, assert tests for
existence of the given property ?!

Any hints ?

OK i may use if / then ... but assert would be shorter.


Gilbert

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



**************************************************************
This message, including any attachments, contains confidential information intended for a
specific individual and purpose, and is protected by law.  If you are not the intended recipient,
please contact sender immediately by reply e-mail and destroy all copies.  You are hereby
notified that any disclosure, copying, or distribution of this message, or the taking of any
action based on it, is strictly prohibited.
TIAA-CREF
**************************************************************


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


Mime
View raw message