Mercurial > hg > human-echolocation-java-webapp
changeset 12:594fcd75a5ed
Created an ant build-war target.
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Fri, 29 Nov 2013 16:29:07 +0000 |
parents | 2129d2bac6cb |
children | 02c01c48cec1 |
files | build.xml |
diffstat | 1 files changed, 18 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/build.xml Fri Nov 29 15:48:07 2013 +0000 +++ b/build.xml Fri Nov 29 16:29:07 2013 +0000 @@ -9,14 +9,22 @@ <property name="lib" location="webapp/WEB-INF/lib"/> <property name="src" location="webapp/WEB-INF/src"/> <property name="classes" location="webapp/WEB-INF/classes"/> - - <property name="dist" location="dist"/> + <property name="web.dir" location="webapp"/> + <property name="war.file" location="echoapp.war"/> <uptodate property="matlabCompile.notRequired" targetfile="${matlab-build}/isvr.jar" > <srcfiles dir= "${matlab-src}" includes="*.m"/> <srcfiles dir= "${matlab-src}/private" includes="*.m"/> </uptodate> + <uptodate property="warBuild.notRequired" targetfile="${war.file}" > + <srcfiles dir= "${classes}" includes="*.class"/> + <srcfiles dir= "${web.dir}" includes="*.jsp"/> + <srcfiles dir= "${web.dir}/WEB-INF" includes="*.jsp"/> + <srcfiles dir= "${web.dir}/WEB-INF" includes="*.css"/> + <srcfiles dir= "${web.dir}/WEB-INF/" includes="*.xml" /> + </uptodate> + <target name="init"> <!-- Create the time stamp --> <tstamp/> @@ -40,19 +48,17 @@ <javac srcdir="${src}" destdir="${classes}" classpath="servlet-api.jar:${lib}/javabuilder.jar:${lib}/isvr.jar" includeantruntime="false"/> </target> - <target name="dist" depends="build" - description="generate the distribution" > - <!-- Create the distribution directory --> - <mkdir dir="${dist}/lib"/> - - <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file --> - <jar jarfile="${dist}/lib/MyProject-${DSTAMP}.jar" basedir="${build}"/> + <target name="build-war" depends="build" + description="generate the WAR file" unless="warBuild.notRequired"> + <war destfile="${war.file}" webxml="${web.dir}/WEB-INF/web.xml"> + <fileset dir="${web.dir}"> + <exclude name="${web.dir}/WEB-INF/web.xml" /> + </fileset> + </war> </target> - <target name="clean" - description="clean up" > + <target name="clean" description="clean up" > <!-- Delete the ${build} and ${dist} directory trees --> <delete dir="${build}"/> - <delete dir="${dist}"/> </target> </project>