Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: Java
Expertise: Intermediate
Jan 26, 2004



Application Security Testing: An Integral Part of DevOps

Build Output Using the Ant <tstamp/> Task

When you execute <tstamp/>, it generates the local ANT macros ${TSTAMP} and ${DSTAMP}. These are the time and date as numeric strings. They can then be used to dynamically generate timestamp strings. Here is an example in a simple ANT buildfile that generates a timestamped jarfile:

<?xml version="1.0"?>

<project name="tstamp" basedir="." default="jar">
    <property name="src"   value="src"/>
    <property name="obj"   value="obj"/>
	<property name="jar"   value="tstamp"/>

	<target name="clean">
		<delete file="${jar}.jar"/>
		<delete dir="${obj}"/>
		<delete dir="${doc}"/>

    <target name="compile">
        <javac srcdir="${src}" destdir="${obj}" source="1.4" debug="true"
deprecation="true" />

    <target name="jar" depends="compile">
        <jar jarfile="${jar}-${DSTAMP}${TSTAMP}.jar" compress="true">
			<fileset dir="${obj}" includes="**/*"/>
			<fileset dir="${src}" includes="**/*"/>
The above build.xml outputs a jarfile named 'tstamp-200307011540.jar'
David Howard
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date