Ant: Simple build file


<?xml version="1.0"?>
<project name="ant test project" default="dist" basedir=".">

	<property name="src" location="src"/>
	<property name="build" location="build"/>
	<property name="dist"  location="dist"/>

	<target name="init">
		<mkdir dir="${build}"/>

	<target name="compile" depends="init" >
		<javac srcdir="${src}" destdir="${build}"/>
	 <target name="dist" depends="compile" >
		<mkdir dir="${dist}/lib"/>
		<jar jarfile="${dist}/lib/${DSTAMP}-${TSTAMP}.jar" basedir="${build}"/>
	<target name="clean" description="clean up" >
		<delete dir="${build}"/>
		<delete dir="${dist}"/>

To run this

>ant -f build.xml
for specific task (eg. clean)
>ant -f build.xml clean

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: