ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peterson, Lance" <>
Subject RE: Incremental build number
Date Fri, 18 Jan 2002 15:59:00 GMT
Take a look at the <propertyfile> task.  This task writes String and int
properties to a file that you specify.  For int properties, you can also
specify an increment operation.  Then in your init target you can read the
property file with a <property file="" /> task.

-----Original Message-----
From: chris brown []
Sent: Friday, January 18, 2002 3:19 AM
To: Ant Users List
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 like
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 important,
but useful).  I had imagined writing a simple Java class to load the
specified properties file and increment the build number (this would be run
from my "compile" target as a <Java> task).

Any suggestions?

Christopher Brown

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

View raw message