ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Blaine Newsletters" <blainenewslett...@yahoo.com>
Subject RE: Auto-increment a x.x.x.x build number?
Date Tue, 23 Jul 2002 16:29:55 GMT
I had a similar problem to this at my last job. We needed an
autoincrementing counter based on the date. The format was MMDDYYYY_XX where
XX was the count for the day. The first build of the day was 01 and
incremented for each build that day. I wanted everything to be fully
automated and know that if it was a new day, the count would adjust for that
and reset to 01 again. I stored the build number in a separate properties
file.
I was using Ant 1.4 at the time and there wasn't anything available, so I
made a quick java util class that would get the system date, read the
current build number out of the properties file and update according to the
business rules I had set out in the util class. It was quick and easy and I
could set whatever rules I wanted.
If Ant can't solve your problems, a little Java could. Or maybe write your
own Ant task with the biz logic in that.
Just a suggestion...
_______________________________________________________________________
Blaine Kendall		                   http://www.blainekendall.com

-----Original Message-----
From: Diane Holt [mailto:holtdl@yahoo.com]
Sent: Tuesday, July 23, 2002 12:46 AM
To: Ant Users List
Subject: RE: Auto-increment a x.x.x.x build number?


--- "Duffey, Kevin" <KDuffey@BUYMEDIA.com> wrote:
> How about using 4 different files for <buildnumber file=""/> AND a
> conditional that says if buildnumber1 > 99, set it to 0, and then do the
> <buildnumber file="2"/>.

Now I'm back to being confused -- I thought the fourth number held an
incrementing build number, and the other three held semi-static numbers
that only incremented at a release (with which number depending on the
type of release).

Also, if by "a conditional" you mean <condition> -- it doesn't support a
'greaterthan'/'lessthan' (although it could/probably should), so you'd
need to either go with a <script> or a custom task.

> Then again, I suppose this wont work because you can't auto-increment
> a number in real-time, can you?

If by "real-time" you mean during the build run, that's what both
<buildnumber> and <propertyfile> do. (But it seems like you know that
already, so maybe I'm misunderstanding what you do mean.)

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>





--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message