Mercurial > hg > digilib-old
comparison config/build.xml @ 480:67645f6246fb
new ant build file for digilib (Servlet and Webapp)
author | robcast |
---|---|
date | Fri, 09 Feb 2007 16:48:14 +0100 |
parents | |
children | 2fc05626a503 |
comparison
equal
deleted
inserted
replaced
479:1b2f8a9762ab | 480:67645f6246fb |
---|---|
1 <?xml version="1.0" encoding="UTF-8"?> | |
2 <project basedir="." default="build" name="digilib-servlet"> | |
3 <property environment="env"/> | |
4 <property name="debuglevel" value="source,lines,vars"/> | |
5 <property name="target" value="1.4"/> | |
6 <property name="source" value="1.4"/> | |
7 <path id="digilib.classpath"> | |
8 <pathelement location="bin"/> | |
9 <fileset dir="lib"> | |
10 <include name="**/*.jar"/> | |
11 </fileset> | |
12 </path> | |
13 | |
14 <target name="init"> | |
15 <mkdir dir="bin"/> | |
16 <mkdir dir="dist"/> | |
17 <available file="servlet/src" property="has.servlet.src"/> | |
18 <available file="client/digitallibrary" property="has.webapp.src"/> | |
19 </target> | |
20 | |
21 <target name="clean"> | |
22 <delete dir="bin"/> | |
23 </target> | |
24 | |
25 <target name="cleanall" depends="clean"> | |
26 <delete dir="client"/> | |
27 <delete dir="servlet"/> | |
28 </target> | |
29 | |
30 <target name="build" depends="pkg-servlet,move-servlet"/> | |
31 | |
32 <target name="dist" depends="build,copy-lib,pkg-webapp"/> | |
33 | |
34 <target name="dist-nolib" depends="build,pkg-webapp"/> | |
35 | |
36 <target depends="init,get-src" name="build-servlet"> | |
37 <echo message="${ant.project.name}: ${ant.file}"/> | |
38 <javac debug="true" debuglevel="${debuglevel}" destdir="bin" source="${source}" target="${target}"> | |
39 <src path="servlet/src"/> | |
40 <classpath refid="digilib.classpath"/> | |
41 </javac> | |
42 <!-- Create the time stamp --> | |
43 <tstamp/> | |
44 </target> | |
45 | |
46 <target name="pkg-servlet" depends="build-servlet"> | |
47 <!-- Put everything in ${build} into the jar file --> | |
48 <jar destfile="dist/DigilibServlet-${DSTAMP}.jar" basedir="bin" index="yes"/> | |
49 </target> | |
50 | |
51 <target name="move-servlet" depends="pkg-servlet,get-webapp"> | |
52 <!-- put the new jar file in the webapp --> | |
53 <copy file="dist/DigilibServlet-${DSTAMP}.jar" | |
54 tofile="client/digitallibrary/WEB-INF/lib/DigilibServlet.jar"/> | |
55 </target> | |
56 | |
57 <target name="copy-lib"> | |
58 <!-- copy all files in lib in the webapp --> | |
59 <copy todir="client/digitallibrary/WEB-INF/lib" includeemptydirs="false"> | |
60 <fileset dir="lib"/> | |
61 </copy> | |
62 </target> | |
63 | |
64 <target name="pkg-webapp" depends="get-webapp"> | |
65 <zip destfile="dist/digilib-${DSTAMP}.zip" basedir="client" /> | |
66 </target> | |
67 | |
68 <target name="get-all" depends="get-src,get-webapp"/> | |
69 | |
70 <target name="get-src" unless="has.servlet.src" | |
71 description="download fresh set of sources from CVS"> | |
72 <cvs cvsRoot=":pserver:anonymous@cvs.digilib.berlios.de:/cvsroot/digilib" | |
73 package="servlet/src" compression="true"/> | |
74 </target> | |
75 | |
76 <target name="get-webapp" unless="has.webapp.src" | |
77 description="download fresh webapp directory from CVS"> | |
78 <cvs cvsRoot=":pserver:anonymous@cvs.digilib.berlios.de:/cvsroot/digilib" | |
79 package="client/digitallibrary" compression="true"/> | |
80 </target> | |
81 | |
82 <!-- CVS update should not be needed, checkout is preferrable --> | |
83 <target name="update" depends="update-src,update-webapp"/> | |
84 | |
85 <target name="update-src" description="update sources from CVS" > | |
86 <cvs dest="servlet/src" command="update" compression="true"/> | |
87 </target> | |
88 | |
89 <target name="update-webapp" description="update webapp from CVS" > | |
90 <cvs dest="client/digitallibrary" command="update" compression="true"/> | |
91 </target> | |
92 </project> |