-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
859 lines (807 loc) · 26.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
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
<?xml version="1.0"?>
<!--
Build file for Apache Ant (http://ant.apache.org/)
-->
<project name="GoGui" default="build">
<property name="version" value="1.4.10"/>
<tstamp>
<format property="dstamp" pattern="yyyy-MM-dd" timezone="UCT"/>
</tstamp>
<filter token="VERSION" value="${version}"/>
<filter token="DATE" value="${dstamp}"/>
<property environment="env"/>
<property name="findbugs.home" value="${env.FINDBUGS_HOME}"/>
<property name="pmd.home" value="${env.PMD_HOME}"/>
<property name="launch4j" value="launch4jc.exe"/>
<property name="makensis" value="makensis"/>
<property name="xsltproc" value="xsltproc"/>
<property name="docbook-xsl.dir"
value="/usr/share/xml/docbook/stylesheet/docbook-xsl"/>
<property name="docbook.dtd-4.2"
value="/usr/share/xml/docbook/schema/dtd/4.2/docbookx.dtd"/>
<property name="osx.setfile" value="/Developer/Tools/SetFile"/>
<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 file="${docbook-xsl.dir}" type="dir"
property="docbook.xsl-available"/>
<available file="${docbook.dtd-4.2}" property="docbook.dtd-4.2-available"/>
<condition property="quaqua.available">
<available file="lib/quaqua.jar"/>
</condition>
<zipfileset id="distfiles-src" prefix="gogui-${version}" dir="."
includes="
README.html
COPYING.html
INSTALL.html
build.xml
config/go.dtd
config/gogui.desktop
config/gogui.thumbnailer
config/gogui.png
config/application-x-go-sgf.png
config/gogui.schemas
config/gogui-mime.xml
doc/README.html
doc/manual/xml/*.xml
doc/manual/xml/*.xml.in
doc/manual/xml/*.xsl
doc/doxygen/Doxyfile
doc/doxygen/footer.html
doc/doxygen/README.html
mac/packaging/GoGui.icns
mac/packaging/Info.plist.in
mac/packaging/PkgInfo
mac/src/com/apple/eawt/Application.java
mac/src/com/apple/eawt/ApplicationEvent.java
mac/src/com/apple/eawt/ApplicationListener.java
mac/src/com/apple/eawt/ApplicationAdapter.java
mac/src/net/sf/gogui/specialmac/RegisterSpecialMacHandler.java
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
windows/icons/gogui.ico
windows/icons/sgf.ico
windows/l4j/*.xml
windows/l4j/*.xml.in
windows/nsis/License.txt
windows/nsis/install.nsis.in
"
excludes="
doc/manual/xml/version.xml
src/net/sf/gogui/version/Version.java
windows/l4j/gogui.xml
"
/>
<zipfileset id="distfiles-src-scripts" 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,
"/>
<zipfileset id="distfiles-nonsrc" prefix="gogui-${version}" dir="." includes="
doc/manual/html/*.html
doc/manual/html/*.png
doc/manual/man/*.1
lib/*.jar
mac/packaging/Info.plist
windows/nsis/install.nsis
"/>
<target name="build"
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="check-quaqua" unless="quaqua.ignore">
<fail unless="quaqua.available">
lib/quaqua.jar not found.
Please download the Quaqua Look and Feel (http://www.randelshofer.ch/quaqua)
and copy the file quaqua.jar from the distribution to lib/quaqua.jar. The
last version tested with GoGui was:
http://www.randelshofer.ch/quaqua/files/quaqua-5.2.1.nested.zip
To compile GoGui with limited Mac support, you can invoke ant with the
option -Dquaqua.ignore=true.
</fail>
</target>
<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
"
/>
</delete>
</target>
<target name="clean-build-dir">
<delete failonerror="false" includeEmptyDirs="true">
<fileset dir="build/classes"/>
<fileset dir="build/depcache"/>
<fileset dir="build/depcache-test"/>
<fileset dir="build/manifests"/>
<fileset dir="build/specialmac"/>
<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"/>
<mkdir dir="build/classes"/>
<javac srcdir="src" destdir="build/classes" source="1.5" target="1.5"
deprecation="true" debug="true" listfiles="yes" includeAntRuntime="false">
<compilerarg value="-Xlint:unchecked"/>
</javac>
<copy todir="build/classes">
<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/classes/net/sf/gogui/doc">
<fileset dir="doc/manual/html" includes="*.html *.png"/>
</copy>
<mkdir dir="build/specialmac"/>
<javac srcdir="mac/src" destdir="build/specialmac" source="1.5"
deprecation="true" classpath="build/classes" listfiles="yes"
includeAntRuntime="false"
includes="
net/sf/gogui/specialmac/RegisterSpecialMacHandler.java
com/apple/eawt/*.java
"/>
</target>
<target name="depend">
<depend srcdir="src" destdir="build/classes" cache="build/depcache"/>
</target>
<target name="dist" depends="build,check,dist-nocheck">
</target>
<target name="dist-nocheck" depends="build">
<zip destfile="gogui-${version}.zip">
<zipfileset refid="distfiles-src"/>
<zipfileset refid="distfiles-src-scripts"/>
<zipfileset refid="distfiles-nonsrc"/>
</zip>
</target>
<target name="dist-src">
<tar destfile="gogui-${version}-src.tar">
<zipfileset refid="distfiles-src"/>
<zipfileset refid="distfiles-src-scripts"/>
</tar>
<gzip src="gogui-${version}-src.tar" destfile="gogui-${version}-src.tar.gz"/>
<delete file="gogui-${version}-src.tar"/>
</target>
<target name="doc" depends="doc-check-uptodate"
unless="doc-uptodate"
description="Generate documentation using xsltproc">
<fail unless="docbook.xsl-available">
Docbook XSL files not found in
${docbook-xsl.dir}
Please install the docbook-xsl package or download the XSL files from
http://sourceforge.net/projects/docbook/files/docbook-xsl
and invoke ant with the option -Ddocbook-xsl.dir=directory
with "directory" replaced by the location of the docbook-xsl directory.
</fail>
<echo message="Running xsltproc"/>
<exec executable="${xsltproc}" failonerror="true">
<arg line="--path ${docbook-xsl.dir}/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" failonerror="true">
<arg line="--param chunk.quietly 1"/>
<arg line="-o doc/manual/man/"/>
<arg line="${docbook-xsl.dir}/manpages/docbook.xsl"/>
<arg line="doc/manual/xml/manpages.xml"/>
</exec>
</target>
<!--
Generate documentation using ant xslt 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-xslt" depends="doc-check-uptodate"
unless="doc-uptodate">
<xslt basedir="doc/manual/xml" includes="book.xml" destdir="doc/manual/html"
style="${docbook-xsl.dir}/html/chunk.xsl" force="true">
<xmlcatalog>
<dtd
publicId="http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl"
location="${docbook-xsl.dir}/html/chunk.xsl"/>
</xmlcatalog>
</xslt>
</target>
<target name="docvalidate">
<fail unless="docbook.dtd-4.2-available">
Docbook DTD file not found in
${docbook.dtd-4.2}
Please install the docbook-xml package or download the DTD files from
http://www.oasis-open.org/docbook/xml/4.2/docbook-xml-4.2.zip
and invoke ant with the option -Ddocbook.dtd-4.2=location
with "location" replaced by the location of the file docbookx.dtd.
</fail>
<xmlvalidate file="doc/manual/xml/book.xml">
<xmlcatalog>
<dtd publicId="-//OASIS//DTD DocBook XML V4.2//EN"
location="${docbook.dtd-4.2}"/>
</xmlcatalog>
</xmlvalidate>
</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="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="build"
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="${osx.setfile}" failonerror="true">
<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-manifest-classpath" unless="quaqua.ignore">
<manifest file="build/manifests/gogui.mf" mode="update">
<attribute name="Class-Path" value="quaqua.jar"/>
</manifest>
</target>
<target name="gogui-manifest">
<mkdir dir="build"/>
<mkdir dir="build/manifests"/>
<manifest file="build/manifests/gogui.mf" mode="replace">
<attribute name="Main-Class" value="net.sf.gogui.gogui.MainWrapper"/>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Build-Date" value="${dstamp}"/>
</manifest>
</target>
<target name="gogui.jar"
depends="compile,check-quaqua,gogui-manifest,gogui-manifest-classpath">
<mkdir dir="lib"/>
<jar destfile="lib/gogui.jar" manifest="build/manifests/gogui.mf"
compress="true" level="9">
<fileset dir="build/classes" 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="build/specialmac" includes="
net/sf/gogui/specialmac/*.class
"/>
</jar>
</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}"/>
</manifest>
<fileset dir="build/classes" 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}"/>
</manifest>
<fileset dir="build/classes" 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}"/>
</manifest>
<fileset dir="build/classes" 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-manifest-classpath" unless="quaqua.ignore">
<manifest file="build/manifests/gogui-display.mf" mode="update">
<attribute name="Class-Path" value="quaqua.jar"/>
</manifest>
</target>
<target name="gogui-display-manifest">
<mkdir dir="build"/>
<mkdir dir="build/manifests"/>
<manifest file="build/manifests/gogui-display.mf" mode="replace">
<attribute name="Main-Class" value="net.sf.gogui.tools.display.Main"/>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Build-Date" value="${dstamp}"/>
</manifest>
</target>
<target name="gogui-display.jar"
depends="compile,check-quaqua,gogui-display-manifest,gogui-display-manifest-classpath">
<mkdir dir="lib"/>
<jar destfile="lib/gogui-display.jar"
manifest="build/manifests/gogui-display.mf" compress="true" level="9">
<fileset dir="build/classes" 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>
</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}"/>
</manifest>
<fileset dir="build/classes" 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}"/>
</manifest>
<fileset dir="build/classes" 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}"/>
</manifest>
<fileset dir="build/classes" 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}"/>
</manifest>
<fileset dir="build/classes" 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}"/>
</manifest>
<fileset dir="build/classes" 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/ByteCountInputStream.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}"/>
</manifest>
<fileset dir="build/classes" 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}"/>
</manifest>
<fileset dir="build/classes" 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="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/classes"/>
<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/classes">
<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="l4j" depends="build"
description="Create Windows jar wrappers using launch4j (launch4j.sourceforge.net)">
<!--
Use absolute paths for launch4j arguments to make it work with the
launch4j Unix script included in Launch4j 3.0.2, which changes the
working directory before running launch4j.jar
-->
<exec executable="${launch4j}" failonerror="true">
<arg line="${basedir}/windows/l4j/gogui.xml"/>
</exec>
<exec executable="${launch4j}" failonerror="true">
<arg line="${basedir}/windows/l4j/gogui-adapter.xml"/>
</exec>
<exec executable="${launch4j}" failonerror="true">
<arg line="${basedir}/windows/l4j/gogui-client.xml"/>
</exec>
<exec executable="${launch4j}" failonerror="true">
<arg line="${basedir}/windows/l4j/gogui-convert.xml"/>
</exec>
<exec executable="${launch4j}" failonerror="true">
<arg line="${basedir}/windows/l4j/gogui-display.xml"/>
</exec>
<exec executable="${launch4j}" failonerror="true">
<arg line="${basedir}/windows/l4j/gogui-dummy.xml"/>
</exec>
<exec executable="${launch4j}" failonerror="true">
<arg line="${basedir}/windows/l4j/gogui-regress.xml"/>
</exec>
<exec executable="${launch4j}" failonerror="true">
<arg line="${basedir}/windows/l4j/gogui-server.xml"/>
</exec>
<exec executable="${launch4j}" failonerror="true">
<arg line="${basedir}/windows/l4j/gogui-statistics.xml"/>
</exec>
<exec executable="${launch4j}" failonerror="true">
<arg line="${basedir}/windows/l4j/gogui-terminal.xml"/>
</exec>
<exec executable="${launch4j}" failonerror="true">
<arg line="${basedir}/windows/l4j/gogui-thumbnailer.xml"/>
</exec>
<exec executable="${launch4j}" failonerror="true">
<arg line="${basedir}/windows/l4j/gogui-twogtp.xml"/>
</exec>
</target>
<target name="nsis" depends="l4j,dist-src"
description="Create Windows installer using NSIS (nsis.sourceforge.net)">
<copy file="windows/nsis/install.nsis.in" tofile="windows/nsis/install.nsis"
overwrite="true" filtering="true"/>
<exec executable="${makensis}" failonerror="true">
<arg line="windows/nsis/install.nsis"/>
</exec>
</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="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"
filtering="true"/>
<copy file="doc/manual/xml/version.xml.in"
tofile="doc/manual/xml/version.xml" overwrite="true" filtering="true"/>
<copy file="mac/packaging/Info.plist.in"
tofile="mac/packaging/Info.plist" overwrite="true" filtering="true"/>
<copy file="windows/l4j/gogui.xml.in" tofile="windows/l4j/gogui.xml"
overwrite="true" filtering="true"/>
</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>