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.">
    <tstamp>
        <format property="build.time"
                pattern="yy-MM-dd_hh:mm"
                unit="hour" />
    </tstamp>

    <buildnumber file="build.number" />

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

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

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

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:

0.1d/10-01-08_07:51/31