ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Hatcher" <>
Subject Re: Incremental build number
Date Fri, 18 Jan 2002 11:10:31 GMT
Have a look at the optional <propertyfile> task.  It has several property
file manipulations such as incrementing integers (and dates!).  You'll still
need <property file="..."/> to load it up after you increment.


----- Original Message -----
From: "chris brown" <>
To: "Ant Users List" <>
Sent: Friday, January 18, 2002 5:18 AM
Subject: Incremental build number

> How can I generate an incremental build number (which I'd like to store as
> in a property for later use in the Ant script)?
> I only want the build number to be incremented each time I execute a
> specific target (a "compile" target for example; I don't need to increment
> it when I execute a target to generate javadocs...).  However, I would
> the most recent build number to be available to all targets (I'd like to
> retrieve this during execution of an "init" target).
> I had thought of using a properties file to store a build number... but I
> can't see any way of verifying whether the file contained the appropriate
> property name (important), and whether it was an integer (not so
> but useful).  I had imagined writing a simple Java class to load the
> specified properties file and increment the build number (this would be
> from my "compile" target as a <Java> task).
> Any suggestions?
> Thanks,
> Christopher Brown
> --
> To unsubscribe, e-mail:   <>
> For additional commands, e-mail: <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message