1 |
|
<!-- build file for server --> |
2 |
< |
<project name="iscream-server" default="package"> |
2 |
> |
<project name="iscream-server" default="usage"> |
3 |
|
|
4 |
|
<!-- |
5 |
< |
TODO: |
6 |
< |
build/jar util package |
7 |
< |
install target |
8 |
< |
cvs version build (including cleanup) |
9 |
< |
javadoc |
10 |
< |
sql table generation |
11 |
< |
run target |
12 |
< |
distclean target |
5 |
> |
TODO: cvs version build (including cleanup) |
6 |
|
--> |
7 |
|
|
8 |
|
<!-- |
21 |
|
|
22 |
|
<!-- |
23 |
|
===================================================== |
24 |
< |
Main targets (shortcuts essentially) |
24 |
> |
Usage |
25 |
|
===================================================== |
26 |
|
--> |
27 |
|
|
28 |
< |
<target name="idl"> |
29 |
< |
<antcall target="genidl"/> |
28 |
> |
<target name="usage"> |
29 |
> |
<echo> |
30 |
> |
|
31 |
> |
These are the targets supported by this ANT build script: |
32 |
> |
|
33 |
> |
fetch - fetch all the JAR library files |
34 |
> |
idl - generate java source from IDL |
35 |
> |
build - compile all source code |
36 |
> |
package - generate JAR package and distributions |
37 |
> |
packageutil - generate UTIL JAR package |
38 |
> |
javadoc - generate javadoc API |
39 |
> |
clean - clean all generated files |
40 |
> |
distclean - remove 'fetched' libraries + clean |
41 |
> |
install - install server (use -Dprefix=/path/ switch) |
42 |
> |
run - run the server |
43 |
> |
</echo> |
44 |
|
</target> |
45 |
|
|
46 |
< |
<target name="build"> |
47 |
< |
<antcall target="compile"/> |
46 |
> |
<target name="help"> |
47 |
> |
<antcall target="usage"/> |
48 |
|
</target> |
49 |
|
|
50 |
< |
<target name="package"> |
51 |
< |
<antcall target="makedist"/> |
52 |
< |
</target> |
50 |
> |
<!-- |
51 |
> |
===================================================== |
52 |
> |
Fetch required libraries (not in dependency tree) |
53 |
> |
===================================================== |
54 |
> |
--> |
55 |
|
|
56 |
< |
<target name="clean"> |
57 |
< |
<antcall target="cleanup"/> |
56 |
> |
<!-- this uses static names, which is messy --> |
57 |
> |
<!-- fullcleanup target has same problem --> |
58 |
> |
<target name="fetch" depends="config"> |
59 |
> |
<get |
60 |
> |
src="${LIBURL}/crimson.jar" |
61 |
> |
dest="${LIBDIR}/crimson.jar" |
62 |
> |
verbose="true" usetimestamp="true" |
63 |
> |
/> |
64 |
> |
<get |
65 |
> |
src="${LIBURL}/idl.jar" |
66 |
> |
dest="${LIBDIR}/idl.jar" |
67 |
> |
verbose="true" usetimestamp="true" |
68 |
> |
/> |
69 |
> |
<get |
70 |
> |
src="${LIBURL}/jacorb.jar" |
71 |
> |
dest="${LIBDIR}/jacorb.jar" |
72 |
> |
verbose="true" usetimestamp="true" |
73 |
> |
/> |
74 |
> |
<get |
75 |
> |
src="${LIBURL}/jaxp.jar" |
76 |
> |
dest="${LIBDIR}/jaxp.jar" |
77 |
> |
verbose="true" usetimestamp="true" |
78 |
> |
/> |
79 |
> |
<get |
80 |
> |
src="${LIBURL}/mm.mysql-2.0.4-bin.jar" |
81 |
> |
dest="${LIBDIR}/mm.mysql-2.0.4-bin.jar" |
82 |
> |
verbose="true" usetimestamp="true" |
83 |
> |
/> |
84 |
> |
<!-- also get jacorb.properties? --> |
85 |
|
</target> |
86 |
|
|
87 |
|
<!-- |
91 |
|
--> |
92 |
|
|
93 |
|
<!-- generate java code from idl files --> |
94 |
< |
<target name="genidl" depends="config"> |
94 |
> |
<target name="idl" depends="config"> |
95 |
|
<echo message="Generating Java source from IDL"/> |
96 |
|
<java classname="${IDLPARSER}"> |
97 |
|
<arg line="-d ${IDLDIR} ${IDLFILE}"/> |
105 |
|
===================================================== |
106 |
|
--> |
107 |
|
|
108 |
< |
<target name="compileidl" depends="genidl"> |
108 |
> |
<target name="buildidl" depends="idl"> |
109 |
|
<javac |
110 |
|
srcdir="${IDLDIR}" |
111 |
|
destdir="${BUILDDIR}" |
117 |
|
/> |
118 |
|
</target> |
119 |
|
|
120 |
< |
<target name="compile" depends="compileidl"> |
120 |
> |
<target name="build" depends="buildidl"> |
121 |
|
<javac |
122 |
|
srcdir="${SOURCEROOT}" |
123 |
|
destdir="${BUILDDIR}" |
135 |
|
===================================================== |
136 |
|
--> |
137 |
|
|
138 |
< |
<target name="makejar" depends="compile"> |
138 |
> |
<target name="makejar" depends="build"> |
139 |
|
<echo file="${BUILDDIR}/MANIFEST_TMP" |
140 |
|
>Manifest-Version: 1.0 |
141 |
|
Created-By: www.i-scream.org.uk |
170 |
|
/> |
171 |
|
</target> |
172 |
|
|
173 |
< |
<target name="makedist" depends="maketardist, makezipdist"/> |
173 |
> |
<target name="package" depends="maketardist, makezipdist"/> |
174 |
|
|
175 |
|
<!-- |
176 |
|
===================================================== |
178 |
|
===================================================== |
179 |
|
--> |
180 |
|
|
181 |
< |
<target name="cleanup" depends="config"> |
181 |
> |
<target name="clean" depends="config"> |
182 |
|
<delete dir="${IDLDIR}/${ROOTPKG}"/> |
183 |
|
<delete dir="${BUILDDIR}/${ROOTPKG}"/> |
184 |
|
<delete file="${BUILDDIR}/${SERVERJAR}"/> |
185 |
+ |
<delete file="${BUILDDIR}/${UTILJAR}"/> |
186 |
|
<delete file="${BUILDDIR}/${TARFILE}"/> |
187 |
|
<delete file="${BUILDDIR}/${TARGZFILE}"/> |
188 |
|
<delete file="${BUILDDIR}/${ZIPFILE}"/> |
189 |
+ |
<delete dir="${JDOCDIR}"/> |
190 |
+ |
</target> |
191 |
+ |
|
192 |
+ |
<target name="distclean" depends="clean"> |
193 |
+ |
<!-- this is messy, we should only delete specific jars --> |
194 |
+ |
<delete> |
195 |
+ |
<fileset dir="${LIBDIR}" includes="*.jar"/> |
196 |
+ |
</delete> |
197 |
+ |
</target> |
198 |
+ |
|
199 |
+ |
<!-- |
200 |
+ |
===================================================== |
201 |
+ |
Running |
202 |
+ |
===================================================== |
203 |
+ |
--> |
204 |
+ |
|
205 |
+ |
<!-- is this really the best way to do this? no... --> |
206 |
+ |
<target name="run" depends="config"> |
207 |
+ |
<java classname="${MFMAINCLASS}" dir="${BUILDDIR}" fork="yes"> |
208 |
+ |
<arg line="-f ${RUNFILTERNAME}"/> |
209 |
+ |
<classpath path="${BUILDDIR}/${SERVERJAR}"/> |
210 |
+ |
</java> |
211 |
+ |
</target> |
212 |
+ |
|
213 |
+ |
<!-- |
214 |
+ |
===================================================== |
215 |
+ |
Javadoc |
216 |
+ |
===================================================== |
217 |
+ |
--> |
218 |
+ |
|
219 |
+ |
<target name="javadoc" depends="config, idl"> |
220 |
+ |
<mkdir dir="${JDOCDIR}"/> |
221 |
+ |
<!-- link in here requires a live net link! --> |
222 |
+ |
<javadoc |
223 |
+ |
packagenames="${JDOCPKGS}" |
224 |
+ |
destdir="${JDOCDIR}" |
225 |
+ |
classpath="${JCCLASSPATH}" |
226 |
+ |
author="true" |
227 |
+ |
version="true" |
228 |
+ |
private="true" |
229 |
+ |
use="true" |
230 |
+ |
windowtitle="${JDOCTITLE}" |
231 |
+ |
header="${JDOCHEADER}" |
232 |
+ |
bottom="${JDOCBOTTOM}" |
233 |
+ |
link="${JDOCJAPI}" |
234 |
+ |
> |
235 |
+ |
<!-- need to do idl generated source too --> |
236 |
+ |
<sourcepath> |
237 |
+ |
<pathelement path="${SOURCEROOT}"/> |
238 |
+ |
<pathelement path="${IDLDIR}"/> |
239 |
+ |
</sourcepath> |
240 |
+ |
</javadoc> |
241 |
+ |
</target> |
242 |
+ |
|
243 |
+ |
<!-- |
244 |
+ |
===================================================== |
245 |
+ |
Util Package |
246 |
+ |
===================================================== |
247 |
+ |
--> |
248 |
+ |
|
249 |
+ |
<!-- MUST clean here to ensure util package is tidy --> |
250 |
+ |
<target name="buildutil" depends="config, clean"> |
251 |
+ |
<javac |
252 |
+ |
srcdir="${SOURCEROOT}" |
253 |
+ |
destdir="${BUILDDIR}" |
254 |
+ |
classpath="${JCCLASSPATH}" |
255 |
+ |
includes="${UTILSRC}" |
256 |
+ |
debug="${JCDEBUG}" |
257 |
+ |
optimize="${JCOPTIM}" |
258 |
+ |
deprecation="${JCDEPRE}" |
259 |
+ |
/> |
260 |
+ |
</target> |
261 |
+ |
|
262 |
+ |
<target name="packageutil" depends="buildutil"> |
263 |
+ |
<jar |
264 |
+ |
jarfile="${BUILDDIR}/${UTILJAR}" |
265 |
+ |
basedir="${BUILDDIR}" |
266 |
+ |
includes="uk/**/*.class" |
267 |
+ |
/> |
268 |
+ |
</target> |
269 |
+ |
|
270 |
+ |
<!-- |
271 |
+ |
===================================================== |
272 |
+ |
Install |
273 |
+ |
===================================================== |
274 |
+ |
--> |
275 |
+ |
|
276 |
+ |
<target name="install" depends="config, makejar"> |
277 |
+ |
<mkdir dir="${INSTALLDEST}"/> |
278 |
+ |
<mkdir dir="${INSTALLDEST}/etc"/> |
279 |
+ |
<mkdir dir="${INSTALLDEST}/lib"/> |
280 |
+ |
<copy file="${BUILDDIR}/${SERVERJAR}" todir="${INSTALLDEST}"/> |
281 |
+ |
<copy file="${BUILDDIR}/run.sh" todir="${INSTALLDEST}"/> |
282 |
+ |
<copy file="${BUILDDIR}/run.bat" todir="${INSTALLDEST}"/> |
283 |
+ |
<copy todir="${INSTALLDEST}/lib" > |
284 |
+ |
<fileset dir="${LIBDIR}"> |
285 |
+ |
<include name="**/*.jar"/> |
286 |
+ |
<exclude name="**/CVS/*"/> |
287 |
+ |
</fileset> |
288 |
+ |
</copy> |
289 |
+ |
<copy todir="${INSTALLDEST}/etc" > |
290 |
+ |
<fileset dir="${BUILDDIR}/etc"> |
291 |
+ |
<include name="**/*"/> |
292 |
+ |
<exclude name="**/CVS/*"/> |
293 |
+ |
</fileset> |
294 |
+ |
</copy> |
295 |
+ |
<copy file="${BUILDDIR}/README" todir="${INSTALLDEST}"/> |
296 |
|
</target> |
297 |
|
|
298 |
|
</project> |