ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alec Fernandez <Alec.Fernan...@sas.com>
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.

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





>> -----Original Message-----
>> From: Eric Fetzer [mailto:elstonkers@yahoo.com]
>> 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: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message