<project name="Example Build Script" basedir="." default="deploy.local">
	<!-- Load properties -->
	<property file="build.properties"/>
	
	<!-- Load task definitions e.g. FTP -->
	<path id="class.path">
		<fileset dir="${lib.dir}" includes="*.jar"/>
	</path>	
	<taskdef file="task.properties" classpathref="class.path"/>
	
	<!-- Set variables for build directories -->
	<property name="build.dir" value="build"/>
	<property name="src.dir" value="src"/>
	<!-- set variable for external lib directory 
	(typically set up as external project within project) -->
	<property name="lib.dir" value="lib"/>
	
	<target name="-init" depends="clean">
		<echo>Creating temporary folders...</echo>
		<mkdir dir="${build.dir}"/>
	</target>
	
	<target name="clean" description="Clean up">
		<echo>Cleaning up...</echo>
		<delete dir="${build.dir}"/>
	</target>
	
	<target name="build" depends="-init" description="Build project">
		<echo>Copying files to build folder...</echo>
		<copy todir="${build.dir}">
			<fileset dir="${src.dir}"/>
		</copy>
	</target>
	
	<target name="deploy.local" depends="build" description="Deploy to local webserver">
		<echo>Deleting files from local webserver...</echo>
		<delete>
			<fileset dir="${deploy.dir.local}"/>
		</delete>
		
		<echo>Copying files to local webserver...</echo>
		<copy todir="${deploy.dir.local}">
			<fileset dir="${build.dir}"/>
		</copy>
		
		<antcall target="clean"/>
	</target>
	
	<target name="deploy.dev" depends="build" description="Release to remote dev webserver">
 				
 		<ftp server="${deploy.dev.ftp.host}"
			remotedir="${deploy.dev.ftp.basedir}"
			userid="${deploy.dev.ftp.username}"
			password="${deploy.dev.ftp.password}">
			<fileset dir="${build.dir}"/>
		</ftp>
		
		<!-- Clean up -->
		<antcall target="clean"/>
	</target>
	
</project>
