Show build.xml syntax highlighted
<?xml version="1.0" encoding="utf-8" ?>
<project name="build" default="create-war-file" basedir=".">
<property name="SOURCE" value="1.5" />
<property name="TARGET" value="1.5" />
<property name="MODULE_NAME" value="ucalgary.ebe.webui.AgilePlannerWebUI" />
<!-- set classpath -->
<path id="project.class.path">
<pathelement path="${java.class.path}/" />
<pathelement path="lib/gwt-user.jar" />
<!-- Additional dependencies (such as junit) go here -->
<pathelement path="lib/distributed-persister.jar" />
</path>
<target name="clean" description="Remove all build artifacts">
<delete file="AgilePlannerWebUI.jar" />
<delete dir="tmp" />
</target>
<target name="compile" depends="clean" description="Compile src to tmp folder">
<mkdir dir="tmp" />
<javac srcdir="src" destdir="tmp" includes="**" debug="on" debuglevel="lines,vars,source" source="${SOURCE}" target="${TARGET}">
<classpath refid="project.class.path" />
</javac>
</target>
<target name="gwt-compile" depends="check-os,compile" description="Runs the appropriate GWT compiler">
<antcall target="gwt-compile-linux" />
<antcall target="gwt-compile-mac" />
<antcall target="gwt-compile-windows" />
</target>
<target name="gwt-compile-windows" if="isWindows" description="GWTCompiler for Windows">
<java classname="com.google.gwt.dev.GWTCompiler" fork="true">
<arg value="-out" />
<arg value="www" />
<arg value="ucalgary.ebe.webui.AgilePlannerWebUI" />
<classpath>
<path refid="project.class.path" />
<pathelement path="lib/gwt-dev-windows.jar" />
<pathelement path="tmp" />
<pathelement path="src" />
</classpath>
</java>
</target>
<target name="gwt-compile-linux" if="isLinux" description="GWTCompiler for Linux">
<java classname="com.google.gwt.dev.GWTCompiler" fork="true">
<arg value="-out" />
<arg value="www" />
<arg value="ucalgary.ebe.webui.AgilePlannerWebUI" />
<classpath>
<path refid="project.class.path" />
<pathelement path="lib/gwt-dev-linux.jar" />
<pathelement path="tmp" />
<pathelement path="src" />
</classpath>
</java>
</target>
<target name="gwt-compile-mac" if="isMac" description="GWTCompiler for Mac OS">
<java classname="com.google.gwt.dev.GWTCompiler" fork="true">
<arg value="-out" />
<arg value="www" />
<arg value="ucalgary.ebe.webui.AgilePlannerWebUI" />
<classpath>
<path refid="project.class.path" />
<pathelement path="lib/gwt-dev-mac.jar" />
<pathelement path="tmp" />
<pathelement path="src" />
</classpath>
</java>
</target>
<target name="check-os" description="Check which OS is used to decide which GWTCompiler to use">
<echo>${os.name}</echo>
<condition property="isWindows" value="true">
<or>
<equals arg1="${os.name}" arg2="Windows NT" />
<equals arg1="${os.name}" arg2="Windows 2000" />
<equals arg1="${os.name}" arg2="Windows XP" />
</or>
</condition>
<condition property="isLinux" value="true">
<or>
<equals arg1="${os.name}" arg2="Linux" />
</or>
</condition>
<condition property="isMac" value="true">
<or>
<equals arg1="${os.name}" arg2="Mac OS" />
<equals arg1="${os.name}" arg2="Mac OS X" />
</or>
</condition>
</target>
<target name="package" depends="compile" description="Package up the project as a jar">
<!-- Create the project jar-file -->
<jar destfile="tmp/AgilePlannerWebUI.jar">
<!-- include compiled classes -->
<fileset dir="tmp">
<include name="**/*.class" />
</fileset>
<!-- Get everything; source, modules, html files -->
<fileset dir="src">
<include name="**" />
</fileset>
</jar>
</target>
<target name="create-war-file" depends="package,gwt-compile" description="Create the application .war file">
<!-- Creates the WEB-INF folder for web.xml and required libraries -->
<mkdir dir="www/${MODULE_NAME}/WEB-INF"/>
<mkdir dir="www/${MODULE_NAME}/WEB-INF/lib"/>
<copy todir="www/${MODULE_NAME}/WEB-INF" file="WEB-INF/web.xml"/>
<!-- Copies required libraries to WEB-INF/lib -->
<copy todir="www/${MODULE_NAME}/WEB-INF/lib" file="lib/gwt-servlet.jar"/>
<copy todir="www/${MODULE_NAME}/WEB-INF/lib" file="lib/distributed-persister.jar"/>
<copy todir="www/${MODULE_NAME}/WEB-INF/lib" file="tmp/AgilePlannerWebUI.jar"/>
<!-- Change page name to "index.html" -->
<move file="www/${MODULE_NAME}/AgilePlannerWebUI.html" tofile="www/${MODULE_NAME}/index.html"/>
<!-- Copy initial project description file into war file, otherwise you will get
errors when starting the web-service -->
<copy todir="www/${MODULE_NAME}" file="default.xml"/>
<!-- Create the war-file -->
<jar destfile="AgilePlannerWebUI.war" basedir="www/${MODULE_NAME}"/>
<!-- Remove artifacts -->
<delete dir="tmp"/>
<delete dir="www/${MODULE_NAME}/WEB-INF"/>
</target>
</project>
See more files for this project here