Thank you very much Francis!  I really appreciate the hand holding as I 
transition over to Ant...




________________________________
From: Francis Galiegue <f...@one2team.com>
To: Ant Users List <user@ant.apache.org>
Sent: Monday, May 4, 2009 1:48:44 PM
Subject: Re: Reset BuildNumber

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
f...@one2team.com
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
One2team
40 avenue Raymond Poincaré
75116 Paris

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


      

Reply via email to