You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Rebhan, Gilbert" <Gi...@huk-coburg.de> on 2005/08/31 11:25:48 UTC

with for loop ?

Hi,

i want to run an antcontrib for loop only,
if a property has been set.

So i wrote =

<if>
<isset property="${deldirs.@{Lum}}" />
<then>
       <for list="${deldirs.@{Lum}}"  param="deldir">
	<sequential>
	<echo message="Deleting Directory -> @{deldir}" />
	</sequential>
      </for>
</then>
</if>

but that didn't work.

How to check if a property has been set in
conjunction with a foor loop ?

Regards, Gilbert

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


RE: with for loop ?

Posted by Dominique Devienne <dd...@gmail.com>.
> From: Rebhan, Gilbert [mailto:Gilbert.Rebhan@huk-coburg.de]
> i want to run an antcontrib for loop only,
> if a property has been set.
> <if>
> <isset property="${deldirs.@{Lum}}" />
> <then>

Glad to hear Ant-Contrib's <assert> works for you.
I believe your mistake above was to de-reference the property name instead
of supplying just the property name. You should have written:

	<isset property="deldirs.@{Lum}" />

Of course this code must be in the context of a <ac:for> or <macrodef> to be
valid, as otherwise @{Lum} will not be replaced with a value. --DD


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