Friday 3 January 2014

Tstamp task in Ant

The Tstamp task in Apache Ant is used to set the DSTAMP, TSTAMP and TODAY properties. These properties can then be used in the build file, to generate filenames having the timestamps as strings.

Eg:

<tstamp>
        <format property = "current-date" pattern = "d-MMMM-yyyy" locale="en" />
        <format property = "current-time" pattern = "hh:mm:ss" locale="en />
</tstamp>

Note the nested element format which is used to set properties to a current time or date.

You could also add a prefix to these properties as follows:

Eg:

<tstamp prefix = "info">
</tstamp>

This will prefix the properties with the world info info. i.e. info.DSTAMP, info.TSTAMP, info.TODAY

Official detailed technote can be found here.

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...
eXTReMe Tracker