-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
765 lines (712 loc) · 22.8 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
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
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
<?xml version="1.0"?>
<!--
Build file for Apache Ant (http://ant.apache.org/)
-->
<project name="GoGui" default="all">
<!--
Use 123.GIT-${gitversion} for unreleased versions if the last released
version in the branch was 123. The crash dialog in gogui/Main.java assumes
that unreleased versions contain the string GIT.
Comment out the following exec tag for releases.
-->
<exec executable="git" outputproperty="gitversion">
<arg value="describe"/><arg value="--always"/>
</exec>
<property name="version" value="1.2.GIT-${gitversion}"/>
<tstamp><format property="DSTAMP" pattern="yyyy-MM-dd" timezone="UCT"/>
<format property="TSTAMP" pattern="hh:mm" timezone="UCT"/></tstamp>
<property environment="env"/>
<property name="findbugs.home" value="${env.FINDBUGS_HOME}"/>
<property name="pmd.home" value="${env.PMD_HOME}"/>
<property name="docbook.name" value="docbook-xsl-1.68.1"/>
<property name="quaqua.nestedzipfile"
value="external/quaqua/quaqua-5.2.1.nested.zip"/>
<property name="quaqua.zipfile" value="quaqua-5.2.1.zip"/>
<property name="quaqua.dir" value="Quaqua/dist"/>
<property name="quaqua.jarfile" value="quaqua.jar"/>
<property name="docbook.path" value="external/docbook/${docbook.name}"/>
<property name="scripts" value="
gogui
gogui-adapter
gogui-client
gogui-convert
gogui-display
gogui-dummy
gogui-regress
gogui-server
gogui-statistics
gogui-terminal
gogui-thumbnailer
gogui-twogtp
"/>
<available property="docbook.available"
file="${docbook.path}/html/chunk.xsl"/>
<available property="quaqua.available"
file="external/quaqua/${quaqua.dir}/${quaqua.jarfile}"/>
<available property="quaqua.zip-available" file="${quaqua.nestedzipfile}"/>
<target name="all"
description="Compile all programs (default target)"
depends="
gogui.jar,
gogui-adapter.jar,
gogui-client.jar,
gogui-convert.jar,
gogui-display.jar,
gogui-dummy.jar,
gogui-regress.jar,
gogui-statistics.jar,
gogui-server.jar,
gogui-terminal.jar,
gogui-thumbnailer.jar,
gogui-twogtp.jar
"/>
<target name="clean" depends="clean-build-dir"
description="Delete class and jar files built by target all">
<delete failonerror="false" includeEmptyDirs="true">
<fileset dir="lib"
includes="
gogui.jar,
gogui-adapter.jar,
gogui-client.jar,
gogui-convert.jar,
gogui-display.jar,
gogui-dummy.jar,
gogui-regress.jar,
gogui-server.jar,
gogui-statistics.jar,
gogui-terminal.jar,
gogui-thumbnailer.jar,
gogui-twogtp.jar,
${quaqua.jarfile},
"
/>
</delete>
</target>
<target name="clean-build-dir">
<delete failonerror="false" includeEmptyDirs="true">
<fileset dir="build/depcache"/>
<fileset dir="build/depcache-test"/>
<fileset dir="build/net"/>
<fileset dir="build/test"/>
<fileset dir="build/GoGui.app"/>
<fileset dir="build" includes="GoGui*.dmg"/>
</delete>
</target>
<target name="check" depends="docvalidate,junit"
description="Run all tests"/>
<target name="compile" depends="depend,version,doc">
<mkdir dir="build"/>
<javac srcdir="src" destdir="build" source="1.5" target="1.5"
deprecation="true" debug="true" listfiles="yes">
<compilerarg value="-Xlint:unchecked"/>
</javac>
<copy todir="build">
<fileset dir="src"
includes="
net/sf/gogui/*/*.properties
net/sf/gogui/images/*.png
net/sf/gogui/gui/analyze-commands
net/sf/gogui/gui/*.png
"/>
</copy>
<copy todir="build/net/sf/gogui/doc">
<fileset dir="doc/manual/html" includes="*.html *.png"/>
</copy>
</target>
<target name="depend">
<depend srcdir="src" destdir="build" cache="build/depcache"/>
</target>
<target name="dist" depends="all,check">
<zip destfile="gogui-${version}.zip">
<zipfileset prefix="gogui-${version}" dir="." includes="
README.html
COPYING.html
INSTALL.html
build.xml
config/go.dtd
config/gogui-gogui.desktop
config/gogui-gogui.png
config/application-x-go-sgf.png
config/gogui-C.omf
config/gogui-C.omf.in
config/gogui.schemas
config/gogui-mime.xml
doc/README.html
doc/manual/html/*.html
doc/manual/html/*.png
doc/manual/man/*.1
doc/manual/xml/*.xml
doc/manual/xml/*.xml.in
doc/manual/xml/*.xsl
doc/doxygen/Doxyfile
doc/doxygen/footer.html
doc/doxygen/README.html
${docbook.path}.zip
${quaqua.nestedzipfile}
lib/*.jar
mac/packaging/GoGui.icns
mac/packaging/Info.plist
mac/packaging/Info.plist.in
mac/packaging/PkgInfo
mac/src/net/sf/gogui/specialmac/RegisterSpecialMacHandler.java
mac/src/net/sf/gogui/specialmac/RegisterSpecialMacHandler.class
mac/src/net/sf/gogui/specialmac/Listener.class
sgf/openings/9x9/README.html
sgf/openings/9x9/*.sgf
sgf/openings/19x19/README.html
sgf/openings/19x19/*.sgf
src/net/sf/gogui/images/*.png
src/net/sf/gogui/images/*.svg
src/net/sf/gogui/overview.html
src/net/sf/gogui/*/package.html
src/net/sf/gogui/*/*.properties
src/net/sf/gogui/*/*.java
src/net/sf/gogui/*/*.java.in
src/net/sf/gogui/gui/analyze-commands
src/net/sf/gogui/tools/*/*.java
test/findbugs/gogui.fb
test/checkstyle/checkstyle_checks.xml
test/junit/src/net/sf/gogui/*/*.java
test/junit/src/net/sf/gogui/*/*.sgf
test/junit/src/net/sf/gogui/*/*.png
test/pmd/ruleset.xml
" />
<zipfileset prefix="gogui-${version}" dir="." filemode="755" includes="
install.sh,
bin/gogui,
bin/gogui-adapter,
bin/gogui-client,
bin/gogui-convert,
bin/gogui-display,
bin/gogui-dummy,
bin/gogui-regress,
bin/gogui-server,
bin/gogui-statistics,
bin/gogui-terminal,
bin/gogui-thumbnailer,
bin/gogui-twogtp,
" />
</zip>
</target>
<target name="gogui-adapter.jar" depends="compile">
<mkdir dir="lib"/>
<jar destfile="lib/gogui-adapter.jar" compress="true" level="9">
<manifest>
<attribute name="Main-Class" value="net.sf.gogui.tools.adapter.Main"/>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Build-Date" value="${DSTAMP} ${TSTAMP}"/>
</manifest>
<fileset dir="build" includes="
net/sf/gogui/game/*.class
net/sf/gogui/gamefile/*.class
net/sf/gogui/go/*.class
net/sf/gogui/gtp/*.class
net/sf/gogui/sgf/*.class
net/sf/gogui/util/*.class
net/sf/gogui/version/*.class
net/sf/gogui/xml/*.class
net/sf/gogui/tools/adapter/*.class
"/>
</jar>
</target>
<target name="gogui-client.jar" depends="compile">
<mkdir dir="lib"/>
<jar destfile="lib/gogui-client.jar" compress="true" level="9">
<manifest>
<attribute name="Main-Class" value="net.sf.gogui.tools.client.Main"/>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Build-Date" value="${DSTAMP} ${TSTAMP}"/>
</manifest>
<fileset dir="build" includes="
net/sf/gogui/util/ErrorMessage.class
net/sf/gogui/util/Options.class
net/sf/gogui/util/StreamCopy.class
net/sf/gogui/util/StringUtil.class
net/sf/gogui/version/Version.class
net/sf/gogui/tools/client/*.class
"/>
</jar>
</target>
<target name="gogui-convert.jar" depends="compile">
<mkdir dir="lib"/>
<jar destfile="lib/gogui-convert.jar" compress="true" level="9">
<manifest>
<attribute name="Main-Class" value="net.sf.gogui.tools.convert.Main"/>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Build-Date" value="${DSTAMP} ${TSTAMP}"/>
</manifest>
<fileset dir="build" includes="
net/sf/gogui/game/*.class
net/sf/gogui/gamefile/*.class
net/sf/gogui/go/*.class
net/sf/gogui/sgf/*.class
net/sf/gogui/tex/*.class
net/sf/gogui/util/*.class
net/sf/gogui/version/*.class
net/sf/gogui/xml/*.class
net/sf/gogui/tools/convert/*.class
"/>
</jar>
</target>
<target name="gogui-display.jar"
depends="compile,extract-quaqua">
<mkdir dir="lib"/>
<jar destfile="lib/gogui-display.jar" compress="true" level="9">
<manifest>
<attribute name="Main-Class" value="net.sf.gogui.tools.display.Main"/>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Build-Date" value="${DSTAMP} ${TSTAMP}"/>
<attribute name="Class-Path" value="${quaqua.jarfile}"/>
</manifest>
<fileset dir="build" includes="
net/sf/gogui/boardpainter/*.class
net/sf/gogui/game/*.class
net/sf/gogui/go/*.class
net/sf/gogui/go/*.properties
net/sf/gogui/gui/*.class
net/sf/gogui/gui/*.png
net/sf/gogui/gui/*.properties
net/sf/gogui/gtp/*.class
net/sf/gogui/images/*.png
net/sf/gogui/sgf/*.class
net/sf/gogui/tex/*.class
net/sf/gogui/util/*.class
net/sf/gogui/version/Version.class
net/sf/gogui/tools/display/*.class
"/>
</jar>
<copy file="external/quaqua/${quaqua.dir}/${quaqua.jarfile}" todir="lib"/>
</target>
<target name="gogui-dummy.jar" depends="compile">
<mkdir dir="lib"/>
<jar destfile="lib/gogui-dummy.jar" compress="true" level="9">
<manifest>
<attribute name="Main-Class" value="net.sf.gogui.tools.dummy.Main"/>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Build-Date" value="${DSTAMP} ${TSTAMP}"/>
</manifest>
<fileset dir="build" includes="
net/sf/gogui/game/*.class
net/sf/gogui/go/*.class
net/sf/gogui/gtp/*.class
net/sf/gogui/util/*.class
net/sf/gogui/version/*.class
net/sf/gogui/tools/dummy/*.class
"/>
</jar>
</target>
<target name="gogui-regress.jar" depends="compile">
<mkdir dir="lib"/>
<jar destfile="lib/gogui-regress.jar" compress="true" level="9">
<manifest>
<attribute name="Main-Class" value="net.sf.gogui.tools.regress.Main"/>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Build-Date" value="${DSTAMP} ${TSTAMP}"/>
</manifest>
<fileset dir="build" includes="
net/sf/gogui/go/*.class
net/sf/gogui/gtp/*.class
net/sf/gogui/util/*.class
net/sf/gogui/version/Version.class
net/sf/gogui/tools/regress/*.class
"/>
</jar>
</target>
<target name="gogui-server.jar" depends="compile">
<mkdir dir="lib"/>
<jar destfile="lib/gogui-server.jar" compress="true" level="9">
<manifest>
<attribute name="Main-Class" value="net.sf.gogui.tools.server.Server"/>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Build-Date" value="${DSTAMP} ${TSTAMP}"/>
</manifest>
<fileset dir="build" includes="
net/sf/gogui/util/ErrorMessage.class
net/sf/gogui/util/Options.class
net/sf/gogui/util/ProcessUtil*.class
net/sf/gogui/util/StreamCopy.class
net/sf/gogui/util/StringUtil.class
net/sf/gogui/version/Version.class
net/sf/gogui/tools/server/*.class
"/>
</jar>
</target>
<target name="gogui-statistics.jar" depends="compile">
<mkdir dir="lib"/>
<jar destfile="lib/gogui-statistics.jar" compress="true" level="9">
<manifest>
<attribute name="Main-Class" value="net.sf.gogui.tools.statistics.Main"/>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Build-Date" value="${DSTAMP} ${TSTAMP}"/>
</manifest>
<fileset dir="build" includes="
net/sf/gogui/game/*.class
net/sf/gogui/go/*.class
net/sf/gogui/gtp/*.class
net/sf/gogui/gui/*.class
net/sf/gogui/sgf/*.class
net/sf/gogui/util/*.class
net/sf/gogui/version/*.class
net/sf/gogui/tools/statistics/*.class
"/>
</jar>
</target>
<target name="gogui-terminal.jar" depends="compile">
<mkdir dir="lib"/>
<jar destfile="lib/gogui-terminal.jar" compress="true" level="9">
<manifest>
<attribute name="Main-Class" value="net.sf.gogui.tools.terminal.Main"/>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Build-Date" value="${DSTAMP} ${TSTAMP}"/>
</manifest>
<fileset dir="build" includes="
net/sf/gogui/game/*.class
net/sf/gogui/go/*.class
net/sf/gogui/gtp/*.class
net/sf/gogui/sgf/*.class
net/sf/gogui/util/ErrorMessage.class
net/sf/gogui/util/FileUtil.class
net/sf/gogui/util/MessageQueue.class
net/sf/gogui/util/Options.class
net/sf/gogui/util/ProcessUtil*.class
net/sf/gogui/util/ProgressShow*.class
net/sf/gogui/util/StringUtil.class
net/sf/gogui/version/Version.class
net/sf/gogui/tools/terminal/*.class
"/>
</jar>
</target>
<target name="gogui-thumbnailer.jar" depends="compile">
<mkdir dir="lib"/>
<jar destfile="lib/gogui-thumbnailer.jar" compress="true" level="9">
<manifest>
<attribute name="Main-Class" value="net.sf.gogui.tools.thumbnailer.Main"/>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Build-Date" value="${DSTAMP} ${TSTAMP}"/>
</manifest>
<fileset dir="build" includes="
net/sf/gogui/boardpainter/*.class
net/sf/gogui/game/*.class
net/sf/gogui/gamefile/*.class
net/sf/gogui/go/*.class
net/sf/gogui/sgf/*.class
net/sf/gogui/thumbnail/*.class
net/sf/gogui/util/*.class
net/sf/gogui/version/*.class
net/sf/gogui/xml/*.class
net/sf/gogui/tools/thumbnailer/*.class
"/>
</jar>
</target>
<target name="gogui-twogtp.jar" depends="compile">
<mkdir dir="lib"/>
<jar destfile="lib/gogui-twogtp.jar" compress="true" level="9">
<manifest>
<attribute name="Main-Class" value="net.sf.gogui.tools.twogtp.Main"/>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Build-Date" value="${DSTAMP} ${TSTAMP}"/>
</manifest>
<fileset dir="build" includes="
net/sf/gogui/game/*.class
net/sf/gogui/go/*.class
net/sf/gogui/gtp/*.class
net/sf/gogui/sgf/*.class
net/sf/gogui/util/*.class
net/sf/gogui/version/Version.class
net/sf/gogui/xml/*.class
net/sf/gogui/tools/twogtp/*.class
"/>
</jar>
</target>
<target name="doc" depends="extract-docbook,doc-check-uptodate"
unless="doc-uptodate"
description="Generate documentation using xsltproc">
<echo message="Running xsltproc"/>
<exec executable="xsltproc">
<arg line="--path ${docbook.path}/html"/>
<arg line="-o doc/manual/html/"/>
<arg line="doc/manual/xml/custom.xsl"/>
<arg line="doc/manual/xml/book.xml"/>
</exec>
<!-- Remove empty div sections that create unwanted space in JEditorPane -->
<replace dir="doc/manual/html" includes="*.html"
token="<div></div>" encoding="UTF-8"/>
<exec executable="xsltproc">
<arg line="--param chunk.quietly 1"/>
<arg line="-o doc/manual/man/"/>
<arg line="${docbook.path}/manpages/docbook.xsl"/>
<arg line="doc/manual/xml/manpages.xml"/>
</exec>
</target>
<!--
Generate documentation using ant style target.
Not used at present due to problems with mdash in output (not understood
by JEditorPane, slow speed and errors with old versions of Xalan)
-->
<target name="doc-style" depends="extract-docbook,doc-check-uptodate"
unless="doc-uptodate">
<style basedir="doc/manual/xml" includes="book.xml" destdir="doc/manual/html"
style="${docbook.path}/html/chunk.xsl" force="true">
<xmlcatalog>
<dtd
publicId="http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl"
location="${docbook.path}/html/chunk.xsl"/>
</xmlcatalog>
</style>
</target>
<target name="docvalidate">
<xmlvalidate file="doc/manual/xml/book.xml"/>
</target>
<target name="doc-check-uptodate">
<uptodate property="doc-uptodate" targetfile="doc/manual/html/index.html">
<srcfiles dir= "doc/manual/xml" includes="*.xml"/>
<srcfiles dir= "doc/manual/xml" includes="*.xsl"/>
</uptodate>
</target>
<target name="doxygen"
description="Generate source code documentation using doxygen">
<exec executable="doxygen" dir="doc/doxygen"/>
</target>
<target name="extract-docbook" unless="docbook.available">
<unzip src="${docbook.path}.zip" dest="external/docbook">
<patternset>
<include name="${docbook.name}/VERSION"/>
<include name="${docbook.name}/common/*"/>
<include name="${docbook.name}/html/*"/>
<include name="${docbook.name}/lib/*"/>
<include name="${docbook.name}/manpages/*"/>
</patternset>
</unzip>
</target>
<target name="extract-quaqua" unless="quaqua.available">
<fail unless="quaqua.zip-available">
Please download the Quaqua Look and Feel from
http://www.randelshofer.ch/quaqua/download.html and copy it to
${quaqua.nestedzipfile}
</fail>
<unzip src="${quaqua.nestedzipfile}" dest="external/quaqua">
<patternset>
<include name="${quaqua.zipfile}"/>
</patternset>
</unzip>
<unzip src="external/quaqua/${quaqua.zipfile}" dest="external/quaqua">
<patternset>
<include name="${quaqua.dir}/${quaqua.jarfile}"/>
</patternset>
</unzip>
</target>
<target name="findbugs" depends="compile"
description="Invoke FindBugs (with exec)">
<mkdir dir="test/findbugs"/>
<exec executable="${findbugs.home}/bin/findbugs"
output="test/findbugs/output.xml" logError="true">
<arg line="-textui"/>
<arg line="-project test/findbugs/gogui.fb"/>
<arg line="-low"/>
<arg line="-xml"/>
</exec>
</target>
<target name="gogui.app" depends="specialmac,all"
description="Make Mac application bundle">
<property name="appdir" value="build/GoGui.app"/>
<mkdir dir="${appdir}"/>
<mkdir dir="${appdir}/Contents"/>
<mkdir dir="${appdir}/Contents/bin"/>
<mkdir dir="${appdir}/Contents/MacOS"/>
<mkdir dir="${appdir}/Contents/Resources"/>
<mkdir dir="${appdir}/Contents/Resources/Java"/>
<copy file="/System/Library/Frameworks/JavaVM.framework/Versions/Current/Resources/MacOS/JavaApplicationStub"
todir="${appdir}/Contents/MacOS"/>
<exec executable="chmod">
<arg line="755 ${appdir}/Contents/MacOS/JavaApplicationStub"/>
</exec>
<copy todir="${appdir}/Contents" overwrite="true">
<fileset dir="mac/packaging" includes="Info.plist PkgInfo"/>
</copy>
<copy todir="${appdir}/Contents/Resources" overwrite="true">
<fileset dir="mac/packaging" includes="GoGui.icns"/>
</copy>
<copy todir="${appdir}/Contents/Resources/GoGui Help" overwrite="true">
<fileset dir="doc/manual/html" includes="*.html *.png"/>
</copy>
<replace file="${appdir}/Contents/Resources/GoGui Help/index.html"
token="<head>"
value="<head><meta name="AppleTitle" content="GoGui Help">"/>
<copy todir="${appdir}/Contents/Resources/Java" overwrite="true">
<fileset dir="lib" includes="*.jar"/>
</copy>
<copy todir="${appdir}/Contents/bin" overwrite="true">
<fileset dir="bin" includes="${scripts}"/>
</copy>
<replace dir="${appdir}/Contents/bin" includes="${scripts}"
token="/../lib" value="/../Resources/Java"/>
<chmod dir="${appdir}/Contents/bin" includes="${scripts}" perm="755"/>
<exec executable="/Developer/Tools/SetFile">
<arg line="-a B ${appdir}"/>
</exec>
</target>
<target name="gogui.dmg" depends="gogui.app"
description="Make Mac compressed disk image">
<exec executable="hdiutil">
<arg line="create -fs HFS+ -format UDZO -volname GoGui-${version} -srcfolder build/GoGui.app build/GoGui-${version}.dmg"/>
</exec>
</target>
<target name="gogui.jar" depends="compile,extract-quaqua">
<mkdir dir="lib"/>
<jar destfile="lib/gogui.jar" compress="true" level="9">
<manifest>
<attribute name="Main-Class" value="net.sf.gogui.gogui.MainWrapper"/>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Build-Date" value="${DSTAMP} ${TSTAMP}"/>
<attribute name="Class-Path" value="${quaqua.jarfile}"/>
</manifest>
<fileset dir="build" includes="
net/sf/gogui/doc/*.html
net/sf/gogui/doc/*.png
net/sf/gogui/boardpainter/*.class
net/sf/gogui/game/*.class
net/sf/gogui/gamefile/*.class
net/sf/gogui/gamefile/*.properties
net/sf/gogui/go/*.class
net/sf/gogui/go/*.properties
net/sf/gogui/gtp/*.class
net/sf/gogui/gogui/*.class
net/sf/gogui/gogui/*.properties
net/sf/gogui/gui/*.class
net/sf/gogui/gui/*.png
net/sf/gogui/gui/*.properties
net/sf/gogui/gui/analyze-commands
net/sf/gogui/images/*.png
net/sf/gogui/sgf/*.class
net/sf/gogui/tex/*.class
net/sf/gogui/text/*.class
net/sf/gogui/thumbnail/*.class
net/sf/gogui/util/*.class
net/sf/gogui/version/Version.class
net/sf/gogui/xml/*.class
"/>
<fileset dir="mac/src" includes="
net/sf/gogui/specialmac/*.class
"/>
</jar>
<copy file="external/quaqua/${quaqua.dir}/${quaqua.jarfile}" todir="lib"/>
</target>
<target name="javadoc"
description="Create Javadoc documentation for public parts of packages">
<javadoc sourcepath="src" destdir="doc/javadoc" source="1.5"
windowtitle="GoGui Source Documentation"
overview="src/net/sf/gogui/overview.html"
packagenames="
net/sf/gogui/boardpainter.*,
net/sf/gogui/game.*,
net/sf/gogui/go.*,
net/sf/gogui/gogui.*,
net/sf/gogui/gtp.*,
net/sf/gogui/gui.*,
net/sf/gogui/sgf.*,
net/sf/gogui/statistics.*,
net/sf/gogui/terminal.*,
net/sf/gogui/tex.*,
net/sf/gogui/thumbnail.*,
net/sf/gogui/util.*,
net/sf/gogui/version.*
net/sf/gogui/tools/adapter.*,
net/sf/gogui/tools/client.*,
net/sf/gogui/tools/convert.*,
net/sf/gogui/tools/display.*,
net/sf/gogui/tools/dummy.*,
net/sf/gogui/tools/regress.*,
net/sf/gogui/tools/server.*,
net/sf/gogui/tools/thumbnailer.*,
net/sf/gogui/tools/twogtp.*,
">
<tag name="bug" scope="all" description="Bugs:"/>
<tag name="todo" scope="all" description="To do:"/>
</javadoc>
</target>
<target name="junit" depends="compile,junit-compile"
description="Run JUnit tests (define property test for a single test)" >
<junit printsummary="withOutAndErr" fork="true" timeout="60000"
haltonfailure="true">
<assertions><enable/></assertions>
<classpath>
<pathelement location="build"/>
<pathelement location="build/test"/>
</classpath>
<formatter type="brief" usefile="false"/>
<test name="${test}" todir="build" if="test"/>
<batchtest todir="build" unless="test">
<fileset dir="build/test" includes="**/*Test.class"/>
</batchtest>
</junit>
</target>
<target name="junit-compile" depends="compile,test-depend"
description="Compile JUnit tests">
<mkdir dir="build/test"/>
<javac srcdir="test/junit/src" destdir="build/test" source="1.5" target="1.5"
deprecation="true" debug="true" listfiles="yes" classpath="build">
<compilerarg value="-Xlint:unchecked"/>
</javac>
<copy todir="build/test">
<fileset dir="test/junit/src" includes="net/sf/gogui/*/*.sgf"/>
<fileset dir="test/junit/src" includes="net/sf/gogui/*/*.png"/>
<fileset dir="test/junit/src" includes="net/sf/gogui/tools/*/*.sgf"/>
<fileset dir="test/junit/src" includes="net/sf/gogui/tools/*/*.png"/>
</copy>
</target>
<target name="pmd" depends="compile"
description="Run PMD (pmd.sourceforge.net)">
<mkdir dir="test/pmd"/>
<exec executable="${pmd.home}/bin/pmd.sh"
output="test/pmd/output.txt">
<arg line="src"/>
<arg line="emacs"/>
<arg line="test/pmd/ruleset.xml"/>
</exec>
</target>
<target name="run" depends="gogui.jar" description="Run GoGui">
<java jar="lib/gogui.jar" fork="true"/>
</target>
<target name="specialmac" depends="compile"
description="Compile special MAC classes depending on com.apple">
<javac srcdir="mac/src" source="1.5" deprecation="true" classpath="build"
listfiles="yes"
includes="net/sf/gogui/specialmac/RegisterSpecialMacHandler.java"/>
</target>
<target name="tags"
description="Build a TAGS file for Emacs" >
<exec executable="sh">
<arg line="-c 'etags `find src test/junit/src -name "*.java"`'" />
</exec>
</target>
<target name="test-depend">
<depend srcdir="test" destdir="build/test" cache="build/depcache-test"/>
</target>
<target name="version" depends="version-check-uptodate"
unless="version-uptodate">
<copy
file="src/net/sf/gogui/version/Version.java.in"
tofile="src/net/sf/gogui/version/Version.java" overwrite="true"/>
<replace file="src/net/sf/gogui/version/Version.java" token="@VERSION@"
value="${version}"/>
<copy
file="doc/manual/xml/version.xml.in"
tofile="doc/manual/xml/version.xml" overwrite="true"/>
<replace file="doc/manual/xml/version.xml" token="@VERSION@"
value="${version}"/>
<copy
file="mac/packaging/Info.plist.in"
tofile="mac/packaging/Info.plist" overwrite="true"/>
<replace file="mac/packaging/Info.plist" token="@VERSION@" value="${version}"/>
<copy
file="config/gogui-C.omf.in" tofile="config/gogui-C.omf" overwrite="true"/>
<replace file="config/gogui-C.omf" token="@DATE@" value="${DSTAMP}"/>
</target>
<target name="version-check-uptodate">
<loadfile property="version_java_contents" failonerror="false"
srcFile="src/net/sf/gogui/version/Version.java"/>
<condition property="version-uptodate">
<contains string="${version_java_contents}" substring=""${version}""/>
</condition>
</target>
</project>