forked from scottbell/biosim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
429 lines (409 loc) · 17.3 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
<project name="BioSim" default="build" basedir=".">
<description> Build file for BioSim by Scott Bell</description>
<!-- set global properties for this build -->
<property name="src" location="src" />
<property name="doc" location="doc" />
<property name="buildDir" location="build" />
<property name="lib" location="lib" />
<property name="jacorbDir" location="${lib}/jacorb" />
<property name="tmpDir" location="tmp" />
<property name="nsDir" location="${tmpDir}/ns" />
<property name="resourceDir" location="resources" />
<property name="stubsDir" location="stubs" />
<property name="test.dir" location="test" />
<!-- set server properties for this build -->
<property name="log4jDir" location="${lib}/log4j" />
<!-- set client properties for this build -->
<property name="plotDir" location="${lib}/jfreechart" />
<!-- set dist properties for this build -->
<property name="distDir" location="dist" />
<property name="distTmpDir" location="${distDir}/tmp" />
<!-- set jnlp dist properties for this build -->
<property name="jnlpDistDir" location="${distDir}/jnlp" />
<property name="jnlpDistLibDir" location="${lib}/dist/jnlp" />
<property name="jnlpDistTmpDir" location="${tmpDir}/jnlp" />
<!-- set javadoc properties for this build -->
<property name="javadocDir" location="${doc}/javadoc" />
<!-- set users manual properties for this build -->
<property name="manualDir" location="${doc}/users_manual_files" />
<property name="manualTmpDir" location="${tmpDir}/users_manual" />
<target name="init-build">
<mkdir dir="${buildDir}" />
</target>
<target name="init-dist">
<mkdir dir="${distDir}" />
</target>
<target name="init-tmp">
<mkdir dir="${tmpDir}" />
</target>
<target name="stub-idl" depends="init-build,init-tmp"
description="stub the IDL file">
<mkdir dir="${stubsDir}" />
<echo message="Stubbing the IDL file" />
<java classname="org.jacorb.idl.parser" failonerror="yes">
<arg value="-d" />
<arg file="${stubsDir}" />
<arg file="${src}/com/traclabs/biosim/idl/biosim.idl" />
<classpath>
<pathelement location="${jacorbDir}/idl.jar" />
<pathelement location="${jacorbDir}/logkit.jar" />
</classpath>
</java>
</target>
<target name="compile-stubs" depends="init-build,init-tmp"
description="compiles the IDL stubs">
<echo message="Compiling stubs" />
<javac target="1.6" source="1.6" srcdir="${stubsDir}" destdir="${buildDir}" fork="yes"
memoryMaximumSize="256m" nowarn="yes" debug="on">
<classpath>
<pathelement location="${jacorbDir}/jacorb.jar" />
</classpath>
</javac>
</target>
<target name="stub-and-compile-idl" depends="stub-idl,compile-stubs"
description="stub the IDL file">
</target>
<target name="build-server" depends="stub-and-compile-idl,build-util"
description="compile the server">
<echo message="Compling the server" />
<javac target="1.6" source="1.6" srcdir="${src}/com/traclabs/biosim/server" destdir="${buildDir}"
nowarn="yes" failonerror="yes" debug="on">
<classpath>
<pathelement location="${src}" />
<pathelement location="${buildDir}" />
<pathelement location="${log4jDir}/log4j.jar" />
<pathelement location="${jacorbDir}/jacorb.jar" />
<pathelement location="${jacorbDir}/avalon-framework.jar" />
</classpath>
</javac>
</target>
<target name="build-framework" depends="build-server"
description="compile the framework">
<echo message="Compling the framework" />
<javac target="1.6" source="1.6" srcdir="${src}/com/traclabs/biosim/framework" destdir="${buildDir}"
nowarn="yes" failonerror="yes" debug="on">
<classpath>
<pathelement location="${src}" />
<pathelement location="${buildDir}" />
<pathelement location="${log4jDir}/log4j.jar" />
<pathelement location="${jacorbDir}/jacorb.jar" />
<pathelement location="${jacorbDir}/avalon-framework.jar" />
</classpath>
</javac>
</target>
<target name="build-util" depends="" description="compile the util">
<echo message="Compling the util" />
<javac target="1.6" source="1.6" srcdir="${src}/com/traclabs/biosim/util" destdir="${buildDir}"
nowarn="yes" failonerror="yes" debug="on">
<classpath>
<pathelement location="${src}" />
<pathelement location="${buildDir}" />
<pathelement location="${log4jDir}/log4j.jar" />
<pathelement location="${jacorbDir}/jacorb.jar" />
<pathelement location="${jacorbDir}/avalon-framework.jar" />
</classpath>
</javac>
</target>
<target name="build-client" depends="stub-and-compile-idl"
description="compile the client">
<echo message="Compling the client" />
<javac target="1.6" source="1.6" srcdir="${src}/com/traclabs/biosim/client" destdir="${buildDir}"
nowarn="yes" failonerror="yes" debug="on">
<classpath>
<pathelement location="${src}" />
<pathelement location="${buildDir}" />
<pathelement location="${jacorbDir}/jacorb.jar" />
<pathelement location="${jacorbDir}/avalon-framework.jar" />
<pathelement location="${log4jDir}/log4j.jar" />
<pathelement location="${plotDir}/jcommon.jar" />
<pathelement location="${plotDir}/jfreechart.jar" />
<pathelement location="${lib}/ptolemy/plot.jar" />
</classpath>
</javac>
</target>
<target name="build-dist" depends="build-server,build-client,init-dist"
description="creates dist">
<mkdir dir="${distDir}" />
<mkdir dir="${distTmpDir}" />
<echo message="Creating biosim jar for general distribution" />
<jar destfile="${distDir}/biosim.jar">
<fileset dir="${buildDir}"
includes="com/traclabs/biosim/server/**, com/traclabs/biosim/util/**, com/traclabs/biosim/idl/**, com/traclabs/biosim/client/**" />
<fileset dir="${resourceDir}"
includes="com/traclabs/biosim/server/**, com/traclabs/biosim/util/**, com/traclabs/biosim/idl/**"
excludes="com/traclabs/biosim/server/framework/configuration/**/**.xml, com/traclabs/biosim/server/framework/schema/**/**.xsd" />
<fileset dir="${distTmpDir}">
<exclude name="META-INF" />
<exclude name="license-INF" />
</fileset>
</jar>
</target>
<target name="build-client-dist" depends="build-server,build-client,init-dist"
description="creates dist">
<mkdir dir="${distDir}" />
<mkdir dir="${distTmpDir}" />
<echo message="Unpacking libraries" />
<unzip dest="${distTmpDir}">
<fileset file="${jacorbDir}/jacorb.jar" />
<fileset file="${jacorbDir}/logkit.jar" />
<fileset file="${jacorbDir}/avalon-framework.jar" />
</unzip>
<echo message="Creating biosim jar for client distribution" />
<jar destfile="${distDir}/biosim.jar">
<fileset dir="${buildDir}"
includes="com/traclabs/biosim/util/**, com/traclabs/biosim/idl/**, com/traclabs/biosim/client/util/**" />
<fileset dir="${resourceDir}"
includes="com/traclabs/biosim/server/**, com/traclabs/biosim/util/**, com/traclabs/biosim/idl/**" />
<fileset dir="${distTmpDir}">
<exclude name="META-INF" />
<exclude name="license-INF" />
</fileset>
</jar>
</target>
<target name="build-stubs-dist" depends="build-server,build-client,init-dist"
description="creates dist">
<mkdir dir="${distDir}" />
<mkdir dir="${distTmpDir}" />
<echo message="Creating biosim.jar for stub distribution" />
<jar destfile="${distDir}/biosim.jar">
<fileset dir="${buildDir}" includes="com/traclabs/biosim/idl/**" />
<fileset dir="${distTmpDir}">
<exclude name="META-INF" />
<exclude name="license-INF" />
</fileset>
</jar>
</target>
<target name="javadocs" depends="build-server,build-client"
description="creates BioSim API documentation">
<mkdir dir="${javadocDir}" />
<echo message="Creating javadocs for BioSim" />
<javadoc destdir="${javadocDir}" breakiterator="true"
packagenames="com.traclabs.biosim.*" author="true" version="true"
use="true" windowtitle="BioSim API" maxmemory="160m">
<sourcepath>
<pathelement location="${src}" />
<pathelement location="${stubsDir}" />
</sourcepath>
<classpath>
<pathelement location="${buildDir}" />
<pathelement location="${resourceDir}" />
<pathelement location="${log4jDir}/log4j.jar" />
<pathelement location="${jacorbDir}/jacorb.jar" />
<pathelement location="${jacorbDir}/logkit.jar" />
<pathelement location="${jacorbDir}/avalon-framework.jar" />
<pathelement location="${plotDir}/jcommon.jar" />
<pathelement location="${plotDir}/jfreechart.jar" />
<pathelement location="${lib}/ptolemy/plot.jar" />
</classpath>
</javadoc>
</target>
<target name="build-manual" depends="init-tmp" description="creates the user's manual">
<echo message="Creating the user's manual" />
<mkdir dir="${manualTmpDir}" />
<echo message="Copying neccessary files" />
<copy todir="${manualTmpDir}">
<fileset dir="${manualDir}">
<exclude name="CVS" />
</fileset>
</copy>
<echo message="Logging to ${manualTmpDir}, check there for output/errors" />
<echo message="Creating empty index file" />
<touch file="${manualTmpDir}/users_manual.ind" />
<echo message="First latex pass" />
<exec executable="latex" dir="${manualTmpDir}" error="${manualTmpDir}/latex1.err"
output="${manualTmpDir}/latex1.out">
<arg line="${manualDir}/users_manual.tex" />
</exec>
<echo message="Making index file" />
<exec executable="makeindex" dir="${manualDir}" error="${manualTmpDir}/makeindex.err"
output="${manualTmpDir}/makeindex.out">
<arg line="${manualTmpDir}/users_manual.idx" />
</exec>
<echo message="Making bibliography" />
<exec executable="bibtex" dir="${manualTmpDir}" error="${manualTmpDir}/bibtex.err"
output="${manualTmpDir}/bibtex.out">
<arg line="${manualTmpDir}/users_manual.tex" />
</exec>
<echo message="Second latex pass" />
<exec executable="latex" dir="${manualTmpDir}" error="${manualTmpDir}/latex2.err"
output="${manualTmpDir}/latex2.out">
<arg line="${manualTmpDir}/users_manual.tex" />
</exec>
<echo message="Third latex pass" />
<exec executable="latex" dir="${manualTmpDir}" error="${manualTmpDir}/latex3.err"
output="${manualTmpDir}/latex3.out">
<arg line="${manualTmpDir}/users_manual.tex" />
</exec>
<echo message="Creating users_manual.pdf file in ${doc}" />
<exec executable="dvipdf" dir="${doc}" error="${manualTmpDir}/pdf.err"
output="${manualTmpDir}/pdf.out">
<arg line="${manualTmpDir}/users_manual.dvi" />
</exec>
</target>
<target name="run-nameserver">
<echo message="Starting nameserver" />
<mkdir dir="${nsDir}" />
<java classname="org.jacorb.naming.NameServer" fork="yes"
failonerror="yes">
<classpath>
<pathelement location="${jacorbDir}/jacorb.jar" />
<pathelement location="${jacorbDir}/logkit.jar" />
<pathelement location="${jacorbDir}/avalon-framework.jar" />
</classpath>
<sysproperty key="org.omg.CORBA.ORBSingletonClass" value="org.jacorb.orb.ORBSingleton" />
<sysproperty key="org.omg.CORBA.ORBClass" value="org.jacorb.orb.ORB" />
<arg file="${nsDir}/ior.txt" />
</java>
</target>
<target name="run-nameserver-viewer" description="runs the nameserver viewer">
<echo message="Starting nameserver viewer" />
<java classname="org.jacorb.naming.namemanager.NameManager" fork="yes"
failonerror="yes">
<sysproperty key="org.omg.CORBA.ORBClass" value="org.jacorb.orb.ORB" />
<sysproperty key="org.omg.CORBA.ORBSingletonClass" value="org.jacorb.orb.ORBSingleton" />
<sysproperty key="ORBInitRef.NameService" value="file:${nsDir}/ior.txt" />
<classpath>
<pathelement location="${jacorbDir}/jacorb.jar" />
<pathelement location="${jacorbDir}/logkit.jar" />
<pathelement location="${jacorbDir}/avalon-framework.jar" />
</classpath>
</java>
</target>
<target name="run-server" description="runs the server">
<echo message="Starting biosim server" />
<java classname="com.traclabs.biosim.server.framework.BiosimServer"
fork="yes" failonerror="yes">
<sysproperty key="org.omg.CORBA.ORBClass" value="org.jacorb.orb.ORB" />
<sysproperty key="org.omg.CORBA.ORBSingletonClass" value="org.jacorb.orb.ORBSingleton" />
<sysproperty key="ORBInitRef.NameService" value="file:${nsDir}/ior.txt" />
<classpath>
<pathelement location="${buildDir}" />
<pathelement location="${resourceDir}" />
<pathelement location="${log4jDir}/log4j.jar" />
<pathelement location="${jacorbDir}/jacorb.jar" />
<pathelement location="${jacorbDir}/logkit.jar" />
<pathelement location="${jacorbDir}/avalon-framework.jar" />
<pathelement location="${bionetDir}" />
<pathelement location="${bionetDir}/JBionet.jar" />
</classpath>
</java>
</target>
<target name="run-client" description="runs the client">
<echo message="Starting biosim client" />
<java classname="com.traclabs.biosim.client.framework.BiosimMain"
fork="yes" failonerror="yes">
<sysproperty key="org.omg.CORBA.ORBClass" value="org.jacorb.orb.ORB" />
<sysproperty key="org.omg.CORBA.ORBSingletonClass" value="org.jacorb.orb.ORBSingleton" />
<sysproperty key="ORBInitRef.NameService" value="file:${nsDir}/ior.txt" />
<classpath>
<pathelement location="${buildDir}" />
<pathelement location="${resourceDir}" />
<pathelement location="${log4jDir}/log4j.jar" />
<pathelement location="${jacorbDir}/jacorb.jar" />
<pathelement location="${jacorbDir}/logkit.jar" />
<pathelement location="${xercesDir}/xercesImpl.jar" />
<pathelement location="${jacorbDir}/avalon-framework.jar" />
<pathelement location="${plotDir}/jcommon.jar" />
<pathelement location="${plotDir}/jfreechart.jar" />
<pathelement location="${plotDir}/ptolemy/plot.jar" />
</classpath>
</java>
</target>
<target name="build-all" depends="docs, build-manual, build-dist"
description="compile biosim, create docs">
</target>
<target name="build" depends="build-server,build-client,build-framework"
description="builds biosim">
</target>
<target name="all" depends="clean-all,build-all" description="cleans then builds everything">
</target>
<target name="main" depends="build" description="builds biosim (alias to build)">
</target>
<target name="docs" depends="javadocs, build-manual"
description="creates documentation">
</target>
<target name="rebuild" depends="clean,build" description="cleans then builds">
</target>
<target name="clean" description="clean up">
<delete dir="${buildDir}" />
<delete dir="${stubsDir}" />
<delete dir="${tmpDir}" />
<delete dir="${distDir}" />
</target>
<target name="clean-all" depends="clean"
description="clean up everything (docs, dists)">
<delete dir="${javadocDir}" />
</target>
<target name="update" description="update from subversion">
<exec executable="svn">
<arg line="update" />
</exec>
</target>
<target name="update-and-rebuild-and-test-and-dist" depends="update,rebuild,test,build-dist"
description="update from subversion and rebuilds" />
<target name="test" depends="build">
<javac target="1.6" source="1.6" srcdir="${test.dir}" destdir="${buildDir}"
memoryMaximumSize="256m" fork="yes" debug="on">
<classpath>
<pathelement location="${buildDir}" />
<pathelement location="${resourceDir}" />
<pathelement location="${log4jDir}/log4j.jar" />
<pathelement location="${jacorbDir}/jacorb.jar" />
<pathelement location="${jacorbDir}/logkit.jar" />
<pathelement location="${jacorbDir}/avalon-framework.jar" />
<pathelement location="${plotDir}/jcommon.jar" />
<pathelement location="${plotDir}/jfreechart.jar" />
<pathelement location="${lib}/ptolemy/plot.jar" />
<pathelement location="${lib}/junit/junit.jar" />
</classpath>
</javac>
<mkdir dir="${tmpDir}/junit-results" />
<junit haltonfailure="no" printsummary="on" fork="yes"
maxmemory="256m" debug="on">
<classpath>
<pathelement location="${buildDir}" />
<pathelement location="${resourceDir}" />
<pathelement location="${log4jDir}/log4j.jar" />
<pathelement location="${jacorbDir}/jacorb.jar" />
<pathelement location="${jacorbDir}/logkit.jar" />
<pathelement location="${jacorbDir}/avalon-framework.jar" />
<pathelement location="${plotDir}/jcommon.jar" />
<pathelement location="${plotDir}/jfreechart.jar" />
<pathelement location="${lib}/junit/junit.jar" />
<pathelement location="${lib}/mysql/mysql-jdbc.jar" />
</classpath>
<formatter type="brief" usefile="false" />
<formatter type="xml" />
<batchtest todir="${tmpDir}/junit-results">
<fileset dir="${buildDir}" includes="**/*Test.class" />
</batchtest>
</junit>
</target>
<target name="build-jnlp-dist"
depends="build-server,build-client,build-framework,init-dist,init-tmp"
description="creates windows dist">
<mkdir dir="${jnlpDistDir}" />
<mkdir dir="${jnlpDistTmpDir}" />
<echo message="Unpacking libraries" />
<unzip dest="${jnlpDistTmpDir}">
<fileset file="${log4jDir}/log4j.jar" />
<fileset file="${jacorbDir}/jacorb.jar" />
<fileset file="${jacorbDir}/logkit.jar" />
<fileset file="${jacorbDir}/avalon-framework.jar" />
<fileset file="${plotDir}/jcommon.jar" />
<fileset file="${plotDir}/jfreechart.jar" />
<fileset file="${lib}/ptolemy/plot.jar" />
</unzip>
<echo message="Create biosim jar" />
<jar destfile="${jnlpDistDir}/biosim.jar" manifest="${jnlpDistLibDir}/MANIFEST.MF">
<fileset dir="${buildDir}" />
<fileset dir="${resourceDir}" />
<fileset dir="${jnlpDistTmpDir}">
<exclude name="META-INF" />
<exclude name="license-INF" />
</fileset>
</jar>
<signjar jar="${jnlpDistDir}/biosim.jar" alias="mykey"
keystore="${jnlpDistLibDir}/biosimKeystore" storepass="traclabs" />
</target>
</project>