ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: Simple manipulation of a property value
Date Wed, 27 Oct 2004 14:04:33 GMT
On Oct 27, 2004, at 8:56 AM, BenoƮt Lubek wrote:
> Hi,
> I have a property :
> <property name="version" value="v1.0.2" />
> And I'd like to manipulate it a bit, ie, change the "." to "_" (so it 
> can be used for a cvs tag). So I'd like to have a property with the 
> value "v1_0_2".
> Is there a way to do that with the core tasks? I realize it would be 
> easy to do it with the <script> task, but I would prefer to avoid the 
> need to depend on another jar for our project... Any idea?

There is no way to do this without some scripting, that I know of.  
However, an alternative is to keep the pieces of that property 

	<property name="part1" value="1"/>
	<property name="part2" value="0"/>
	<property name="part3" value="2"/>

	<property name="version" value="v${part1}.${part2}.${part3}"/>

	<property name="version_with_underscores" 


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

View raw message