----- Original Message -----
From: "Stuart Barlow" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 25, 2000 11:49 AM
Subject: increment task
>
> When undertaking nightly builds we have found the need for a build number.
> And we also wanted this to live in a java propery file so that ANT could
> make
> use of it during the build.
- There were some tasks posted to the list (propertyFile) which would have
done the same (and more, increment, decrement, set a date)
- You can also do this using a "<property file=..", "<script .." and "<echo
file=..." combination
> public void execute() throws BuildException {
>
> if (property == null) {
> throw new BuildException("replace token must not be null",
> location);
> }
>
> log("Incrementing " + property + " in file: " + src);
>
Why not check if src is specified and valid before using it?
> File temp = new File(src.getPath() + ".temp");
>
> if (temp.exists()) {
> throw new BuildException("Replace: temporary file " +
> temp.getPath() + " already exists", location);
> }
>
I do not see why it should be a problem if temp exists since you seem not to
use it later on?
Nico