ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Fetzer <>
Subject Re: Reset BuildNumber
Date Mon, 04 May 2009 17:36:55 GMT
Thanks Francis, this cleaned it up A LOT!

From: Francis Galiegue <>
To: Ant Users List <>
Sent: Saturday, May 2, 2009 2:50:06 AM
Subject: Re: Reset BuildNumber

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:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message