wiki:AntBuildFiles
Last modified 11 years ago Last modified on 11/22/06 15:42:47

Template Build File

War

<?xml version="1.0" encoding="UTF-8"?>
<!--
 The tasks are
 * clean - remove build files
 * compile
 * jar
 * javadoc
-->
<project name="MsDXBrain" default="war" basedir=".">
	
	<property name="src" value="src"/>
	<property name="build" value="build/classes"/>
	<property name="debug" value="true"/>
	<property name="javadoc" value="doc"/>
	
	<target name="usage">
		<echo message="targets:"/>
		<echo message="* clean - remove build files"/>
		<echo message="* compile - make the project"/>
		<echo message="* war - make the project and war it"/>
		<echo message="* javadoc - make the project documentation"/>
	</target>
	<!--Make the javadoc-->
	<target name="javadoc">
		<delete dir="${javadoc}"></delete>
		  <javadoc packagenames="edu.*"
		           sourcepath="src"		           
		           destdir="${javadoc}"
		           author="true"
		           version="true"
		           use="true"
		           windowtitle="${ant.project.name}"
		  	verbose="false">
		    <doctitle><![CDATA[<h1>MetaData Library</h1>]]></doctitle>
		    <bottom><![CDATA[<i>Copyright &#169; 2006 University of Washington. All Rights Reserved.</i>]]></bottom>
		    <tag name="todo" scope="all" description="To do:"/>
		    <link href="http://java.sun.com/j2se/1.5.0/docs/api/"/>
		  </javadoc>
	</target>
	<!--clean everything-->
	<target name="clean">
		<delete dir="${build}" />
	</target>
	<target name="compile">
		<mkdir dir="${build}"/>
		<javac srcdir="${src}" destdir="${build}" debug="${debug}">
			<classpath>
				<fileset dir=".">
					<include name="**/*.jar"/>
				</fileset>
			</classpath>
		</javac>
		<copy todir="${build}">
			<fileset dir="${src}" includes="**/*" excludes="**/*.java"/>
		</copy>
	</target>
	<target name="war">
		<antcall target="compile">
			<param name="build" value="WebContent/WEB-INF/classes"/>			
		</antcall>
		<jar destfile="${ant.project.name}.war" basedir="WebContent"/>
		<delete dir="WebContent/WEB-INF/classes"/>
	</target>
</project>

Jar

<?xml version="1.0" encoding="UTF-8"?>
<!--
 The tasks are
 * clean - remove build files
 * compile
 * jar
 * javadoc
-->
<project name="NIFTILookup" default="jar" basedir=".">
	<property name="src" value="src"/>
	<property name="build" value="bin"/>
	<property name="debug" value="true"/>
	<property name="javadoc" value="doc"/>
	
	<target name="usage">
		<echo message="targets:"/>
		<echo message="* clean - remove build files"/>
		<echo message="* compile - make the project"/>
		<echo message="* jar - make the project and jar it"/>
		<echo message="* javadoc - make the project documentation"/>
	</target>
	<!--Make the javadoc-->
	<target name="javadoc">
		<delete dir="${javadoc}"></delete>
		  <javadoc packagenames="edu.*"
		           sourcepath="src"		           
		           destdir="${javadoc}"
		           author="true"
		           version="true"
		           use="true"
		           windowtitle="${ant.project.name}"
		  	verbose="false">
		    <doctitle><![CDATA[<h1>${ant.project.name}</h1>]]></doctitle>
		    <bottom><![CDATA[<i>Copyright &#169; 2006 University of Washington. All Rights Reserved.</i>]]></bottom>
		    <tag name="todo" scope="all" description="To do:"/>
		    <link href="http://java.sun.com/j2se/1.6.0/docs/api/"/>
		  </javadoc>
	</target>
	<!--clean everything-->
	<target name="clean">
		<delete dir="${build}" />
	</target>
	<!--Compile a jar file for matfile reading support-->
	<target name="compile">
		<mkdir dir="${build}"/>
		<javac srcdir="${src}" destdir="${build}" debug="${debug}">
			<classpath>
				<fileset dir="lib" includes="**/*.jar"/>
			</classpath>
			</javac>
	</target>
	<target name="jar" depends="compile">
		<copy todir="${build}">
			<fileset dir="${src}" includes="**/*" excludes="**/*.java"/>
		</copy>
		<jar destfile="${ant.project.name}.jar" basedir="${build}"/>
	</target>
</project>