ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: Filtering on property values
Date Fri, 03 Feb 2006 17:38:09 GMT
AntContribs <propertyregexp> is the easiest way.
An Ant-only way would be using multiple properties

version.major=7
version.minor=6
version.patch=1
version=${version.major}.${version.minor}.${version.patch}
friendly.version=${version.major}_${version.minor}_${version.patch}


Jan 

>-----Urspr√ľngliche Nachricht-----
>Von: Matthew Hughes [mailto:mhughes@feith.com] 
>Gesendet: Freitag, 3. Februar 2006 18:33
>An: user@ant.apache.org
>Betreff: Filtering on property values
>
>I have a property
>
><property name="version" value="7.6.1" />
>
>In certain tasks, I want the version value to be "7_6_1" with 
>underscores replacing the periods.  How do I create a new 
>property that would have this value.  I know how to use 
>filters to filter tokens when copying files, but I can't seem 
>to figure out how to do that for the value of a property.
>
>e.g. I want to do something like this:
>
><filterset id="replace.version">
>        <filter token="." value="_" />
></filterset>
>
><property name="friendly.version" value="${version} 
>filterid="replace.version" />
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For 
>additional commands, e-mail: user-help@ant.apache.org
>
>

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


Mime
View raw message