Automatically build number generation in ANT

I wanted to find some solution to a problem of automatic generation of build numbers/version identifiers using an ANT. I figured out that I can achieve it in the following way:

<target name="numerate.version"
        description="Generates version number and sets it in
                     Client properties file.">
        <format property="build.time"
                unit="hour" />

    <buildnumber file="build.number" />

    <property name="version.code"
              value="${build.version}/${build.time}/${build.number}" />

    <echo>Version: ${version.code}</echo>

    <replaceregexp file="${}"
                   match="(version[ \t]*=[ \t]*)+.*$"
                   replace="\1${version.code}" />

A short description what is going on:

The last part (replaceregexp) is used to get the most recent version number in the *.properties file which can be printed on the presentation layer (i.e. on the page footer). You can achieve it using the GWT i18n features, which uses the properties files for international labels generation.

Needles to say, this target should be invoked before the actual GWT compilation.
An example of generated build/version number using this script is as follows: