ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Turner <j...@socialchange.net.au>
Subject Re: incrementing a build number
Date Fri, 21 Jul 2000 04:48:59 GMT
Stuart Barlow wrote:
> 
> What is the best way in ant to read in a build number from a file and
> increment it by one?
> 
> And maybe to write that number back out to the file again?

It would certainly be nice.

I've been using a shell script called from build.sh, invoking Ant with
the parameter -Dbuild=`incBuild.sh`.


#!/bin/sh
# incBuild.sh

[ ! -e BUILD_STAMP ] && touch BUILD_STAMP
x=`cat BUILD_STAMP`
[ "$x" = "" ] && x=1
x=`expr $x + 1`
echo $x > BUILD_STAMP
echo $x


--Jeff

> Do I need to write my own task?
> 
> Thanks
> ---------------------------------------------------------------------------
> Stuart Barlow
> +44 131 468 8205

Mime
View raw message