-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
571 lines (491 loc) · 19.3 KB
/
build.xml
File metadata and controls
571 lines (491 loc) · 19.3 KB
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
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
<!--
This is the ant-makefile for Magellan.
It contains the following targets:
compile
help
-->
<project name="magellan" default="release">
<!-- <property name="build.compiler" value="jikes"/>-->
<property name="VERSION.MAJOR" value="1"/>
<property name="VERSION.MINOR" value="2"/>
<property name="VERSION.SUB" value="5h"/>
<property name="VERSION" value="${VERSION.MAJOR}_${VERSION.MINOR}_${VERSION.SUB}"/>
<property name="VERSION.POINTED" value="${VERSION.MAJOR}.${VERSION.MINOR}.${VERSION.SUB}"/>
<property name="SRC.RELEASE" value="${basedir}/src/release"/>
<property name="SRC.MAGELLAN" value="${basedir}/src/java"/>
<property name="SRC.TEST" value="${basedir}/src/test/java"/>
<property name="SRC.RES" value="${basedir}/src/res"/>
<property name="SRC.PATCHER" value="${basedir}/src/patcher"/>
<property name="SRC.CHART" value="${basedir}/src/chart"/>
<property name="SRC.HELP" value="${basedir}/../magellan-help"/>
<property name="LIB.JFREECHART" value="${SRC.RELEASE}/lib/jfreechart.jar"/>
<property name="LIB.JFLAP" value="${SRC.RELEASE}/lib/jflap4_0b7.jar"/>
<property name="LIB.FORMS" value="${SRC.RELEASE}/lib/forms-1.0.2.jar"/>
<property name="LIB.JAXP" value="${SRC.RELEASE}/lib/xml-apis.jar"/>
<property name="LIB.JUNIT" value="${basedir}/tools/junit/junit.jar"/>
<property name="LIB.ACTIVATION" value="${SRC.RELEASE}/lib/activation.jar"/>
<property name="LIB.COMMONSEMAIL" value="${SRC.RELEASE}/lib/commons-email-1.0.jar"/>
<property name="LIB.JAVAMAIL" value="${SRC.RELEASE}/lib/mail.jar"/>
<property name="BUILD" value="${basedir}/build"/>
<property name="CLASSES.MAGELLAN" value="${BUILD}/build/magellan/classes"/>
<property name="CLASSES.TEST" value="${BUILD}/build/test/magellan/classes"/>
<property name="CLASSES.MAGELLAN.JRAT" value="${BUILD}/build/jrat/magellan/classes"/>
<property name="CLASSES.PATCHER" value="${BUILD}/build/patcher/classes"/>
<property name="CLASSES.CHART" value="${BUILD}/build/chart/classes"/>
<property name="JALOPY" value="${basedir}/tools/jalopy"/>
<property name="JRAT" value="${basedir}/tools/jrat"/>
<property name="FINDBUGS" value="${basedir}/tools/findbugs-0.8.4"/>
<property name="DISTRIBUTION" value="${BUILD}/distribute"/>
<!-- be conservative while compilation to support java 1.4 -->
<!-- note that - if you cross compile - you need to set bootclasspath -->
<property name="JAVAC.TARGET" value="1.6"/>
<property name="JAVAC.SOURCE" value="1.6"/>
<property name="JAVAC.DEBUG" value="true"/>
<property name="JAVAC.DEPRECATION" value="false"/>
<property name="JAVAC.ENCODING" value="ISO-8859-1"/>
<!-- ==================================================================== -->
<!-- Defines the JRat task -->
<!-- ==================================================================== -->
<path id="JRAT.CLASSPATH">
<fileset dir="${JRAT}">
<include name="*.jar" />
</fileset>
</path>
<property name="JRAT.CLASSPATH" refid="JRAT.CLASSPATH"/>
<taskdef name="injectAndCopy"
classname="org.shiftone.jrat.inject.ant.InjectCopyTask"
classpath="${JRAT.CLASSPATH}">
<!--
we did not copy the needed .jars into the /lib directory of Ant in order
to avoid possible classpath issues, so we have to specify a lookup
classpath here
-->
</taskdef>
<target name="jrat" depends="init">
<java classname="org.shiftone.jrat.ui.Desktop"
classpath="${JRAT.CLASSPATH}" fork="yes"/>
</target>
<target name="help" depends="init">
<echo>
This buildfile contains the following targets:
[help] - prints this info
[compile] - compile Magellan (${SRC})
</echo>
</target>
<target name="init">
<property name="build.compiler.emacs" value="on"/>
</target>
<!-- <target name="compile" depends="compile.magellan, compile.chart, compile.patcher"/>-->
<target name="compile" depends="compile.magellan"/>
<target name="compile.magellan" depends="init">
<mkdir dir="${CLASSES.MAGELLAN}"/>
<javac srcdir = "${SRC.MAGELLAN}"
destdir = "${CLASSES.MAGELLAN}"
deprecation = "${JAVAC.DEPRECATION}"
target = "${JAVAC.TARGET}"
debug = "${JAVAC.DEBUG}"
encoding = "${JAVAC.ENCODING}">
<classpath>
<pathelement location="${LIB.FORMS}"/>
<pathelement location="${LIB.JAXP}"/>
<pathelement location="${LIB.JFREECHART}"/>
<pathelement location="${LIB.ACTIVATION}"/>
<pathelement location="${LIB.COMMONSEMAIL}"/>
<pathelement location="${LIB.JAVAMAIL}"/>
</classpath>
</javac>
<!-- notify VERSION information in an accessable file -->
<copy file="${SRC.RES}/VERSION.template" tofile="${SRC.RES}/VERSION" overwrite="yes">
<filterset>
<filter token="VERSION" value="${VERSION.POINTED}"/>
</filterset>
</copy>
</target>
<target name="compile.test" depends="compile.magellan">
<mkdir dir="${CLASSES.TEST}"/>
<javac srcdir = "${SRC.TEST}"
destdir = "${CLASSES.TEST}"
deprecation = "${JAVAC.DEPRECATION}"
target = "${JAVAC.TARGET}"
debug = "${JAVAC.DEBUG}">
<classpath>
<pathelement location="${CLASSES.MAGELLAN}"/>
<pathelement location="${LIB.FORMS}"/>
<pathelement location="${LIB.JAXP}"/>
<pathelement location="${LIB.JUNIT}"/>
</classpath>
</javac>
</target>
<target name="run.test" depends="compile.test">
<java classname="com.eressea.test.MagellanTestSuite" fork="yes" failonerror="true">
<classpath>
<pathelement location="${CLASSES.TEST}"/>
<pathelement location="${CLASSES.MAGELLAN}"/>
<pathelement location="${SRC.RES}"/>
<pathelement location="${LIB.FORMS}"/>
<pathelement location="${LIB.JAXP}"/>
<pathelement location="${LIB.JUNIT}"/>
</classpath>
<arg value="text"/>
</java>
</target> <!-- test.junit -->
<target name="compile.magellan.jrat" depends="compile.magellan">
<echo message="JRat injection (with classpath ${JRAT.CLASSPATH}) "/>
<mkdir dir="${CLASSES.MAGELLAN.JRAT}"/>
<!-- fixed in org.shiftone.jrat.inject.ant.InjectCopyTask, but if it does not
go into the distribution, we keep this workaround
<copy todir="${CLASSES.MAGELLAN.JRAT}">
<fileset dir="${CLASSES.MAGELLAN}"/>
</copy>
<delete>
<fileset dir="${CLASSES.MAGELLAN.JRAT}" includes="**/*.class"/>
</delete>
-->
<!-- <injectAndCopy todir="${CLASSES.MAGELLAN.JRAT}" verbose="true">-->
<injectAndCopy todir="${CLASSES.MAGELLAN.JRAT}" verbose="false">
<fileset dir="${CLASSES.MAGELLAN}"/>
</injectAndCopy>
</target>
<target name="compile.magellan.jflap" depends="init">
<mkdir dir="${CLASSES.MAGELLAN}"/>
<javac srcdir = "${SRC.MAGELLAN}"
destdir = "${CLASSES.MAGELLAN}"
deprecation = "${JAVAC.DEPRECATION}"
target = "${JAVAC.TARGET}"
debug = "${JAVAC.DEBUG}">
<classpath>
<pathelement location="${LIB.JFLAP}"/>
</classpath>
</javac>
</target>
<target name="compile.patcher" depends="init">
<mkdir dir="${CLASSES.PATCHER}"/>
<javac srcdir = "${SRC.PATCHER}"
destdir = "${CLASSES.PATCHER}"
deprecation = "${JAVAC.DEPRECATION}"
target = "${JAVAC.TARGET}"
debug = "${JAVAC.DEBUG}">
<classpath>
<pathelement location="${CLASSES.MAGELLAN}"/>
</classpath>
</javac>
</target>
<target name="compile.chart" depends="compile.magellan">
<mkdir dir="${CLASSES.CHART}"/>
<javac srcdir = "${SRC.CHART}"
destdir = "${CLASSES.CHART}"
deprecation = "${JAVAC.DEPRECATION}"
target = "${JAVAC.TARGET}"
debug = "${JAVAC.DEBUG}">
<classpath>
<pathelement location="${CLASSES.MAGELLAN}"/>
</classpath>
</javac>
<!-- <checksum>
<fileset dir="${CLASSES.CHART}">
<include name="**/*.class"/>
</fileset>
</checksum>
-->
</target>
<target name="clean" depends="init">
<delete dir= "${BUILD}" quiet="false"/>
</target>
<target name="recompile" depends="clean,compile.magellan">
</target>
<target name="run" depends="init">
<!--
<copy file="${CONFIG}/magellan.ini" todir="${BUILD}"/>
<copy file="${CONFIG}/magellan_desktop.ini" todir="${BUILD}"/>
-->
<java classname="com.eressea.demo.Client" fork="yes">
<classpath path="${BUILD}/build/magellan.jar" />
</java>
</target>
<target name="jar.magellan.jrat" depends="compile.magellan.jrat">
<delete file="${BUILD}/build/magellan_jrat.jar" quiet="false"/>
<jar jarfile="${BUILD}/build/magellan_jrat.jar"
manifest="${SRC.MAGELLAN}/manifest.mf">
<fileset dir="${CLASSES.MAGELLAN.JRAT}">
<include name="**/*.class"/>
</fileset>
<fileset dir="${SRC.RES}/../">
<include name="res/**/*"/>
<exclude name="res/**/VERSION.template"/>
</fileset>
</jar>
</target>
<target name="jar.magellan" depends="compile.magellan">
<delete file="${BUILD}/build/magellan.jar" quiet="false"/>
<jar jarfile="${BUILD}/build/magellan.jar"
manifest="${SRC.MAGELLAN}/manifest.mf">
<fileset dir="${CLASSES.MAGELLAN}">
<include name="**/*.class"/>
</fileset>
<fileset dir="${SRC.RES}/../">
<include name="res/**/*"/>
<exclude name="res/**/VERSION.template"/>
</fileset>
</jar>
</target>
<target name="jar.chart" depends="compile.chart">
<delete file="${BUILD}/build/chart.jar" quiet="false"/>
<jar jarfile="${BUILD}/build/chart.jar">
<fileset dir="${CLASSES.CHART}">
<include name="**/*.class"/>
</fileset>
</jar>
</target>
<target name="jar.patcher" depends="compile.patcher">
<delete file="${BUILD}/build/patcher.jar" quiet="false"/>
<jar jarfile="${BUILD}/build/patcher.jar"
manifest="${SRC.PATCHER}/META-INF/manifest.mf">
<fileset dir="${CLASSES.PATCHER}">
<include name="**/*.class"/>
</fileset>
</jar>
</target>
<target name="jar.help" depends="init">
<delete file="${BUILD}/build/magellan-help.jar" quiet="false"/>
<jar jarfile="${BUILD}/build/magellan-help.jar"
manifest="${SRC.HELP}/META-INF/manifest.mf">
<fileset dir="${SRC.HELP}"/>
</jar>
</target>
<!-- <target name="release" depends="jar.magellan, jar.chart, jar.patcher, jar.help">-->
<target name="release" depends="jar.magellan,jar.help">
<mkdir dir="${BUILD}/release"/>
<!-- copy all files from lib -->
<copy todir="${BUILD}/release">
<fileset dir="${SRC.RELEASE}">
<!-- pavkovic 2003.11.12: ignore jflap for now -->
<exclude name="**/lib/jflap*.*"/>
<!-- pavkovic 2004.01.25: ignore jfreechart-0.9.8 for now -->
<exclude name="**/lib/jfreechart-0.9.8*.*"/>
</fileset>
<fileset dir="${basedir}">
<include name="COPYING"/>
<include name="LICENSE"/>
</fileset>
</copy>
<copy todir="${BUILD}/release/lib">
<fileset dir="${BUILD}/build">
<include name="chart.jar"/>
<include name="magellan.jar"/>
<include name="magellan-help.jar"/>
<include name="patcher.jar"/>
</fileset>
</copy>
</target>
<target name="release.jrat" depends="jar.magellan.jrat, jar.help">
<mkdir dir="${BUILD}/release.jrat"/>
<!-- copy all files from lib -->
<copy todir="${BUILD}/release.jrat">
<fileset dir="${SRC.RELEASE}"/>
</copy>
<copy todir="${BUILD}/release.jrat/lib">
<fileset dir="${BUILD}/build">
<include name="chart.jar"/>
<include name="magellan_jrat.jar"/>
<include name="magellan-help.jar"/>
<include name="patcher.jar"/>
</fileset>
</copy>
<copy todir="${BUILD}/release.jrat/lib">
<fileset dir="${JRAT}">
<include name="*.jar" />
</fileset>
</copy>
</target>
<target name="release.src" depends="init">
<mkdir dir="${BUILD}/release.src/magellan"/>
<copy todir="${BUILD}/release.src/magellan">
<fileset dir="${basedir}">
<!-- pavkovic 2003.11.12: ignore jflap for now -->
<exclude name="**/lib/jflap*.*"/>
<!-- pavkovic 2004.01.25: ignore jfreechart-0.9.8 for now -->
<exclude name="**/lib/jfreechart-0.9.8*.*"/>
<exclude name="build/**"/>
<!-- pavkovic 2003.11.13: ignore buildlib for now -->
<exclude name="buildlib/**"/>
<exclude name="build.sh"/>
<exclude name="ant.bat"/>
<exclude name="build.bat"/>
<!-- pavkovic 2003.11.13: ignore tools for now -->
<exclude name="tools/**"/>
</fileset>
</copy>
<mkdir dir="${BUILD}/release.src/magellan-help"/>
<copy todir="${BUILD}/release.src/magellan-help">
<fileset dir="${SRC.HELP}">
</fileset>
</copy>
</target>
<target name="distribution" depends="clean, release, release.src">
<mkdir dir="${DISTRIBUTION}"/>
<!-- pavkovic 2004.01.26: now we have a dependency to jfreechart.jar so we do
not distribute the jar file anymore.
pavkovic 2004.02.15: dependency have been reduced so we still happily
distribute magellan.jar :-)
-->
<copy
tofile="${DISTRIBUTION}/magellan_${VERSION}.jar"
file="${BUILD}/build/magellan.jar"/>
<zip
destfile="${DISTRIBUTION}/magellan_${VERSION}.zip"
basedir="${BUILD}/release"/>
<zip
destfile="${DISTRIBUTION}/magellan_${VERSION}-src.zip"
basedir="${BUILD}/release.src"/>
<!--
<tar
destfile="${DISTRIBUTION}/magellan_${VERSION}.tar.bz2"
basedir="${BUILD}/release"
compression="bzip2"/>
<tar
destfile="${DISTRIBUTION}/magellan_${VERSION}-src.tar.bz2"
basedir="${BUILD}/release.src"
compression="bzip2"/>
-->
</target>
<target name="tagdistribution" depends="distribution">
<cvs command='tag -R "v${VERSION}"'/>
<path id="HELP">
<pathelement location="${SRC.HELP}"/>
</path>
<property name="HELP" refid="HELP"/>
<cvs dest="${HELP}" command='tag -R "v${VERSION}"'/>
</target>
<target name="update" depends="init, format">
<cvs command="update -P -d" dest="../" />
</target>
<target name="brt" depends="jar.magellan">
<java classname="com.eressea.swing.BasicRegionPanel">
<classpath>
<pathelement location="${BUILD}/build/magellan.jar"/>
<pathelement location="${LIB.FORMS}"/>
</classpath>
</java>
</target>
<target name="toLocal" depends="init">
<replace dir="${basedir}/../" defaultexcludes="no">
<include name="**/CVS/Root"/>
<replacefilter token="@cvs.sourceforge.net" value="@localhost"/>
<replacefilter token="@eressea.upb.de" value="@localhost"/>
</replace>
</target>
<target name="toRemote" depends="init">
<replace dir="${basedir}/../" defaultexcludes="no">
<include name="**/CVS/Root"/>
<replacefilter token="@cvs.sourceforge.net" value="@eressea.upb.de"/>
<replacefilter token="@localhost" value="@eressea.upb.de"/>
</replace>
</target>
<target name="toSF" depends="init">
<replace dir="${basedir}/../" defaultexcludes="no">
<include name="**/CVS/Root"/>
<replacefilter token="@eressea.upb.de" value="@cvs.sourceforge.net"/>
<replacefilter token="@localhost" value="@cvs.sourceforge.net"/>
</replace>
</target>
<path id="JALOPY.CLASSPATH">
<fileset dir="${JALOPY}/lib">
<include name="*.jar" />
</fileset>
</path>
<property name="JALOPY.CLASSPATH" refid="JALOPY.CLASSPATH"/>
<!-- ==================================================================== -->
<!-- Defines the Jalopy task -->
<!-- ==================================================================== -->
<taskdef name="jalopy"
classname="de.hunsicker.jalopy.plugin.ant.AntPlugin"
classpath="${JALOPY.CLASSPATH}">
<!--
we did not copy the needed .jars into the /lib directory of Ant in order
to avoid possible classpath issues, so we have to specify a lookup
classpath here
-->
</taskdef>
<!-- ==================================================================== -->
<!-- Formats all source files -->
<!-- ==================================================================== -->
<target name="format" depends="init">
<echo message="Calling jalopy with classpath=${JALOPY.CLASSPATH}"/>
<mkdir dir="${BUILD}/src"/>
<!--
Invokes Jalopy as follows:
- All formatted files will have dos fileformat (\n)
- Load your code convention from the given url
- Override the convention to use the file history feature
- Override the convention to use alder32 checksums of files for history testing
- Override the convention to use loglevel "info"
- Override the convention to use 2 threads
- The import optimization feature will work (if enabled in the active
convention), because a classpath reference is specified
Don't forget to setup an include pattern as Jalopy truly expects
valid Java source files as input!
-->
<jalopy fileformat="dos"
convention="${JALOPY}/magellan.xml"
history="file"
historymethod="adler32"
loglevel="info"
threads="1"
destdir="${SRC.MAGELLAN}">
<fileset dir="${SRC.MAGELLAN}">
<include name="**/*.java" />
<exclude name="**/jgoodies/**"/>
<exclude name="**/apache/**"/>
</fileset>
</jalopy>
<!--<fixcrlf srcdir="${SRC.MAGELLAN}" eol="crlf"/>-->
</target>
<!-- helper target to modify jalopy settings (a very nice tool!!!)-->
<target name="setup.jalopy" depends="init">
<java classname="de.hunsicker.jalopy.swing.SettingsDialog"
fork="yes"
failonerror="yes"
classpath="${JALOPY.CLASSPATH}">
</java>
</target>
<!-- target for validating XML rules -->
<target name="validateXML" depends="init">
<xmlvalidate failonerror="yes" warn="yes">
<fileset dir="${SRC.RES}/rules">
<include name="*.xml"/>
</fileset>
</xmlvalidate>
</target>
<!-- <target name="gui" depends="compile"> -->
<!-- <java classname="com.eressea.swing.desktop.Desktop" -->
<!-- classpath="${CLASSES.MAGELLAN}" fork="yes"/> -->
<!-- </target> -->
<path id="FINDBUGS.CLASSPATH">
<fileset dir="${FINDBUGS}/lib">
<include name="*.jar" />
</fileset>
</path>
<property name="FINDBUGS.CLASSPATH" refid="FINDBUGS.CLASSPATH"/>
<!--
ant 1.6.1
<typedef name="findbugs"
adapter="org.apache.tools.ant.TaskAdapter"
adaptto="org.apache.tools.ant.Task"
classname="edu.umd.cs.findbugs.anttask.FindBugsTask"
classpath="${FINDBUGS.CLASSPATH}"/>
-->
<!--
<taskdef name="findbugs"
classname="edu.umd.cs.findbugs.anttask.FindBugsTask"
classpath="${FINDBUGS.CLASSPATH}"/>
<target name="findbugs" depends="clean,compile.magellan">
<findbugs home="${FINDBUGS}"
jvmargs="-Xmx512M"
output="emacs">
<auxClasspath path="${LIB.JFREECHART}"/>
<sourcePath path="${SRC.MAGELLAN}" />
<class location="${CLASSES.MAGELLAN}"/>
</findbugs>
</target>
-->
</project>