dcsimg
Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
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 27, 2004

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


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>

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

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

 

 

 

 

 


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

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date