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