ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francis Galiegue <>
Subject Re: Reset BuildNumber
Date Sat, 02 May 2009 08:50:06 GMT
Le Friday 01 May 2009 19:46:14 Eric Fetzer, vous avez écrit :
> So to make it work, here's what I had to do.  Seems like an awful lot of
> work to accomplish something simple like this.

You seem to be using ant-contrib, why not go with <var> and <math>?

<target name="main">
	<property file="build.number"/>
	<var name="next.major" value="${major.number}"/>
	<var name="next.minor" value="${minor.number"/>
		<equals arg1="${major.increment}" arg2="true"/>
			<math result="next.major" operand1="${next.major"}
				operation="+" operand2="1" datatype="int"/>
			<math result="next.minor" operand1="${next.minor"}
				operation="+" operand2="1" datatype="int"/>
	<propertyfile file="build.number">
		<entry key="major.number" value="${next.major}"/>
		<entry key="minor.number" value="${next.minor}"/>
	<property name="full.buildnumber" value="${next.major}.${next.minor}"/>
	<echo message="Full version number is ${full.buildnumber}"/>

This example is based ona build.number file that contains both the 
major.number and minor.number, but you get the idea.

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

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

View raw message