ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alec Fernandez <>
Subject RE: If any one from list then
Date Wed, 12 Aug 2009 08:05:07 GMT
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.

    <contains string="${myprop}" substring="foo" />
    <contains string="${myprop}" substring="foo2" />

>> -----Original Message-----
>> From: Eric Fetzer []
>> Sent: Tuesday, August 11, 2009 10:52 PM
>> To: Ant Users
>> Subject: If any one from list then
>> I'm not sure exactly how to write something and am looking for
>> suggestions.  A break command for <for> would work (obviously I'm ok
>> with antcontrib as well), but I don't think antcontrib has one.
>> Say I have a property ${myProp} that contains a comma delimited list,
>> such as "a,w,x,z"
>> I need to do something based on a subset of those values such as:
>>     if myprop contains element a b c or d
>>             do something...
>>     endif
>> Is there a simple way to do this?  I can think of clumsy ways to do
>> this with regex, but nothing that would make me warm and fuzzy
>> inside...
>> Thanks,
>> Eric

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message