ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francis GALIEGUE <...@one2team.com>
Subject Re: If any one from list then
Date Wed, 12 Aug 2009 11:12:03 GMT
On Wed, Aug 12, 2009 at 10:05, Alec Fernandez<Alec.Fernandez@sas.com> wrote:
> After spending 2 days convincing myself that there was a problem with the <different>
selector only to discover that my diff tool was lying and that one of the files was indeed
different (unix line ends versus pc line ends so my editor was deceiving me too), I'm feeling
the need to respond :-)
>
> I think the condition task is what you are after.
>
> <condition>
>  <or>
>    <contains string="${myprop}" substring="foo" />
>    <contains string="${myprop}" substring="foo2" />
>  </or>
> </condition>
>

The problem is that if you want "foo" and the list is "foobar, baz",
the condition will match.

This is not an easy problem, admittedly. It could be done with two
imbricated <foreach> statements, but that would be an O(n^2)
algorithm. It may, or may not, be a problem, depending on the problem
size.

-- 

Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
fge@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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


Mime
View raw message