How would you write a build.xml file, using neither custom code nor external dependencies (such as a shell script), that:
This solution does increment minor or revision number automatically if a compile or a dist target has been selected. The incrementation can be switched off if one of the following properties has been set:
If the property inc.major has been set, then the major number will be incremented and the other both values will be set to zero. The SHA-1 checksum is being calculated by the textual representation of the version file.
By the way: If would have been allowed, you could create your own ant task in java script, which is included in JDK 6.
Now here's the ant file
Version: ${major.number}.${minor.number}.${build.number}
SHA1: ${sha1.number}