ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francis Galiegue <>
Subject Re: Reset BuildNumber
Date Mon, 04 May 2009 19:48:44 GMT
Le Monday 04 May 2009 21:03:58 Eric Fetzer, vous avez écrit :
> I had to go a little deeper, David.  I wanted to be able to rebuild the
> same build number and also, have a 5th build element when built by
> continuous integration.  Something that bugs me about Ant properties (I've
> been writing with NAnt for the past 6 years) is that you can't simply set a
> new value for a Ant property, but rather have to unset first.  Anyway,
> here's what I ended up with:
> <project default="setBuildNumber">
>   <taskdef resource="net/sf/antcontrib/antlib.xml"/>
>   <taskdef name="unset" classname="ise.antelope.tasks.Unset"/>
>     <target name="setBuildNumber">
>       <property file="build.number"/>
>       <var name="next.major" value="${major.number}"/>
>       <var name="next.minor" value="${minor.number}"/>
>       <var name="next.hotfix" value="${hotfix.number}"/>
>       <var name="next.revision" value="${revision.number}"/>
>       <var name="next.continuous" value="${continuous.number}"/>
>       <if>
>         <equals arg1="${rebuild}" arg2="true"/>
>         <then/>

Your solution looks awfully complicated. There is much more simple than that. 
Don't forget that you can nest <var>s. As a first, why <then/> when you can 
do <if> <not> <theconditionhere> </not> <then> </then>?

As a personal exercise, I'll try to make a more simple generator than what you 
did already. Expect "my way to do it" in an hour or so. I think you'll find 
the simplification very attracting ;)

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