1 |
< |
<!-- build file for server --> |
2 |
< |
<project name="iscream-server" default="package"> |
1 |
> |
<!-- build file for i-scream DCMS server --> |
2 |
> |
<!-- $Id$ --> |
3 |
> |
|
4 |
> |
<project name="iscream-server" default="usage"> |
5 |
|
|
4 |
– |
<!-- |
5 |
– |
TODO: |
6 |
– |
build/jar util package |
7 |
– |
install target |
8 |
– |
cvs version build (including cleanup) |
9 |
– |
javadoc |
10 |
– |
sql table generation |
11 |
– |
--> |
12 |
– |
|
6 |
|
<!-- |
7 |
|
===================================================== |
8 |
|
Initialisation & Configuration |
19 |
|
|
20 |
|
<!-- |
21 |
|
===================================================== |
22 |
< |
Main targets (shortcuts essentially) |
22 |
> |
Usage |
23 |
|
===================================================== |
24 |
|
--> |
25 |
|
|
26 |
< |
<target name="fetch"> |
27 |
< |
<antcall target="getlibs"/> |
26 |
> |
<target name="usage"> |
27 |
> |
<echo> |
28 |
> |
|
29 |
> |
These are the targets supported by this ANT build script: |
30 |
> |
|
31 |
> |
fetch - fetch all the JAR library files |
32 |
> |
|
33 |
> |
idl - generate java source from IDL |
34 |
> |
build - compile all source code |
35 |
> |
package - generate JAR package and distributions |
36 |
> |
packageutil - generate UTIL JAR package |
37 |
> |
|
38 |
> |
cvsbuild - build from cvs tag |
39 |
> |
use -Drev=TAG switch to specify cvs tag |
40 |
> |
|
41 |
> |
javadoc - generate javadoc API |
42 |
> |
install - install server |
43 |
> |
use -Dprefix=/path/ switch to specify dest |
44 |
> |
run - run the server |
45 |
> |
|
46 |
> |
clean - clean all generated files |
47 |
> |
distclean - remove 'fetched' libraries + clean |
48 |
> |
|
49 |
> |
Recommend to run the following target order: |
50 |
> |
|
51 |
> |
fetch packageutil package javadoc install |
52 |
> |
</echo> |
53 |
|
</target> |
54 |
|
|
55 |
< |
<target name="idl"> |
56 |
< |
<antcall target="genidl"/> |
55 |
> |
<target name="help"> |
56 |
> |
<antcall target="usage"/> |
57 |
|
</target> |
58 |
|
|
41 |
– |
<target name="build"> |
42 |
– |
<antcall target="compile"/> |
43 |
– |
</target> |
44 |
– |
|
45 |
– |
<target name="package"> |
46 |
– |
<antcall target="makedist"/> |
47 |
– |
</target> |
48 |
– |
|
49 |
– |
<target name="run"> |
50 |
– |
<antcall target="runserver"/> |
51 |
– |
</target> |
52 |
– |
|
53 |
– |
<target name="clean"> |
54 |
– |
<antcall target="cleanup"/> |
55 |
– |
</target> |
56 |
– |
|
57 |
– |
<target name="distclean"> |
58 |
– |
<antcall target="fullcleanup"/> |
59 |
– |
</target> |
60 |
– |
|
59 |
|
<!-- |
60 |
|
===================================================== |
61 |
|
Fetch required libraries (not in dependency tree) |
63 |
|
--> |
64 |
|
|
65 |
|
<!-- this uses static names, which is messy --> |
66 |
< |
<!-- fullcleanup target has same problem --> |
67 |
< |
<target name="getlibs" depends="config"> |
66 |
> |
<!-- distclean target has same problem --> |
67 |
> |
<target name="fetch" depends="config"> |
68 |
|
<get |
69 |
< |
src="http://killigrew.ukc.ac.uk/crimson.jar" |
69 |
> |
src="${LIBURL}/crimson.jar" |
70 |
|
dest="${LIBDIR}/crimson.jar" |
71 |
|
verbose="true" usetimestamp="true" |
72 |
|
/> |
73 |
|
<get |
74 |
< |
src="http://killigrew.ukc.ac.uk/idl.jar" |
74 |
> |
src="${LIBURL}/idl.jar" |
75 |
|
dest="${LIBDIR}/idl.jar" |
76 |
|
verbose="true" usetimestamp="true" |
77 |
|
/> |
78 |
|
<get |
79 |
< |
src="http://killigrew.ukc.ac.uk/jacorb.jar" |
79 |
> |
src="${LIBURL}/jacorb.jar" |
80 |
|
dest="${LIBDIR}/jacorb.jar" |
81 |
|
verbose="true" usetimestamp="true" |
82 |
|
/> |
83 |
|
<get |
84 |
< |
src="http://killigrew.ukc.ac.uk/jaxp.jar" |
84 |
> |
src="${LIBURL}/jaxp.jar" |
85 |
|
dest="${LIBDIR}/jaxp.jar" |
86 |
|
verbose="true" usetimestamp="true" |
87 |
|
/> |
88 |
|
<get |
89 |
< |
src="http://killigrew.ukc.ac.uk/mm.mysql-2.0.4-bin.jar" |
89 |
> |
src="${LIBURL}/mm.mysql-2.0.4-bin.jar" |
90 |
|
dest="${LIBDIR}/mm.mysql-2.0.4-bin.jar" |
91 |
|
verbose="true" usetimestamp="true" |
92 |
|
/> |
100 |
|
--> |
101 |
|
|
102 |
|
<!-- generate java code from idl files --> |
103 |
< |
<target name="genidl" depends="config"> |
103 |
> |
<target name="idl" depends="config"> |
104 |
|
<echo message="Generating Java source from IDL"/> |
105 |
|
<java classname="${IDLPARSER}"> |
106 |
|
<arg line="-d ${IDLDIR} ${IDLFILE}"/> |
114 |
|
===================================================== |
115 |
|
--> |
116 |
|
|
117 |
< |
<target name="compileidl" depends="genidl"> |
117 |
> |
<target name="buildidl" depends="idl"> |
118 |
|
<javac |
119 |
|
srcdir="${IDLDIR}" |
120 |
|
destdir="${BUILDDIR}" |
126 |
|
/> |
127 |
|
</target> |
128 |
|
|
129 |
< |
<target name="compile" depends="compileidl"> |
129 |
> |
<target name="build" depends="buildidl"> |
130 |
|
<javac |
131 |
|
srcdir="${SOURCEROOT}" |
132 |
|
destdir="${BUILDDIR}" |
144 |
|
===================================================== |
145 |
|
--> |
146 |
|
|
147 |
< |
<target name="makejar" depends="compile"> |
147 |
> |
<target name="makejar" depends="build"> |
148 |
|
<echo file="${BUILDDIR}/MANIFEST_TMP" |
149 |
|
>Manifest-Version: 1.0 |
150 |
|
Created-By: www.i-scream.org.uk |
179 |
|
/> |
180 |
|
</target> |
181 |
|
|
182 |
< |
<target name="makedist" depends="maketardist, makezipdist"/> |
182 |
> |
<target name="package" depends="maketardist, makezipdist"/> |
183 |
|
|
184 |
|
<!-- |
185 |
|
===================================================== |
187 |
|
===================================================== |
188 |
|
--> |
189 |
|
|
190 |
< |
<target name="cleanup" depends="config"> |
190 |
> |
<target name="clean" depends="config"> |
191 |
|
<delete dir="${IDLDIR}/${ROOTPKG}"/> |
192 |
|
<delete dir="${BUILDDIR}/${ROOTPKG}"/> |
193 |
< |
<delete file="${BUILDDIR}/${SERVERJAR}"/> |
194 |
< |
<delete file="${BUILDDIR}/${TARFILE}"/> |
195 |
< |
<delete file="${BUILDDIR}/${TARGZFILE}"/> |
196 |
< |
<delete file="${BUILDDIR}/${ZIPFILE}"/> |
193 |
> |
<delete dir="${JDOCDIR}"/> |
194 |
> |
<delete dir="${CVSBUILDTEMP}"/> |
195 |
> |
<delete> |
196 |
> |
<fileset dir="${BUILDDIR}"> |
197 |
> |
<include name="${SERVERJAR}"/> |
198 |
> |
<include name="${UTILJAR}"/> |
199 |
> |
<include name="${ARCNAME}*${TAREXT}"/> |
200 |
> |
<include name="${ARCNAME}*${TARGZEXT}"/> |
201 |
> |
<include name="${ARCNAME}*${ZIPEXT}"/> |
202 |
> |
</fileset> |
203 |
> |
</delete> |
204 |
|
</target> |
205 |
|
|
206 |
< |
<target name="fullcleanup" depends="cleanup"> |
206 |
> |
<target name="distclean" depends="clean"> |
207 |
|
<!-- this is messy, we should only delete specific jars --> |
208 |
|
<delete> |
209 |
|
<fileset dir="${LIBDIR}" includes="*.jar"/> |
212 |
|
|
213 |
|
<!-- |
214 |
|
===================================================== |
215 |
< |
Running (not in dependency tree) |
215 |
> |
Running |
216 |
|
===================================================== |
217 |
|
--> |
218 |
|
|
219 |
< |
<!-- is this really the best way to do this? --> |
220 |
< |
<target name="runserver" depends="config"> |
219 |
> |
<!-- is this really the best way to do this? no... --> |
220 |
> |
<target name="run" depends="config"> |
221 |
|
<java classname="${MFMAINCLASS}" dir="${BUILDDIR}" fork="yes"> |
222 |
|
<arg line="-f ${RUNFILTERNAME}"/> |
223 |
|
<classpath path="${BUILDDIR}/${SERVERJAR}"/> |
224 |
|
</java> |
225 |
+ |
</target> |
226 |
+ |
|
227 |
+ |
<!-- |
228 |
+ |
===================================================== |
229 |
+ |
Javadoc |
230 |
+ |
===================================================== |
231 |
+ |
--> |
232 |
+ |
|
233 |
+ |
<target name="javadoc" depends="config, idl"> |
234 |
+ |
<mkdir dir="${JDOCDIR}"/> |
235 |
+ |
<!-- link in here requires a live net link! --> |
236 |
+ |
<javadoc |
237 |
+ |
packagenames="${JDOCPKGS}" |
238 |
+ |
destdir="${JDOCDIR}" |
239 |
+ |
classpath="${JCCLASSPATH}" |
240 |
+ |
author="true" |
241 |
+ |
version="true" |
242 |
+ |
private="true" |
243 |
+ |
use="true" |
244 |
+ |
windowtitle="${JDOCTITLE}" |
245 |
+ |
header="${JDOCHEADER}" |
246 |
+ |
bottom="${JDOCBOTTOM}" |
247 |
+ |
link="${JDOCJAPI}" |
248 |
+ |
> |
249 |
+ |
<!-- need to do idl generated source too --> |
250 |
+ |
<sourcepath> |
251 |
+ |
<pathelement path="${SOURCEROOT}"/> |
252 |
+ |
<pathelement path="${IDLDIR}"/> |
253 |
+ |
</sourcepath> |
254 |
+ |
</javadoc> |
255 |
+ |
</target> |
256 |
+ |
|
257 |
+ |
<!-- |
258 |
+ |
===================================================== |
259 |
+ |
Util Package |
260 |
+ |
===================================================== |
261 |
+ |
--> |
262 |
+ |
|
263 |
+ |
<!-- MUST clean here to ensure util package is tidy --> |
264 |
+ |
<target name="buildutil" depends="config, clean"> |
265 |
+ |
<javac |
266 |
+ |
srcdir="${SOURCEROOT}" |
267 |
+ |
destdir="${BUILDDIR}" |
268 |
+ |
classpath="${JCCLASSPATH}" |
269 |
+ |
includes="${UTILSRC}" |
270 |
+ |
debug="${JCDEBUG}" |
271 |
+ |
optimize="${JCOPTIM}" |
272 |
+ |
deprecation="${JCDEPRE}" |
273 |
+ |
/> |
274 |
+ |
</target> |
275 |
+ |
|
276 |
+ |
<target name="packageutil" depends="buildutil"> |
277 |
+ |
<jar |
278 |
+ |
jarfile="${BUILDDIR}/${UTILJAR}" |
279 |
+ |
basedir="${BUILDDIR}" |
280 |
+ |
includes="uk/**/*.class" |
281 |
+ |
/> |
282 |
+ |
</target> |
283 |
+ |
|
284 |
+ |
<!-- |
285 |
+ |
===================================================== |
286 |
+ |
Install |
287 |
+ |
===================================================== |
288 |
+ |
--> |
289 |
+ |
|
290 |
+ |
<target name="install" depends="config, makejar"> |
291 |
+ |
<mkdir dir="${INSTALLDEST}"/> |
292 |
+ |
<mkdir dir="${INSTALLDEST}/etc"/> |
293 |
+ |
<mkdir dir="${INSTALLDEST}/lib"/> |
294 |
+ |
<copy file="${BUILDDIR}/${SERVERJAR}" todir="${INSTALLDEST}"/> |
295 |
+ |
<copy file="${BUILDDIR}/run.sh" todir="${INSTALLDEST}"/> |
296 |
+ |
<copy file="${BUILDDIR}/run.bat" todir="${INSTALLDEST}"/> |
297 |
+ |
<copy todir="${INSTALLDEST}/lib" > |
298 |
+ |
<fileset dir="${LIBDIR}"> |
299 |
+ |
<include name="**/*.jar"/> |
300 |
+ |
<exclude name="**/CVS/*"/> |
301 |
+ |
</fileset> |
302 |
+ |
</copy> |
303 |
+ |
<copy todir="${INSTALLDEST}/etc" > |
304 |
+ |
<fileset dir="${BUILDDIR}/etc"> |
305 |
+ |
<include name="**/*"/> |
306 |
+ |
<exclude name="**/CVS/*"/> |
307 |
+ |
</fileset> |
308 |
+ |
</copy> |
309 |
+ |
<copy file="${BUILDDIR}/README" todir="${INSTALLDEST}"/> |
310 |
+ |
</target> |
311 |
+ |
|
312 |
+ |
<!-- |
313 |
+ |
===================================================== |
314 |
+ |
CVS Build |
315 |
+ |
===================================================== |
316 |
+ |
--> |
317 |
+ |
|
318 |
+ |
<target name="cvsbuild" depends="config"> |
319 |
+ |
<mkdir dir="${CVSBUILDTEMP}"/> |
320 |
+ |
<cvs |
321 |
+ |
cvsRoot="${CVSROOT}" |
322 |
+ |
command="export -d ${CVSBUILDTEMP}" |
323 |
+ |
tag="${REVISION}" |
324 |
+ |
package="${CVSMODULE}" |
325 |
+ |
/> |
326 |
+ |
<!-- it would be IDEAL to use the ant target here. |
327 |
+ |
BUT, it would need to use it's OWN properties. |
328 |
+ |
exec is a poor substitute. |
329 |
+ |
no idea about windows compatibility. --> |
330 |
+ |
<exec executable="ant" dir="${CVSBUILDTEMP}"> |
331 |
+ |
<arg value="fetch"/> |
332 |
+ |
</exec> |
333 |
+ |
<exec executable="ant" dir="${CVSBUILDTEMP}"> |
334 |
+ |
<arg value="packageutil"/> |
335 |
+ |
</exec> |
336 |
+ |
<exec executable="ant" dir="${CVSBUILDTEMP}"> |
337 |
+ |
<arg value="package"/> |
338 |
+ |
</exec> |
339 |
+ |
<copy file="${CVSBUILDTEMP}/build/${TARGZFILE}" |
340 |
+ |
tofile="${BUILDDIR}/${ARCNAME}-${REVISION}${TARGZEXT}"/> |
341 |
+ |
<copy file="${CVSBUILDTEMP}/build/${ZIPFILE}" |
342 |
+ |
tofile="${BUILDDIR}/${ARCNAME}-${REVISION}${ZIPEXT}"/> |
343 |
+ |
<!-- should we be overwriting any old util jar here? --> |
344 |
+ |
<copy file="${CVSBUILDTEMP}/build/${UTILJAR}" todir="${BUILDDIR}"/> |
345 |
|
</target> |
346 |
|
|
347 |
|
</project> |