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.

    Erik

----- Original Message -----
From: "chris brown" <[EMAIL PROTECTED]>
To: "Ant Users List" <[EMAIL PROTECTED]>
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
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?
>
> Thanks,
> Christopher Brown
>
>
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to