1 |
<!-- build file for server --> |
2 |
<project name="iscream-server" default="usage"> |
3 |
|
4 |
<!-- |
5 |
TODO: |
6 |
install target |
7 |
cvs version build (including cleanup) |
8 |
--> |
9 |
|
10 |
<!-- |
11 |
===================================================== |
12 |
Initialisation & Configuration |
13 |
===================================================== |
14 |
--> |
15 |
|
16 |
<property name="SOURCEROOT" value="${basedir}"/> |
17 |
<property name="CONFIGFILE" value="build.config"/> |
18 |
|
19 |
<target name="config"> |
20 |
<echo message="Reading build configuration"/> |
21 |
<property file="${CONFIGFILE}"/> |
22 |
</target> |
23 |
|
24 |
<!-- |
25 |
===================================================== |
26 |
Usage |
27 |
===================================================== |
28 |
--> |
29 |
|
30 |
<target name="usage"> |
31 |
<echo> |
32 |
|
33 |
These are the targets supported by this ANT build script: |
34 |
|
35 |
fetch - fetch all the JAR library files |
36 |
idl - generate java source from IDL |
37 |
build - compile all source code |
38 |
package - generate JAR package and distributions |
39 |
packageutil - generate UTIL JAR package |
40 |
javadoc - generate javadoc API |
41 |
clean - clean all generated files |
42 |
distclean - remove 'fetched' libraries + clean |
43 |
run - run the server |
44 |
</echo> |
45 |
</target> |
46 |
|
47 |
<target name="help"> |
48 |
<antcall target="usage"/> |
49 |
</target> |
50 |
|
51 |
<!-- |
52 |
===================================================== |
53 |
Fetch required libraries (not in dependency tree) |
54 |
===================================================== |
55 |
--> |
56 |
|
57 |
<!-- this uses static names, which is messy --> |
58 |
<!-- fullcleanup target has same problem --> |
59 |
<target name="fetch" depends="config"> |
60 |
<get |
61 |
src="${LIBURL}/crimson.jar" |
62 |
dest="${LIBDIR}/crimson.jar" |
63 |
verbose="true" usetimestamp="true" |
64 |
/> |
65 |
<get |
66 |
src="${LIBURL}/idl.jar" |
67 |
dest="${LIBDIR}/idl.jar" |
68 |
verbose="true" usetimestamp="true" |
69 |
/> |
70 |
<get |
71 |
src="${LIBURL}/jacorb.jar" |
72 |
dest="${LIBDIR}/jacorb.jar" |
73 |
verbose="true" usetimestamp="true" |
74 |
/> |
75 |
<get |
76 |
src="${LIBURL}/jaxp.jar" |
77 |
dest="${LIBDIR}/jaxp.jar" |
78 |
verbose="true" usetimestamp="true" |
79 |
/> |
80 |
<get |
81 |
src="${LIBURL}/mm.mysql-2.0.4-bin.jar" |
82 |
dest="${LIBDIR}/mm.mysql-2.0.4-bin.jar" |
83 |
verbose="true" usetimestamp="true" |
84 |
/> |
85 |
<!-- also get jacorb.properties? --> |
86 |
</target> |
87 |
|
88 |
<!-- |
89 |
===================================================== |
90 |
IDL Generation |
91 |
===================================================== |
92 |
--> |
93 |
|
94 |
<!-- generate java code from idl files --> |
95 |
<target name="idl" depends="config"> |
96 |
<echo message="Generating Java source from IDL"/> |
97 |
<java classname="${IDLPARSER}"> |
98 |
<arg line="-d ${IDLDIR} ${IDLFILE}"/> |
99 |
<classpath path="${IDLPARSERJAR}"/> |
100 |
</java> |
101 |
</target> |
102 |
|
103 |
<!-- |
104 |
===================================================== |
105 |
Source code compilation (including idl-generated) |
106 |
===================================================== |
107 |
--> |
108 |
|
109 |
<target name="buildidl" depends="idl"> |
110 |
<javac |
111 |
srcdir="${IDLDIR}" |
112 |
destdir="${BUILDDIR}" |
113 |
classpath="${JCCLASSPATH}" |
114 |
includes="uk/**/*.java" |
115 |
debug="${JCDEBUG}" |
116 |
optimize="${JCOPTIM}" |
117 |
deprecation="${JCDEPRE}" |
118 |
/> |
119 |
</target> |
120 |
|
121 |
<target name="build" depends="buildidl"> |
122 |
<javac |
123 |
srcdir="${SOURCEROOT}" |
124 |
destdir="${BUILDDIR}" |
125 |
classpath="${JCCLASSPATH}" |
126 |
includes="uk/**/*.java" |
127 |
debug="${JCDEBUG}" |
128 |
optimize="${JCOPTIM}" |
129 |
deprecation="${JCDEPRE}" |
130 |
/> |
131 |
</target> |
132 |
|
133 |
<!-- |
134 |
===================================================== |
135 |
Package creation |
136 |
===================================================== |
137 |
--> |
138 |
|
139 |
<target name="makejar" depends="build"> |
140 |
<echo file="${BUILDDIR}/MANIFEST_TMP" |
141 |
>Manifest-Version: 1.0 |
142 |
Created-By: www.i-scream.org.uk |
143 |
Main-Class: ${MFMAINCLASS} |
144 |
Class-Path: ${MFCLPATH} |
145 |
</echo> |
146 |
<jar |
147 |
jarfile="${BUILDDIR}/${SERVERJAR}" |
148 |
basedir="${BUILDDIR}" |
149 |
includes="uk/**/*.class" |
150 |
manifest="${BUILDDIR}/MANIFEST_TMP" |
151 |
/> |
152 |
<delete file="${BUILDDIR}/MANIFEST_TMP"/> |
153 |
</target> |
154 |
|
155 |
<target name="maketardist" depends="makejar"> |
156 |
<tar |
157 |
longfile="fail" |
158 |
basedir="${BUILDDIR}" |
159 |
tarfile="${BUILDDIR}/${TARFILE}" |
160 |
includes="${SERVERJAR}, run.sh, lib/**, etc/**, README" |
161 |
/> |
162 |
<gzip src="${BUILDDIR}/${TARFILE}" zipfile="${BUILDDIR}/${TARGZFILE}"/> |
163 |
<delete file="${BUILDDIR}/${TARFILE}"/> |
164 |
</target> |
165 |
|
166 |
<target name="makezipdist" depends="makejar"> |
167 |
<zip |
168 |
basedir="${BUILDDIR}" |
169 |
zipfile="${BUILDDIR}/${ZIPFILE}" |
170 |
includes="${SERVERJAR}, run.bat, lib/**, etc/**, README" |
171 |
/> |
172 |
</target> |
173 |
|
174 |
<target name="package" depends="maketardist, makezipdist"/> |
175 |
|
176 |
<!-- |
177 |
===================================================== |
178 |
Cleaning |
179 |
===================================================== |
180 |
--> |
181 |
|
182 |
<target name="clean" depends="config"> |
183 |
<delete dir="${IDLDIR}/${ROOTPKG}"/> |
184 |
<delete dir="${BUILDDIR}/${ROOTPKG}"/> |
185 |
<delete file="${BUILDDIR}/${SERVERJAR}"/> |
186 |
<delete file="${BUILDDIR}/${UTILJAR}"/> |
187 |
<delete file="${BUILDDIR}/${TARFILE}"/> |
188 |
<delete file="${BUILDDIR}/${TARGZFILE}"/> |
189 |
<delete file="${BUILDDIR}/${ZIPFILE}"/> |
190 |
<delete dir="${JDOCDIR}"/> |
191 |
</target> |
192 |
|
193 |
<target name="distclean" depends="clean"> |
194 |
<!-- this is messy, we should only delete specific jars --> |
195 |
<delete> |
196 |
<fileset dir="${LIBDIR}" includes="*.jar"/> |
197 |
</delete> |
198 |
</target> |
199 |
|
200 |
<!-- |
201 |
===================================================== |
202 |
Running |
203 |
===================================================== |
204 |
--> |
205 |
|
206 |
<!-- is this really the best way to do this? no... --> |
207 |
<target name="run" depends="config"> |
208 |
<java classname="${MFMAINCLASS}" dir="${BUILDDIR}" fork="yes"> |
209 |
<arg line="-f ${RUNFILTERNAME}"/> |
210 |
<classpath path="${BUILDDIR}/${SERVERJAR}"/> |
211 |
</java> |
212 |
</target> |
213 |
|
214 |
<!-- |
215 |
===================================================== |
216 |
Javadoc |
217 |
===================================================== |
218 |
--> |
219 |
|
220 |
<target name="javadoc" depends="config, idl"> |
221 |
<mkdir dir="${JDOCDIR}"/> |
222 |
<!-- link in here requires a live net link! --> |
223 |
<javadoc |
224 |
packagenames="${JDOCPKGS}" |
225 |
destdir="${JDOCDIR}" |
226 |
classpath="${JCCLASSPATH}" |
227 |
author="true" |
228 |
version="true" |
229 |
private="true" |
230 |
use="true" |
231 |
windowtitle="${JDOCTITLE}" |
232 |
header="${JDOCHEADER}" |
233 |
bottom="${JDOCBOTTOM}" |
234 |
link="${JDOCJAPI}" |
235 |
> |
236 |
<!-- need to do idl generated source too --> |
237 |
<sourcepath> |
238 |
<pathelement path="${SOURCEROOT}"/> |
239 |
<pathelement path="${IDLDIR}"/> |
240 |
</sourcepath> |
241 |
</javadoc> |
242 |
</target> |
243 |
|
244 |
<!-- |
245 |
===================================================== |
246 |
Util Package |
247 |
===================================================== |
248 |
--> |
249 |
|
250 |
<!-- MUST clean here to ensure util package is tidy --> |
251 |
<target name="buildutil" depends="config, clean"> |
252 |
<javac |
253 |
srcdir="${SOURCEROOT}" |
254 |
destdir="${BUILDDIR}" |
255 |
classpath="${JCCLASSPATH}" |
256 |
includes="${UTILSRC}" |
257 |
debug="${JCDEBUG}" |
258 |
optimize="${JCOPTIM}" |
259 |
deprecation="${JCDEPRE}" |
260 |
/> |
261 |
</target> |
262 |
|
263 |
<target name="packageutil" depends="buildutil"> |
264 |
<jar |
265 |
jarfile="${BUILDDIR}/${UTILJAR}" |
266 |
basedir="${BUILDDIR}" |
267 |
includes="uk/**/*.class" |
268 |
/> |
269 |
</target> |
270 |
|
271 |
</project> |