changeset 480:67645f6246fb

new ant build file for digilib (Servlet and Webapp)
author robcast
date Fri, 09 Feb 2007 16:48:14 +0100
parents 1b2f8a9762ab
children e45de6ca9b9c
files config/build.xml
diffstat 1 files changed, 92 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/config/build.xml	Fri Feb 09 16:48:14 2007 +0100
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project basedir="." default="build" name="digilib-servlet">
+  <property environment="env"/>
+  <property name="debuglevel" value="source,lines,vars"/>
+  <property name="target" value="1.4"/>
+  <property name="source" value="1.4"/>
+  <path id="digilib.classpath">
+    <pathelement location="bin"/>
+    <fileset dir="lib">
+      <include name="**/*.jar"/>
+    </fileset>
+  </path>
+
+  <target name="init">
+    <mkdir dir="bin"/>
+    <mkdir dir="dist"/>
+    <available file="servlet/src" property="has.servlet.src"/>
+    <available file="client/digitallibrary" property="has.webapp.src"/>
+  </target>
+
+  <target name="clean">
+    <delete dir="bin"/>
+  </target>
+
+  <target name="cleanall" depends="clean">
+    <delete dir="client"/>
+    <delete dir="servlet"/>
+  </target>
+
+  <target name="build" depends="pkg-servlet,move-servlet"/>
+
+  <target name="dist" depends="build,copy-lib,pkg-webapp"/>
+
+  <target name="dist-nolib" depends="build,pkg-webapp"/>
+
+  <target depends="init,get-src" name="build-servlet">
+    <echo message="${ant.project.name}: ${ant.file}"/>
+    <javac debug="true" debuglevel="${debuglevel}" destdir="bin" source="${source}" target="${target}">
+      <src path="servlet/src"/>
+      <classpath refid="digilib.classpath"/>
+    </javac>
+    <!-- Create the time stamp -->
+    <tstamp/>
+  </target>
+
+  <target name="pkg-servlet" depends="build-servlet">
+    <!-- Put everything in ${build} into the jar file -->
+    <jar destfile="dist/DigilibServlet-${DSTAMP}.jar" basedir="bin" index="yes"/>
+  </target>
+
+  <target name="move-servlet" depends="pkg-servlet,get-webapp">
+    <!-- put the new jar file in the webapp -->
+    <copy file="dist/DigilibServlet-${DSTAMP}.jar"
+          tofile="client/digitallibrary/WEB-INF/lib/DigilibServlet.jar"/>
+  </target>
+
+  <target name="copy-lib">
+    <!-- copy all files in lib in the webapp -->
+    <copy todir="client/digitallibrary/WEB-INF/lib" includeemptydirs="false">
+      <fileset dir="lib"/>
+    </copy>
+  </target>
+
+  <target name="pkg-webapp" depends="get-webapp">
+    <zip destfile="dist/digilib-${DSTAMP}.zip" basedir="client" />
+  </target>
+
+  <target name="get-all" depends="get-src,get-webapp"/>
+
+  <target name="get-src" unless="has.servlet.src"
+          description="download fresh set of sources from CVS">
+    <cvs cvsRoot=":pserver:anonymous@cvs.digilib.berlios.de:/cvsroot/digilib"
+         package="servlet/src" compression="true"/>
+  </target>
+
+  <target name="get-webapp" unless="has.webapp.src"
+          description="download fresh webapp directory from CVS">
+    <cvs cvsRoot=":pserver:anonymous@cvs.digilib.berlios.de:/cvsroot/digilib"
+         package="client/digitallibrary" compression="true"/>
+  </target>
+
+  <!-- CVS update should not be needed, checkout is preferrable -->
+  <target name="update" depends="update-src,update-webapp"/>
+
+  <target name="update-src" description="update sources from CVS" >
+    <cvs dest="servlet/src" command="update" compression="true"/>
+  </target>
+
+  <target name="update-webapp" description="update webapp from CVS" >
+    <cvs dest="client/digitallibrary" command="update" compression="true"/>
+  </target>
+</project>