File: build.xml

package info (click to toggle)
syndie 1.107b-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 12,424 kB
  • sloc: java: 82,446; xml: 1,836; sh: 292; python: 52; makefile: 17
file content (1559 lines) | stat: -rw-r--r-- 75,964 bytes parent folder | download | duplicates (2)
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
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
<?xml version="1.0" encoding="UTF-8"?>
<project name="syndie" default="usage" basedir=".">
    <description>Builds, tests and runs the project syndie.</description>
    <!--
        Include property files so that values can be easily overridden.
        Users should create an override.properties file to make changes.
     -->
    <property file="override.properties"/>
    <property file="build.properties"/>


    <!-- Set some global properties up -->
    <property name="src.dir" value="src" />
    <property name="data.dir" value="data" />
    <property name="build.dir" value="build" />
    <property name="dist.dir" value="dist" />
    <property name="lib.dir" value="lib" />
    <property name="pkgtemp.dir" value="pkg-temp" />
    <property name="pkgtemp.lib" value="${pkgtemp.dir}/lib" />
    <property name="i2p.src.dir" value="../i2p.i2p" />
    <property name="i2psnark.jar" value="${i2p.src.dir}/build/i2psnark.jar" />
    <property name="launch4j.dir" value="${i2p.src.dir}/installer/lib/launch4j" />
    <property name="izpack.dir" value="${i2p.src.dir}/installer/lib/izpack" />
    <property name="desktop.class" value="syndie.gui.desktop.DesktopMain" />
    <property name="tabs.class" value="syndie.gui.SWTUI" />
    <property name="cli.class" value="syndie.db.TextUI" />
    <property name="swt.dir" value="${basedir}/swt/lib" />
    <property name="swt.lin32" value="${swt.dir}/swt-lin32.jar" />
    <property name="swt.lin64" value="${swt.dir}/swt-lin64.jar" />
    <property name="swt.win32" value="${swt.dir}/swt-win32.jar" />
    <property name="swt.win64" value="${swt.dir}/swt-win64.jar" />
    <property name="swt.mac32" value="${swt.dir}/swt-mac32.jar" />
    <property name="swt.mac64" value="${swt.dir}/swt-mac64.jar" />
    <property name="tab" value="    " />
    <property name="javac.compilerargs" value="" />
    <property name="javac.version" value="1.6" />
    <property name="require.gettext" value="true" />
    <condition property="no.bundle">
        <isfalse value="${require.gettext}" />
    </condition>

    <!-- allow lib locations to be overridden -->
    <property name="hsqldb.jar" value="${lib.dir}/hsqldb.jar" />
    <property name="i2p.jar" value="${lib.dir}/i2p.jar" />
    <property name="swt.jar" value="${lib.dir}/swt.jar" />
    <available property="launch4j.available" file="${launch4j.dir}/launch4j.jar" type="file" />
    <available property="pack200.available" file="${java.home}/bin/pack200" type="file" />

    <!-- Set some classpaths up -->
    <path id="classpath.build">
        <pathelement location="${hsqldb.jar}" />
        <pathelement location="${i2p.jar}" />
        <pathelement location="${swt.jar}" />
    </path>
    <path id="classpath.run">
        <pathelement location="${build.dir}/syndie.jar" />
        <path refid="classpath.build" />
    </path>

    <!-- Set up a fileset for the resources -->
    <path id="resources.path">
        <fileset dir="${data.dir}" />
    </path>

    <path id="cli.resources.path">
        <fileset dir="${data.dir}" excludes="syndie/gui/** syndie/html/** syndie/trac/** com/** syndie/locale/** imports/Browser/** imports/DesktopUI/**" />
    </path>

    <target name="help" depends="usage" />
    <target name="usage">
        <echo message="Useful targets:" />
        <echo message="       clean: ${tab}Clean up the workspace" />
        <echo message="   distclean: ${tab}Clean up all generated files" />
        <echo message="         jar: ${tab}Create syndie.jar in build/ without the dependencies"/>
        <echo message="     jar-cli: ${tab}Create syndie-cli.jar in build/ without the dependencies"/>
        <echo message="    javadocs: ${tab}Generate javadocs for ${ant.project.name}" />
        <echo message="  maintainer: ${tab}Display targets for building installers/packages for ${ant.project.name}" />
        <echo message="         pkg: ${tab}Generate jar files and copy docs to ./dist" />
        <echo message="     pkg-exe: ${tab}Same as pkg but also wraps jar files with launch4j into EXE files" />
        <echo message="    poupdate: ${tab}Update PO files for translators" />
        <echo message="         run: ${tab}Run ${ant.project.name} with the 'Tabs' interface" />
        <echo message=" run-desktop: ${tab}Run ${ant.project.name} with the alternative 'Desktop' interface" />
        <echo message="   singlejar: ${tab}Create a single syndie.jar in ${basedir} containing dependencies for YOUR system"/>
        <echo message="totallyclean: ${tab}Clean up all generated files and any files downloaded during the build (e.g. SWT)" />
    </target>

    <target name="maintainer">
        <echo message="Useful targets for ${ant.project.name} maintainers:" />
        <echo message="              clean: ${tab}Clean up the workspace" />
        <echo message="          distclean: ${tab}Clean up all generated files" />
        <echo message="      installer-all: ${tab}Create 32- and 64-bit installers for all supported OSes"/>
        <echo message="    installer-linux: ${tab}Create 32- and 64-bit installers for Linux"/>
        <echo message="  installer-linux32: ${tab}Create 32-bit Linux installer"/>
        <echo message="  installer-linux64: ${tab}Create 64-bit Linux installer"/>
        <echo message="      installer-osx: ${tab}Create 32- and 64-bit installers for OSX"/>
        <echo message="    installer-osx32: ${tab}Create 32-bit OSX installer"/>
        <echo message="    installer-osx64: ${tab}Create 64-bit OSX installer"/>
        <echo message="  installer-windows: ${tab}Create 32- and 64-bit installers for Windows, wrapped with launch4j (if available)"/>
        <echo message="installer-windows32: ${tab}Create 32-bit Windows installer (add -exe to use launch4j, if available)"/>
        <echo message="installer-windows64: ${tab}Create 64-bit Windows installer (add -exe to use launch4j, if available)"/>
        <echo message="            pkg-all: ${tab}Create installers and packages for all supported systems" />
        <echo message="            pkg-osx: ${tab}Create 32- and 64-bit Application Bundles for OSX" />
        <echo message="          pkg-osx32: ${tab}Create 32-bit OSX Application Bundle" />
        <echo message="          pkg-osx64: ${tab}Create 64-bit OSX Application Bundle" />
        <echo message="             plugin: ${tab}Create signed I2P plugins for all supported systems" />
        <echo message="            release: ${tab}Create all pkgs/installers with the &quot;pkg-all&quot; target, sign with gpg, generate sha256 checksum files, and update files in doc/web" />
        <echo message="     source-tarball: ${tab}Create source tarball" />
        <echo message="       totallyclean: ${tab}Clean up all generated files and any files downloaded during the build (e.g. SWT)" />
    </target>

    <macrodef name="make-stub-jar">
        <attribute name="name" default="" />
        <attribute name="type-class" />
        <attribute name="additional" default=""/>
        <sequential>
            <jar destfile="${pkgtemp.dir}/bin/syndie@{name}.jar">
                <manifest>
                    <attribute name="Main-Class" value="@{type-class}" />
                    <attribute name="Class-Path" value="../lib/i2p.jar ../lib/hsqldb.jar ../lib/syndie.jar @{additional}" />
                    <attribute name="Built-By" value="${build.built-by}" />
                    <attribute name="Build-Date" value="${build.timestamp}" />
                    <attribute name="Base-Revision" value="${workspace.version}" />
                </manifest>
            </jar>
        </sequential>
    </macrodef>

    <macrodef name="make-stub-jar-debian">
        <attribute name="name" default="" />
        <attribute name="type-class" />
        <attribute name="additional" default=""/>
        <sequential>
            <jar destfile="${pkgtemp.dir}/bin/syndie@{name}.jar">
                <manifest>
                    <attribute name="Main-Class" value="@{type-class}" />
                    <attribute name="Class-Path" value="${i2p.jar} ${hsqldb.jar} /usr/share/syndie/syndie.jar @{additional}" />
                    <attribute name="Built-By" value="${build.built-by}" />
                    <attribute name="Build-Date" value="${build.timestamp}" />
                    <attribute name="Base-Revision" value="${workspace.version}" />
                </manifest>
            </jar>
        </sequential>
    </macrodef>

    <macrodef name="repack">
        <attribute name="jarname" />
        <sequential>
            <fail unless="pack200.available">Pack200 not found!</fail>
            <exec executable="${java.home}/bin/pack200" failonerror="true">
                <arg value="-r" />
                <arg value="@{jarname}" />
            </exec>
        </sequential>
    </macrodef>

    <macrodef name="wrap-to-exe">
        <attribute name="type" default=""/>
        <sequential>
            <local name="launch4j.config" />
            <tempfile property="launch4j.config" deleteonexit="true" />
            <fail unless="launch4j.available">Specify the location of the Launch4J installation directory with -Dlaunch4j.dir=/some/path/to/launch4j.jar</fail>
            <taskdef name="launch4j" classpath="${launch4j.dir}/launch4j.jar:${launch4j.dir}/lib/xstream.jar"
                classname="net.sf.launch4j.ant.Launch4jTask" />

            <echo file="${launch4j.config}"><![CDATA[
                <launch4jConfig>
                    <headerType>0</headerType>
                    <jar>${pkgtemp.dir}/bin/syndie@{type}.jar</jar>
                    <outfile>${pkgtemp.dir}/bin/syndie@{type}.exe</outfile>
                    <errTitle>Syndie-@{type}</errTitle>
                    <chdir>.</chdir>
                    <icon>doc/web/favicon.ico</icon>
                    <jre><minVersion>1.6.0</minVersion></jre>
                    <versionInfo>
                        <fileVersion>0.0.0.0</fileVersion>
                        <productVersion>0.0.0.0</productVersion>
                        <txtFileVersion>syndie-@{type}-${full.version}</txtFileVersion>
                        <txtProductVersion>${full.version}</txtProductVersion>
                        <fileDescription>Syndie @{type} Launcher</fileDescription>
                        <copyright>copyright is theft</copyright>
                        <productName>Syndie ${full.version}</productName>
                        <internalName>syndie</internalName>
                        <originalFilename>syndie@{type}.exe</originalFilename>
                    </versionInfo>
                </launch4jConfig>
                ]]></echo>

            <launch4j configFile="${launch4j.config}" />
        </sequential>
    </macrodef>

    <macrodef name="wrap-installer">
        <attribute name="bits" />
        <sequential>
            <local name="launch4j.config" />
            <tempfile property="launch4j.config" deleteonexit="true" />
            <fail unless="launch4j.available">Specify the location of the Launch4J installation directory with -Dlaunch4j.dir=/some/path/to/launch4j.jar</fail>
            <taskdef name="launch4j" classpath="${launch4j.dir}/launch4j.jar:${launch4j.dir}/lib/xstream.jar"
                classname="net.sf.launch4j.ant.Launch4jTask" />

            <echo file="${launch4j.config}"><![CDATA[
                <launch4jConfig>
                    <headerType>0</headerType>
                    <jar>syndie-installer-${syndie.release.version}.bin.win@{bits}.jar</jar>
                    <outfile>syndie-installer-${syndie.release.version}.bin.win@{bits}.exe</outfile>
                    <errTitle>Syndie ${full.version} installer</errTitle>
                    <chdir>.</chdir>
                    <icon>doc/web/favicon.ico</icon>
                    <jre><minVersion>1.6.0</minVersion></jre>
                    <versionInfo>
                        <fileVersion>0.0.0.0</fileVersion>
                        <productVersion>0.0.0.0</productVersion>
                        <txtFileVersion>syndie-${full.version} Windows @{bit}bit</txtFileVersion>
                        <txtProductVersion>${full.version}</txtProductVersion>
                        <fileDescription>Syndie ${full.version} Installation Launcher</fileDescription>
                        <copyright>copyright is theft</copyright>
                        <productName>Syndie ${full.version}</productName>
                        <internalName>syndie</internalName>
                        <originalFilename>syndie-installer-${full.version}.bin.win@{bits}.exe</originalFilename>
                    </versionInfo>
                </launch4jConfig>
                ]]></echo>

            <launch4j configFile="${launch4j.config}" />
            <delete file="syndie-installer-${syndie.release.version}.bin.win@{bits}.jar" />
        </sequential>
    </macrodef>

    <macrodef name="sign-and-sum">
        <attribute name="file" />
        <sequential>
            <exec executable="gpg" failonerror="true">
                <arg value="-b" />
                <arg value="-u" />
                <arg value="${release.gpg.keyid}" />
                <arg value="@{file}" />
            </exec>
            <checksum format="MD5SUM" file="@{file}" algorithm="sha-256" fileext=".sha256"/>
        </sequential>
    </macrodef>

    <macrodef name="make-torrent">
        <attribute name="file" />
        <sequential>
            <java classname="org.klomp.snark.Storage" fork="false" failonerror="true">
                <classpath>
                    <pathelement location="${i2p.jar}" />
                    <pathelement location="${i2psnark.jar}" />
                </classpath>
                <arg value="-a" />
                <arg value="http://tracker2.postman.i2p/announce.php" />
                <arg value="@{file}" />
            </java>
        </sequential>
    </macrodef>

<macrodef name="build-installer">
    <attribute name="os" />
    <attribute name="swt" />
    <attribute name="arch" />

    <sequential>
        <taskdef name="izpack" classpath="build/izpackpatch.jar:${izpack.dir}/standalone-compiler.jar"
                 classname="com.izforge.izpack.ant.IzPackTask" />
             <jar destfile="build/izpackpatch.jar"
                 basedir="resources/izpack/patches" />
        <delete file="${pkgtemp.dir}/lib/swt.jar" />
        <copy file="${i2p.src.dir}/installer/resources/i2plogo.png" tofile="resources/i2plogo.png" />
        <copy file="resources/uninstall.ico" todir="${pkgtemp.dir}/doc/Uninstaller" />
        <copy tofile="${pkgtemp.dir}/lib/swt.jar" file="@{swt}" />
        <ant target="repack-swt" />
        <izpack output="syndie-installer-${syndie.release.version}.bin.@{os}@{arch}.jar"
                installerType="standard"
                basedir="."
                izPackDir="${izpack.dir}/">
            <config><![CDATA[
<installation version="1.0">
    <info>
        <!--<pack200/> -->
        <appname>Syndie</appname>
        <appversion>@{full.version}</appversion>
        <appsubpath>syndie</appsubpath>
        <authors>
            <author name="Syndie development team" email="http://syndie.i2p2.de" />
        </authors>
        <url>http://syndie.i2p2.de</url>
        <javaversion>1.6</javaversion>
        <summarylogfilepath>$INSTALL_PATH/install.log</summarylogfilepath>
        <run-privileged condition="izpack.windowsinstall.vista|izpack.windowsinstall.7"/>
    </info>
    <variables>
        <variable name="desktopshortcutcheckboxenabled" value="true" />
    </variables>
    <guiprefs width="590" height="356" resizable="yes">
      <!--
        <modifier key="labelFontSize" value="1.2" />
       -->
        <laf name="liquid">
            <os family="unix"/>
        </laf>
        <modifier key="langDisplayType" value="native" />
    </guiprefs>
    <locale>
        <langpack iso3="eng"/>
        <langpack iso3="cat"/>
        <langpack iso3="chn"/>
        <langpack iso3="cze"/>
        <langpack iso3="dan"/>
        <langpack iso3="deu"/>
        <langpack iso3="ell"/>
        <langpack iso3="fa"/>
        <langpack iso3="fin"/>
        <langpack iso3="fra"/>
        <langpack iso3="glg"/>
        <langpack iso3="hun"/>
        <langpack iso3="ind"/>
        <langpack iso3="ita"/>
        <langpack iso3="jpn"/>
        <langpack iso3="kor"/>
        <langpack iso3="mys"/>
        <langpack iso3="ned"/>
        <langpack iso3="nor"/>
        <langpack iso3="pol"/>
        <langpack iso3="por"/>
        <langpack iso3="rom"/>
        <langpack iso3="rus"/>
        <langpack iso3="scg"/>
        <langpack iso3="spa"/>
        <langpack iso3="svk"/>
        <langpack iso3="swe"/>
        <langpack iso3="tur"/>
        <langpack iso3="twn"/>
        <langpack iso3="ukr"/>
    </locale>
    <native type="izpack" name="ShellLink.dll" />
    <native type="izpack" name="ShellLink_x64.dll" />
    <resources>
        <res id="Installer.image" src="resources/i2plogo.png" />
        <res id="shortcutSpec.xml" src="resources/Win_shortcutSpec.xml" />
        <res id="Unix_shortcutSpec.xml" src="resources/Unix_shortcutSpec.xml" />
    </resources>

    <panels>
        <panel classname="HelloPanel"/>
        <panel classname="TargetPanel"/>
        <panel classname="SummaryPanel"/>
        <panel classname="InstallPanel"/>
        <panel classname="ShortcutPanel"><os family="windows" /></panel>
        <panel classname="SimpleFinishPanel"/>
    </panels>
    <packs>
        <pack name="Base" required="yes">
            <description>Base installation files</description>
            <fileset dir="pkg-temp" includes="**/*" targetdir="$INSTALL_PATH"/>
            <!-- Windows stub EXEs -->
            <executable targetfile="$INSTALL_PATH/bin/syndie.exe" type="bin" stage="never" keep="true" failure="warn">
                <os family="windows" />
            </executable>
            <executable targetfile="$INSTALL_PATH/bin/syndie-desktop.exe" type="bin" stage="never" keep="true" failure="warn">
                <os family="windows" />
            </executable>

            <!-- substitute variables in the Linux scripts -->
            <parsable targetfile="$INSTALL_PATH/bin/syndie-cli.sh" type="shell" failure="warn">
                <os name="Linux" />
            </parsable>
            <parsable targetfile="$INSTALL_PATH/bin/syndie.sh" type="shell" failure="warn">
                <os name="Linux" />
            </parsable>
            <parsable targetfile="$INSTALL_PATH/bin/syndie-desktop.sh" type="shell" failure="warn">
                <os name="Linux" />
            </parsable>

            <!-- set Linux scripts to be executable -->
            <executable targetfile="$INSTALL_PATH/bin/syndie-desktop.sh" type="shell" stage="never" keep="true" failure="warn">
                <os name="Linux" />
            </executable>
            <executable targetfile="$INSTALL_PATH/bin/syndie-cli.sh" type="shell" stage="never" keep="true" failure="warn">
                <os name="Linux" />
            </executable>
            <executable targetfile="$INSTALL_PATH/bin/syndie.sh" type="shell" stage="never" keep="true" failure="warn">
                <os name="Linux" />
            </executable>

            <!-- substitute variables in the OSX scripts -->
            <parsable targetfile="$INSTALL_PATH/bin/syndie.command" type="shell" failure="warn">
                <os family="mac" />
            </parsable>
            <parsable targetfile="$INSTALL_PATH/bin/syndie-cli.sh" type="shell" failure="warn">
                <os family="mac" />
            </parsable>
            <parsable targetfile="$INSTALL_PATH/bin/syndie-desktop.command" type="shell" failure="warn">
                <os family="mac" />
            </parsable>

            <!-- set OSX scripts to be executable -->
            <executable targetfile="$INSTALL_PATH/bin/syndie.command" type="shell" stage="never" keep="true" failure="warn">
                <os family="mac" />
            </executable>
            <executable targetfile="$INSTALL_PATH/bin/syndie-cli.sh" type="shell" stage="never" keep="true" failure="warn">
                <os family="mac" />
            </executable>
            <executable targetfile="$INSTALL_PATH/bin/syndie-desktop.command" type="shell" stage="never" keep="true" failure="warn">
                <os family="mac" />
            </executable>
        </pack>
    </packs>

</installation>
]]></config>
        </izpack>
    </sequential>
</macrodef>

    <target name="init" depends="buildProperties">
        <!-- abort the build right away in case deps cannot be found -->
        <available property="have.i2p" file="${i2p.jar}" type="file" />
        <fail message="Cannot find ${i2p.jar}. Please read INSTALL and build.properties for advice.">
            <condition>
                <not>
                    <istrue value="${have.i2p}" />
                </not>
            </condition>
        </fail>
        <available property="have.hsqldb" file="${hsqldb.jar}" type="file" />
        <fail message="Cannot find ${hsqldb.jar}. Please read INSTALL and build.properties for advice.">
            <condition>
                <not>
                    <istrue value="${have.hsqldb}" />
                </not>
            </condition>
        </fail>
        <mkdir dir="${dist.dir}" />
        <mkdir dir="${build.dir}/obj" />
        <mkdir dir="${build.dir}/cli-obj" />
    </target>

    <condition property="depend.available">
        <typefound name="depend" />
    </condition>

    <target name="-depend" if="depend.available">
        <depend
            cache="builddep"
            srcdir="src"
            destdir="${build.dir}/obj">
            <classpath>
                <path refid="classpath.build" />
            </classpath>
        </depend>
    </target>

    <target name="compile" depends="init, -depend" description="compile the source">
        <available property="have.swt" file="${swt.jar}" type="file" />
        <fail message="Cannot find ${swt.jar}. Please read INSTALL and build.properties for advice.">
            <condition>
                <not>
                    <istrue value="${have.swt}" />
                </not>
            </condition>
        </fail>
        <javac srcdir="${src.dir}" destdir="${build.dir}/obj" debug="true" source="${javac.version}" target="${javac.version}"
               deprecation="on" includeAntRuntime="false">
            <compilerarg line="${javac.compilerargs}" />
            <classpath>
                <path refid="classpath.build" />
            </classpath>
        </javac>
    </target>

    <target name="compile-cli" depends="init" description="compile just the cli">
        <delete dir="${build.dir}/cli-obj" />
        <mkdir dir="${build.dir}/cli-obj" />
        <javac srcdir="${src.dir}" destdir="${build.dir}/cli-obj" debug="true" source="${javac.version}" target="${javac.version}"
               excludes="syndie/gui/** syndie/trac/** com/** syndie/locale/** imports/Browser/** imports/DesktopUI/**"
               deprecation="on" includeAntRuntime="false">
            <compilerarg line="${javac.compilerargs}" />
            <classpath>
                <pathelement location="${i2p.jar}" />
                <pathelement location="${hsqldb.jar}" />
            </classpath>
        </javac>
    </target>

    <target name="bundle" depends="compile" description="process the translations" unless="no.bundle">
        <mkdir dir="build/messages-src" />
        <!-- Update the messages_*.po files -->
        <exec executable="sh" osfamily="unix" failifexecutionfails="true" failonerror="${require.gettext}" >
            <arg value="scripts/bundle-messages.sh" />
        </exec>
        <exec executable="sh" osfamily="mac" failifexecutionfails="true" failonerror="${require.gettext}" >
            <arg value="scripts/bundle-messages.sh" />
        </exec>
        <exec executable="sh" osfamily="windows" failifexecutionfails="false" >
            <arg value="scripts/bundle-messages.sh" />
        </exec>
        <javac source="${javac.version}" target="${javac.version}" 
               includeAntRuntime="false"
               srcdir="build/messages-src" destdir="build/obj">
            <compilerarg line="${javac.compilerargs}" />
        </javac>
    </target>

    <target name="poupdate" depends="compile" description="generate the translation files">
        <!-- Update the messages_*.po files.  -->
        <exec executable="sh" osfamily="unix" failifexecutionfails="true" failonerror="true" >
            <arg value="scripts/bundle-messages.sh" />
            <arg value="-p" />
        </exec>
        <exec executable="sh" osfamily="mac" failifexecutionfails="true" failonerror="true" >
            <arg value="scripts/bundle-messages.sh" />
            <arg value="-p" />
        </exec>
        <exec executable="sh" osfamily="windows" failifexecutionfails="true" failonerror="true" >
            <arg value="scripts/bundle-messages.sh" />
            <arg value="-p" />
        </exec>
    </target>

    <target name="jar" depends="compile, bundle" description="Build jar in ./build">
        <property name="build.built-by" value="unknown" />
        <jar jarfile="${build.dir}/syndie.jar">
            <fileset dir="${build.dir}/obj" />
            <path refid="resources.path" />
            <manifest>
                <attribute name="Built-By" value="${build.built-by}" />
                <attribute name="Build-Date" value="${build.timestamp}" />
                <attribute name="Base-revision" value="${workspace.version}" />
            </manifest>
        </jar>
    </target>

    <!-- note hardcoded hsqldb path, won't work for debian -->
    <target name="jar-cli" depends="compile-cli" description="Build jar with only the cli in ./build">
        <property name="build.built-by" value="unknown" />
        <jar jarfile="${build.dir}/syndie-cli.jar">
            <fileset dir="${build.dir}/cli-obj" />
            <path refid="cli.resources.path" />
            <manifest>
                <attribute name="Class-Path" value="../lib/i2p.jar ../lib/hsqldb.jar" />
                <attribute name="Built-By" value="${build.built-by}" />
                <attribute name="Build-Date" value="${build.timestamp}" />
                <attribute name="Base-revision" value="${workspace.version}" />
                <attribute name="Main-Class" value="syndie.db.TextUI" />
            </manifest>
        </jar>
    </target>

    <target name="dist" depends="pkg" />
    <target name="singlejar" depends="jar" description="Combine all jars">
        <copy file="${swt.jar}" tofile="${pkgtemp.lib}/swt.jar" />
        <copy file="${i2p.jar}" todir="${pkgtemp.lib}" />
        <copy file="${hsqldb.jar}" todir="${pkgtemp.lib}" />
        <jar jarfile="syndie.jar" index="true">
            <manifest>
                <attribute name="Main-Class" value="syndie.gui.SWTUI"/>
                <attribute name="Built-By" value="${build.built-by}" />
                <attribute name="Build-Date" value="${build.timestamp}" />
                <attribute name="Base-revision" value="${workspace.version}" />
            </manifest>
            <zipfileset src="${build.dir}/syndie.jar" includes="**" />
            <zipgroupfileset dir="${pkgtemp.lib}" includes="*.jar"/>
        </jar>
    </target>

    <target name="run" depends="jar" description="run Syndie with the 'Tabs' interface">
        <condition property="run.args" value="">
            <not>
                <isset property="run.args" />
            </not>
        </condition>
        <echo message="Running Syndie with args ${run.args}" />
        <java classname="syndie.gui.SWTUI" fork="true" failonerror="false">
            <arg line="${run.args}" />
            <classpath>
                <path refid="classpath.run" />
            </classpath>
        </java>
    </target>

    <target name="run-desktop" depends="jar" description="run Syndie with the 'Desktop' interface">
        <condition property="run.args" value="">
            <not>
                <isset property="run.args" />
            </not>
        </condition>
        <echo message="Running Syndie with args ${run.args}" />
        <java classname="syndie.gui.desktop.DesktopMain" fork="true" failonerror="false">
            <arg line="${run.args}" />
            <classpath>
                <path refid="classpath.run" />
            </classpath>
        </java>
    </target>

    <target name="-check-for-izpack">
        <available property="found.izpack" file="${izpack.dir}/standalone-compiler.jar" type="file" />
        <fail unless="found.izpack">The installer targets require izpack! Specify -Dizpack.dir=/path/to/standalone-compiler.jar</fail>
    </target>

    <target name="-check-launch4j" if="launch4j.available" description="Check if this system can run launch4j">
        <condition property="can.create.exe">
            <and>
                <or>
                    <os arch="x86" />
                    <os arch="i386" />
                    <os arch="i586" />
                    <os arch="i686" />
                    <os arch="amd64" />
                    <os arch="x86_64" />
                </or>
                <or>
                    <os name="Linux" />
                    <os family="windows" />
                </or>
            </and>
        </condition>
    </target>

    <target name="jars2exe" if="can.create.exe" unless="no.exe" depends="-check-launch4j, stub-jars" description="Wrap jar files into EXEs">
        <wrap-to-exe type="-desktop" />
        <wrap-to-exe />
    </target>

    <target name="plugin" depends="buildProperties, jar">
        <mkdir dir="plugin/lib" />
        <buildnumber file="scripts/build.number" />

        <!-- make the update xpi2p and su3 files, both 32 and 64 bit -->

        <delete file="plugin/lib/hsqldb.jar.pack" />
        <delete file="plugin/lib/swt.jar.pack" />
        <copy file="LICENSE" todir="plugin" />
        <copy file="src/com/LICENSE.txt" tofile="plugin/LICENSE-jazzy.txt" />
        <copy file="LICENSE-EPL-v1.0.html" todir="plugin" />
        <copy file="lib/hsqldb_lic.txt" todir="plugin" />
        <copy file="scripts/plugin-linux32.config" tofile="plugin/plugin.config" overwrite="true" />
        <copy file="scripts/clients-linux.config" tofile="plugin/clients.config" overwrite="true" />
        <exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
            <arg value="version=${full.version}-b${build.number}" />
        </exec>
        <exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
            <arg value="update-only=true" />
        </exec>
        <exec executable="${java.home}/bin/pack200" failonerror="true">
            <arg value="-g" />
            <arg value="plugin/lib/syndie.jar.pack" />
            <arg value="${build.dir}/syndie.jar" />
        </exec>
        <!-- include hsqldb.jar in the updater now -->
        <exec executable="${java.home}/bin/pack200" failonerror="true">
            <arg value="-g" />
            <arg value="plugin/lib/hsqldb.jar.pack" />
            <arg value="${hsqldb.jar}" />
        </exec>
        <input message="Enter su3 signing key password:" addproperty="release.password.su3" />
        <fail message="You must enter a password." >
            <condition>
                <equals arg1="${release.password.su3}" arg2=""/>
            </condition>
        </fail>
        <!-- make the linux update xpi2p and su3 files, 32 bit, no SWT -->
        <!-- this will fail if no su3 keys exist, as it needs the password twice -->
        <exec executable="scripts/makeplugin.sh" inputstring="${release.password.su3}" failonerror="true" >
            <arg value="plugin" />
        </exec>
        <move file="syndie.xpi2p" tofile="syndie-linux-i386-update.xpi2p" />
        <move file="syndie.su3" tofile="syndie-linux-i386-update.su3" />

        <!-- make the linux update xpi2p and su3 files, 64 bit, with SWT -->
        <!--
          -  These will not be used until the next update.
          -  We put an updated swt.jar in the 64-bit updates,
          -  but NOT the 32-bit one, since old 64-bit linux and mac installs
          -  will point to the 32-bit linux update.
          -->
        <copy file="scripts/plugin-linux64.config" tofile="plugin/plugin.config" overwrite="true" />
        <exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
            <arg value="version=${full.version}-b${build.number}" />
        </exec>
        <exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
            <arg value="update-only=true" />
        </exec>
        <ant dir="swt" target="ensure-lin64-swt" />
        <exec executable="${java.home}/bin/pack200" failonerror="true">
            <arg value="-g" />
            <arg value="plugin/lib/swt.jar.pack" />
            <arg value="${swt.lin64}" />
        </exec>
        <exec executable="scripts/makeplugin.sh" inputstring="${release.password.su3}" failonerror="true" >
            <arg value="plugin" />
        </exec>
        <move file="syndie.xpi2p" tofile="syndie-linux-x86-64-update.xpi2p" />
        <move file="syndie.su3" tofile="syndie-linux-x86-64-update.su3" />

        <!-- make the mac update xpi2p and su3 files, 64 bit, with SWT -->
        <copy file="scripts/plugin-mac64.config" tofile="plugin/plugin.config" overwrite="true" />
        <exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
            <arg value="version=${full.version}-b${build.number}" />
        </exec>
        <exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
            <arg value="update-only=true" />
        </exec>
        <ant dir="swt" target="ensure-mac64-swt" />
        <exec executable="${java.home}/bin/pack200" failonerror="true">
            <arg value="-g" />
            <arg value="plugin/lib/swt.jar.pack" />
            <arg value="${swt.mac64}" />
        </exec>
        <exec executable="scripts/makeplugin.sh" inputstring="${release.password.su3}" failonerror="true" >
            <arg value="plugin" />
        </exec>
        <move file="syndie.xpi2p" tofile="syndie-mac64-update.xpi2p" />
        <move file="syndie.su3" tofile="syndie-mac64-update.su3" />

        <!-- make the windows update xpi2p, 32 bit, no SWT -->
        <delete file="plugin/lib/swt.jar.pack" />
        <copy file="scripts/plugin-windows32.config" tofile="plugin/plugin.config" overwrite="true" />
        <exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
            <arg value="version=${full.version}-b${build.number}" />
        </exec>
        <exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
            <arg value="update-only=true" />
        </exec>
        <copy file="scripts/clients-windows.config" tofile="plugin/clients.config" overwrite="true" />
        <exec executable="scripts/makeplugin.sh" inputstring="${release.password.su3}" failonerror="true" >
            <arg value="plugin" />
        </exec>
        <move file="syndie.xpi2p" tofile="syndie-win32-update.xpi2p" />
        <move file="syndie.su3" tofile="syndie-win32-update.su3" />

        <!-- make the windows update xpi2p, 64 bit, with SWT -->
        <!--
          -  These will not be used until the next update.
          -  We put an updated swt.jar in the 64-bit updates,
          -  but NOT the 32-bit one, since old 64-bit windows installs
          -  will point to the 32-bit update.
          -->
        <copy file="scripts/plugin-windows64.config" tofile="plugin/plugin.config" overwrite="true" />
        <exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
            <arg value="version=${full.version}-b${build.number}" />
        </exec>
        <exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
            <arg value="update-only=true" />
        </exec>
        <ant dir="swt" target="ensure-mac64-swt" />
        <exec executable="${java.home}/bin/pack200" failonerror="true">
            <arg value="-g" />
            <arg value="plugin/lib/swt.jar.pack" />
            <arg value="${swt.mac64}" />
        </exec>
        <exec executable="scripts/makeplugin.sh" inputstring="${release.password.su3}" failonerror="true" >
            <arg value="plugin" />
        </exec>
        <move file="syndie.xpi2p" tofile="syndie-win64-update.xpi2p" />
        <move file="syndie.su3" tofile="syndie-win64-update.su3" />

        <!-- Make install xpi2p/su3 -->

        <!-- make the 32 bit linux install xpi2p/su3 -->
        <ant dir="swt" target="ensure-lin32-swt" />
        <copy file="scripts/LICENSE-swt.txt" todir="plugin" />
        <copy file="scripts/plugin-linux32.config" tofile="plugin/plugin.config" overwrite="true" />
        <copy file="scripts/clients-linux.config" tofile="plugin/clients.config" overwrite="true" />
        <exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
            <arg value="version=${full.version}-b${build.number}" />
        </exec>
        <exec executable="${java.home}/bin/pack200" failonerror="true">
            <arg value="-g" />
            <arg value="plugin/lib/swt.jar.pack" />
            <arg value="${swt.lin32}" />
        </exec>
        <exec executable="scripts/makeplugin.sh" inputstring="${release.password.su3}" failonerror="true" >
            <arg value="plugin" />
        </exec>
        <move file="syndie.xpi2p" tofile="syndie-linux-i386.xpi2p" />
        <move file="syndie.su3" tofile="syndie-linux-i386.su3" />

        <!-- make the 64 bit linux install xpi2p/su3 -->
        <ant dir="swt" target="ensure-lin64-swt" />
        <copy file="scripts/plugin-linux64.config" tofile="plugin/plugin.config" overwrite="true" />
        <exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
            <arg value="version=${full.version}-b${build.number}" />
        </exec>
        <exec executable="${java.home}/bin/pack200" failonerror="true">
            <arg value="-g" />
            <arg value="plugin/lib/swt.jar.pack" />
            <arg value="${swt.lin64}" />
        </exec>
        <exec executable="scripts/makeplugin.sh" inputstring="${release.password.su3}" failonerror="true" >
            <arg value="plugin" />
        </exec>
        <move file="syndie.xpi2p" tofile="syndie-linux-x86-64.xpi2p" />
        <move file="syndie.su3" tofile="syndie-linux-x86-64.su3" />

        <!-- macs use the linux clients config file -->
        <!-- make the 64 bit mac install xpi2p/su3 -->
        <ant dir="swt" target="ensure-mac64-swt" />
        <copy file="scripts/plugin-mac64.config" tofile="plugin/plugin.config" overwrite="true" />
        <exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
            <arg value="version=${full.version}-b${build.number}" />
        </exec>
        <exec executable="${java.home}/bin/pack200" failonerror="true">
            <arg value="-g" />
            <arg value="plugin/lib/swt.jar.pack" />
            <arg value="${swt.mac64}" />
        </exec>
        <exec executable="scripts/makeplugin.sh" inputstring="${release.password.su3}" failonerror="true" >
            <arg value="plugin" />
        </exec>
        <move file="syndie.xpi2p" tofile="syndie-mac64.xpi2p" />
        <move file="syndie.su3" tofile="syndie-mac64.su3" />

        <!-- make the 32 bit windows install xpi2p/su3 -->
        <ant dir="swt" target="ensure-win32-swt" />
        <copy file="scripts/plugin-windows32.config" tofile="plugin/plugin.config" overwrite="true" />
        <copy file="scripts/clients-windows.config" tofile="plugin/clients.config" overwrite="true" />
        <exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
            <arg value="version=${full.version}-b${build.number}" />
        </exec>
        <exec executable="${java.home}/bin/pack200" failonerror="true">
            <arg value="-g" />
            <arg value="plugin/lib/swt.jar.pack" />
            <arg value="${swt.win32}" />
        </exec>
        <exec executable="scripts/makeplugin.sh" inputstring="${release.password.su3}" failonerror="true" >
            <arg value="plugin" />
        </exec>
        <move file="syndie.xpi2p" tofile="syndie-win32.xpi2p" />
        <move file="syndie.su3" tofile="syndie-win32.su3" />

        <!-- make the 64 bit windows install xpi2p/su3 -->
        <ant dir="swt" target="ensure-win64-swt" />
        <copy file="scripts/plugin-windows64.config" tofile="plugin/plugin.config" overwrite="true" />
        <exec executable="echo" osfamily="unix" failonerror="true" output="plugin/plugin.config" append="true">
            <arg value="version=${full.version}-b${build.number}" />
        </exec>
        <exec executable="${java.home}/bin/pack200" failonerror="true">
            <arg value="-g" />
            <arg value="plugin/lib/swt.jar.pack" />
            <arg value="${swt.win64}" />
        </exec>
        <exec executable="scripts/makeplugin.sh" inputstring="${release.password.su3}" failonerror="true" >
            <arg value="plugin" />
        </exec>
        <move file="syndie.xpi2p" tofile="syndie-win64.xpi2p" />
        <move file="syndie.su3" tofile="syndie-win64.su3" />

    </target>

    <target name="-checkForMtn">
        <available property="mtn.available" file="_MTN" type="dir" />
    </target>

    <target name="-getMtnRev" depends="-checkForMtn" if="mtn.available">
        <exec executable="mtn" outputproperty="workspace.version" errorproperty="mtn.error1" failifexecutionfails="false">
            <arg value="automate" />
            <arg value="get_base_revision_id" />
        </exec>
    </target>

    <target name="buildProperties" depends="-getMtnRev, -trimMtnRev, getReleaseNumber, getBuildNumber">
        <tstamp>
            <format property="build.timestamp" pattern="yyyy-MM-dd HH:mm:ss z" timezone="UTC" locale="en" />
            <format property="files.date" pattern="yyyy/MM/dd" timezone="UTC" locale="en" />
        </tstamp>
        <!-- default if not set above -->
        <property name="workspace.version" value="unknown" />
        <property name="full.version" value="${release.number}-${syndie.build.number}" />
        <property name="MtnShortHash" value="unknown" />
        <condition property="extended.version" value="${full.version}-${MtnShortHash}">
            <not>
                <or>
                    <equals arg1="${MtnShortHash}" arg2="" />
                    <equals arg1="${MtnShortHash}" arg2="unknown" />
                </or>
            </not>
        </condition>
        <!-- if not set above we'll set it here -->
        <property name="extended.version" value="${full.version}" />

        <condition property="syndie.release.version" value="${extended.version}">
            <or>
                <not>
                    <equals arg1="${syndie.build.number}" arg2="0" />
                </not>
                <isset property="with.revision" />
            </or>
        </condition>
        <!-- if not set above we'll set it here -->
        <property name="syndie.release.version" value="${release.number}" />
        <echo message="Building version ${syndie.release.version} (mtn rev ${workspace.version})" />
    </target>

    <target name="-trimMtnRev" if="with.revision" description="Shorten MTN rev ID">
        <script language="javascript">
            <![CDATA[
            var MtnRev = project.getProperty("workspace.version");
            if (MtnRev != 'unknown' && MtnRev != null) {
                echo = project.createTask("echo");
                var MtnShortHash = MtnRev.substring(0,8);
                project.setProperty("MtnShortHash", MtnShortHash);
                echo.setMessage("Trimmed hash: " + MtnShortHash);
                echo.perform();
            } else {
                project.setProperty("MtnShortHash", 'unknown');
            }
            ]]>
        </script>
    </target>

    <target name="getReleaseNumber" description="Extract the Release number from the source">
        <loadfile srcfile="src/syndie/Version.java" property="release.number">
            <filterchain>
                <linecontains>
                    <contains value="public static final String VERSION"/>
                </linecontains>
                <tokenfilter>
                    <replaceregex pattern='.*"([^"]+)-[0-9]+(?:-rc)?";' replace="\1" flags="gi" />
                </tokenfilter>
                <striplinebreaks/>
                <trim/>
                <ignoreblank/>
            </filterchain>
        </loadfile>
        <property name="release.number" value="unknown" />
        <echo message="Release number is ${release.number}" />
    </target>

    <target name="getBuildNumber" description="Extract the build number from the source">
        <loadfile srcfile="src/syndie/Version.java" property="syndie.build.number">
            <filterchain>
                <linecontains>
                    <contains value="public static final String VERSION"/>
                </linecontains>
                <tokenfilter>
                    <replaceregex pattern='.*"[^"]+(?:a|b|rc)?-([0-9]+(?:-rc)?)";' replace="\1" flags="gi" />
                </tokenfilter>
                <striplinebreaks/>
                <trim/>
                <ignoreblank/>
            </filterchain>
        </loadfile>
        <property name="syndie.build.number" value="unknown" />
        <echo message="Build number is ${syndie.build.number}" />
    </target>

    <target name="stub-jars" depends="jar, preppkg" description="Create manifest-only jars for Syndie">
        <make-stub-jar name="-desktop" additional="../lib/swt.jar" type-class="${desktop.class}" />
        <make-stub-jar additional="../lib/swt.jar" type-class="${tabs.class}" />
        <make-stub-jar name="-cli" type-class="${cli.class}" />
    </target>

    <!-- use this target from debian/rules -->
    <target name="stub-jars-debian" depends="jar, preppkg-debian" description="Create manifest-only jars for Syndie">
        <make-stub-jar-debian name="-desktop" additional="${swt.jar}" type-class="${desktop.class}" />
        <make-stub-jar-debian additional="${swt.jar}" type-class="${tabs.class}" />
        <make-stub-jar-debian name="-cli" type-class="${cli.class}" />
    </target>

    <target name="preppkg" depends="prep-docs, jar">
        <copy file="${swt.jar}" tofile="${pkgtemp.dir}/lib/swt.jar" />
        <copy file="${hsqldb.jar}" todir="${pkgtemp.dir}/lib" />
        <copy file="${i2p.jar}" todir="${pkgtemp.dir}/lib" />
        <copy file="${build.dir}/syndie.jar" todir="${pkgtemp.dir}/lib" />
    </target>

    <target name="preppkg-debian" depends="prep-docs-debian, jar">
        <copy file="${build.dir}/syndie.jar" todir="${pkgtemp.dir}/lib" />
    </target>

    <target name="prep-docs" depends="prep-docs-debian">
        <copy file="lib/hsqldb_lic.txt" todir="${pkgtemp.dir}/doc/licenses" />
        <replaceregexp file="${pkgtemp.dir}/doc/LICENSE" byline="true"
            match="lib/hsqldb_lic.txt"
            replace="licenses/hsqldb_lic.txt">
        </replaceregexp>
    </target>

    <target name="prep-docs-debian">
        <copy todir="${pkgtemp.dir}/bin">
            <fileset dir="./bin" />
        </copy>
        <copy todir="${pkgtemp.dir}/doc">
            <fileset dir="." includes="CHANGES CREDITS INSTALL README TODO" />
        </copy>
        <copy todir="${pkgtemp.dir}/doc/web">
            <fileset dir="doc/web" />
        </copy>
        <copy file="LICENSE" todir="${pkgtemp.dir}/doc/"/>
        <copy todir="${pkgtemp.dir}/doc/licenses">
            <fileset dir="doc/licenses/" excludes="SWT/**" />
        </copy>
        <replaceregexp file="${pkgtemp.dir}/doc/LICENSE" byline="true"
            match="doc/licenses/"
            replace="licenses/">
        </replaceregexp>
    </target>


    <target name="prep-swt-licenses" depends="prep-win-licenses, prep-lin-licenses, prep-mac-licenses, prep-common-swt" />
    <target name="prep-common-swt">
        <copy file="src/com/LICENSE.txt" tofile="${pkgtemp.dir}/doc/licenses/LICENSE-Jazzy-GPL-v2.1.txt" />
        <copy todir="${pkgtemp.dir}/doc/licenses/SWT/about_files">
            <fileset dir="doc/licenses/SWT/common" />
        </copy>
    </target>

    <target name="prep-win-licenses" depends="prep-common-swt">
        <copy file="doc/licenses/SWT/lin/about.html" tofile="${pkgtemp.dir}/doc/licenses/SWT/Windows.html" />
    </target>

    <target name="prep-lin-licenses" depends="prep-common-swt">
        <copy todir="${pkgtemp.dir}/doc/licenses/SWT/about_files">
            <fileset dir="doc/licenses/SWT/lin/about_files" />
        </copy>
        <copy file="doc/licenses/SWT/lin/about.html" tofile="${pkgtemp.dir}/doc/licenses/SWT/Linux.html" />
    </target>

    <target name="prep-mac-licenses" depends="prep-common-swt">
        <copy file="doc/licenses/SWT/mac/about.html" tofile="${pkgtemp.dir}/doc/licenses/SWT/OSX.html" />
    </target>

    <target name="prep-launch4j-license" if="launch4j.available">
        <copy file="${launch4j.dir}/LICENSE.txt" tofile="${pkgtemp.dir}/doc/licenses/License-Launch4j.txt" />
    </target>

    <target name="pkg" depends="clean, prep-launch4j-license, prep-swt-licenses, stub-jars, jar, preppkg">
        <delete dir="${dist.dir}" />
        <move todir="${dist.dir}">
            <fileset dir="${pkgtemp.dir}" />
        </move>
    </target>

    <target name="pkg-exe" depends="clean, jars2exe, pkg"/>

    <target name="source-tarball" depends="buildProperties" description="Generate source tarball">
        <!-- will this use the monotonerc file in the current workspace? -->
        <fail message="This target cannot be used without Monotone!">
            <condition>
                <not>
                    <isset property="mtn.available" />
                </not>
            </condition>
        </fail>
        <property name="source.tarball.name" value="${ant.project.name}-${syndie.release.version}.src.tar.bz2" />
        <echo message="Checking out fresh copy into ../${ant.project.name}-${syndie.release.version} for tarballing:" />
        <delete dir="../${ant.project.name}-${syndie.release.version}" />
        <exec executable="mtn" failonerror="true">
            <arg value="co" />
            <arg value="-b" />
            <arg value="i2p.${ant.project.name}" />
            <!-- w: is the revision of the current workspace -->
            <arg value="-r" />
            <arg value="w:" />
            <arg value="../${ant.project.name}-${syndie.release.version}" />
        </exec>
        <delete includeemptydirs="true" quiet="false">
            <fileset dir="../${ant.project.name}-${syndie.release.version}/_MTN" />
            <fileset dir="../${ant.project.name}-${syndie.release.version}/debian-alt"/>
            <fileset dir="../${ant.project.name}-${syndie.release.version}/lib"/>
        </delete>
        <tar longfile="gnu" destfile="${source.tarball.name}" compression="bzip2">
            <tarfileset dir="../${ant.project.name}-${syndie.release.version}" prefix="${ant.project.name}-${syndie.release.version}">
                <include name="**/**" />
                <exclude name="debian/**"/>
                <exclude name="debian-alt/**"/>
                <exclude name="lib/**"/>
                <exclude name="**/*.sh"/>
            </tarfileset>
            <tarfileset dir="../${ant.project.name}-${syndie.release.version}" prefix="${ant.project.name}-${syndie.release.version}" filemode="755">
                <exclude name="debian/**" />
                <include name="**/*.sh" />
            </tarfileset>
        </tar>
    </target>

    <target name="debian-binary">
        <exec executable="fakeroot" failonerror="true">
            <arg value="debian/rules" />
            <arg value="clean" />
            <arg value="binary" />
        </exec>
    </target>

    <target name="debian-tarball" depends="source-tarball">
        <copy verbose="true" file="${source.tarball.name}"
            tofile="../${ant.project.name}_${syndie.release.version}.orig.tar.bz2" />
    </target>

    <target name="sloccount.report" description="Generate 'sloccount' report">
        <echo message="Generating sloccount report (this will take awhile)" />
        <exec executable="sloccount" failonerror="true">
            <arg value="--details"/>
            <arg value="--wide"/>
            <arg value="${basedir}"/>
            <redirector output="sloccount.sc">
                <outputfilterchain>
                    <linecontainsregexp negate="true">
                        <regexp pattern="(WARNING|Warning:|sloccount\.sc)" />
                    </linecontainsregexp>
                </outputfilterchain>
            </redirector>
        </exec>
        <echo message="sloccount report saved to the file sloccount.sc" />
    </target>

    <target name="findbugs" depends="jar" description="Analyze source with Findbugs">
        <echo message="Starting findbugs, this will take a while..." />
        <exec executable="nice" failonerror="true">
            <arg value="findbugs"/>
            <arg value="-textui"/>
            <arg value="-projectName"/>
            <arg value="${ant.project.name}"/>
            <arg value="-sortByClass"/>
            <arg value="-xml"/>
            <arg value="-output"/>
            <arg value="${ant.project.name}.fba"/>
            <arg value="-auxclasspath"/>
            <arg value="${swt.jar}:${hsqldb.jar}:${i2p.jar}" />
            <arg value="-sourcepath"/>
            <arg value="src" />
            <!-- start of the files to be analyzed -->
            <arg value="${build.dir}/syndie.jar"/>
        </exec>
        <echo message="Findbugs output stored in ${ant.project.name}.fba" />
        <echo message="Now run: findbugs ${ant.project.name}.fba" />
    </target>

    <target name="javadoc" depends="javadocs" />
    <target name="javadocs" depends="buildProperties" description="Generate Javadocs">
        <!-- only set the locale if not set elsewhere -->
        <property name="javadoc.locale" value="en_US" />
        <mkdir dir="./build" />
        <mkdir dir="./build/javadoc" />
        <javadoc access="package"
            destdir="./build/javadoc"
            packagenames="*"
            use="true"
            splitindex="true"
            author="true"
            version="true"
            locale="${javadoc.locale}"
            doctitle="Syndie Javadocs for Release ${release.number} Build ${syndie.build.number}"
            windowtitle="Syndie Distributed Forums - Java Documentation - Version ${full.version}">
            <group title="Syndie" packages="syndie*" />
            <group title="Spell Checker" packages="com.swabunga.*" />
            <sourcepath>
                <pathelement location="src" />
            </sourcepath>
            <classpath>
                <pathelement location="${swt.jar}" />
                <pathelement location="${i2p.jar}" />
            </classpath>
            <!-- These variables are stored in build.properties.
                 End-users can override by creating the file override.properties -->
            <link offline="true" href="${javasedocs.url}" packagelistLoc="resources/package-lists/java/" />
            <link offline="true" href="${swtdocs.url}" packagelistLoc="resources/package-lists/swt/" />
            <link offline="true" href="${i2pdocs.url}" packagelistLoc="resources/package-lists/i2p/" />
        </javadoc>
        <echo message="Warning, javadoc embeds timestamps in the output, run with 'TZ=UTC ant javadoc' if you plan to distribute" />
    </target>

    <target name="clean" description="clean up">
        <delete dir="${build.dir}" />
        <delete dir="builddep" />
        <delete file="sloccount.sc" />
        <delete dir="plugin" />
        <delete dir="${pkgtemp.dir}" />
        <delete file="plugin.zip" />
        <delete file="${ant.project.name}.fba" />
        <delete dir="pkg-osx" />
        <delete file="resources/i2plogo.png" />
    </target>

    <target name="distclean" depends="clean" description="More throrough clean-up">
        <delete file="syndie.xpi2p" />
        <delete dir="${dist.dir}" />
        <delete quiet="true">
            <fileset dir="." includes="syndie-installer* syndie*tar.bz2 *.sha256 *.sig" />
        </delete>
        <delete file="syndie-installer*.jar" />
        <delete file="syndie-installer*.exe" />
        <delete file="syndie-update.xpi2p" />
        <delete file="syndie-mac64.xpi2p" />
        <delete file="syndie-mac64-update.xpi2p" />
        <delete file="syndie-win32.xpi2p" />
        <delete file="syndie-win32-update.xpi2p" />
        <delete file="syndie-win64.xpi2p" />
        <delete file="syndie-win64-update.xpi2p" />
        <delete file="syndie-linux-i386.xpi2p" />
        <delete file="syndie-linux-i386-update.xpi2p" />
        <delete file="syndie-linux-x86-64.xpi2p" />
        <delete file="syndie-linux-x86-64-update.xpi2p" />
        <delete file="syndie-update.su3" />
        <delete file="syndie-mac64.su3" />
        <delete file="syndie-mac64-update.su3" />
        <delete file="syndie-win32.su3" />
        <delete file="syndie-win32-update.su3" />
        <delete file="syndie-win64.su3" />
        <delete file="syndie-win64-update.su3" />
        <delete file="syndie-linux-i386.su3" />
        <delete file="syndie-linux-i386-update.su3" />
        <delete file="syndie-linux-x86-64.su3" />
        <delete file="syndie-linux-x86-64-update.su3" />
    </target>

    <target name="totallyclean" depends="distclean" description="Most thorough clearning">
        <delete file="lib/i2p.jar" />
        <delete file="lib/swt.jar" />
        <ant dir="swt" target="totallyclean" />
    </target>

    <target name="debug" depends="buildProperties" description="Print properties">
        <echoproperties/>
    </target>

    <target name="delete-windows-files">
        <delete failonerror="false" quiet="true">
            <fileset dir="${pkgtemp.dir}" includes="**/*.exe" />
        </delete>
    </target>

    <target name="delete-stub-jars">
        <delete failonerror="false" quiet="true">
            <fileset dir="${pkgtemp.dir}/bin" includes="*.jar" />
        </delete>
    </target>

    <target name="delete-osx-files">
        <delete failonerror="false" quiet="true">
            <fileset dir="${pkgtemp.dir}/bin" includes="*.command *.sh" />
        </delete>
    </target>

    <target name="delete-linux-files">
        <delete failonerror="false" quiet="true">
            <fileset dir="${pkgtemp.dir}/bin" includes="*.sh" />
        </delete>
    </target>

    <target name="repack-osx-bundle" if="do.repack">
        <repack jarname="pkg-osx/Syndie.app/Contents/MacOS/swt.jar" />
        <repack jarname="pkg-osx/Syndie.app/Contents/MacOS/i2p.jar" />
        <repack jarname="pkg-osx/Syndie.app/Contents/MacOS/syndie.jar" />
        <repack jarname="pkg-osx/Syndie.app/Contents/MacOS/hsqldb.jar" />
    </target>

    <target name="repack-common" if="do.repack">
        <repack jarname="${pkgtemp.dir}/lib/i2p.jar" />
        <repack jarname="${pkgtemp.dir}/lib/hsqldb.jar" />
        <repack jarname="${pkgtemp.dir}/lib/syndie.jar" />
    </target>

    <target name="repack-swt" if="do.repack">
        <repack jarname="${pkgtemp.dir}/lib/swt.jar" />
    </target>

    <target name="repack-cli" if="do.repack">
        <repack jarname="${pkgtemp.dir}/lib/i2p.jar" />
        <repack jarname="${pkgtemp.dir}/lib/hsqldb.jar" />
        <repack jarname="${pkgtemp.dir}/bin/syndie-cli.jar" />
    </target>

    <target name="installer-linux" depends="installer-linux32, installer-linux64" description="Create Linux installers (i386 and x86_64)"/>

    <!-- Aliases -->
    <target name="installer-lin32" depends="installer-linux32" />
    <target name="installer-lin64" depends="installer-linux64" />
    <target name="installer-win32" depends="installer-windows32" />
    <target name="installer-win64" depends="installer-windows64" />
    <target name="installer-mac32" depends="installer-osx32" />
    <target name="installer-mac64" depends="installer-osx64" />
    <target name="linux-start-scripts">
        <echo file="${pkgtemp.dir}/bin/syndie.sh"><![CDATA[#!/bin/sh
java -jar %INSTALL_PATH/bin/syndie.jar "$@" -Dsyndie.dict=/usr/share/dict/words
]]></echo>
        <echo file="${pkgtemp.dir}/bin/syndie-desktop.sh"><![CDATA[#!/bin/sh
java -jar %INSTALL_PATH/bin/syndie-desktop.jar "$@" -Dsyndie.dict=/usr/share/dict/words
]]></echo>
        <echo file="${pkgtemp.dir}/bin/syndie-cli.sh"><![CDATA[#!/bin/sh
java -jar %INSTALL_PATH/bin/syndie-cli.jar "$@"
]]></echo>
    </target>

    <target name="installer-linux32" depends="-check-for-izpack, stub-jars, preppkg, delete-windows-files, delete-osx-files, linux-start-scripts" description="Create i386 installer for Linux">
        <ant dir="swt" target="ensure-lin32-swt" />
        <ant target="repack-common" />
        <build-installer os="linux" arch="32" swt="${swt.lin32}" />
    </target>

    <target name="installer-linux64" depends="-check-for-izpack, stub-jars, preppkg, delete-windows-files, delete-osx-files, linux-start-scripts" description="Create x86_64 installer for Linux">
        <ant dir="swt" target="ensure-lin64-swt" />
        <ant target="repack-common" />
        <build-installer os="linux" arch="64" swt="${swt.lin64}" />
    </target>

    <target name="installer-windows" depends="installer-windows64-exe, installer-windows32-exe, delete-osx-files" description="Create i386 and x86_64 installers for Windows" />

    <target name="installer-windows32-exe" if="can.create.exe" unless="no.exe" depends="-check-launch4j, installer-windows32" description="Create i386 installer for Windows and wrap it into an EXE">
        <wrap-installer bits="32" />
    </target>

    <target name="installer-windows64-exe" if="can.create.exe" unless="no.exe" depends="-check-launch4j, installer-windows64" description="Create x86_64 installer for Windows and wrap it into an EXE">
        <wrap-installer bits="64" />
    </target>

    <target name="installer-windows32" depends="-check-for-izpack, jars2exe, stub-jars, preppkg, delete-osx-files, delete-linux-files" description="Create i386 installer for Windows">
        <ant dir="swt" target="ensure-win32-swt" />
        <ant target="repack-common" />
        <build-installer os="win" arch="32" swt="${swt.win32}" />
    </target>

    <target name="installer-windows64" depends="-check-for-izpack, jars2exe, stub-jars, preppkg, delete-osx-files, delete-linux-files" description="Create x86_64 installer for Windows">
        <ant dir="swt" target="ensure-win64-swt" />
        <ant target="repack-common" />
        <build-installer os="win" arch="64" swt="${swt.win64}" />
    </target>

    <!--
         The installer-osx* targets create Izpack installers. Also available are the pkg-osx* targets
         which create OSX-style .app bundles.
         -->
    <target name="installer-osx" depends="installer-osx32, installer-osx64" />

    <target name="installer-osx32" depends="-check-for-izpack, preppkg, delete-windows-files, delete-linux-files, delete-stub-jars" description="Create i386 installer for OSX">
        <echo file="${pkgtemp.dir}/bin/syndie.command"><![CDATA[#!/bin/sh
CP=%INSTALL_PATH/lib/i2p.jar:%INSTALL_PATH/lib/hsqldb.jar:%INSTALL_PATH/lib/swt.jar:%INSTALL_PATH/lib/syndie.jar
java -d32 -XstartOnFirstThread -cp $CP syndie.gui.SWTUI "$@"
]]></echo>
        <echo file="${pkgtemp.dir}/bin/syndie-cli.sh"><![CDATA[#!/bin/sh
CP=%INSTALL_PATH/lib/i2p.jar:%INSTALL_PATH/lib/hsqldb.jar:%INSTALL_PATH/lib/syndie.jar
java -d32 -XstartOnFirstThread -cp $CP syndie.db.TextUI "$@"
]]></echo>
        <echo file="${pkgtemp.dir}/bin/syndie-desktop.command"><![CDATA[#!/bin/sh
CP=%INSTALL_PATH/lib/i2p.jar:%INSTALL_PATH/lib/hsqldb.jar:%INSTALL_PATH/lib/syndie.jar
java -d32 -XstartOnFirstThread -cp $CP syndie.db.TextUI "$@"
]]></echo>
        <ant dir="swt" target="ensure-mac32-swt" />
        <ant target="repack-common" />
        <build-installer os="osx" arch="32" swt="${swt.mac32}" />
    </target>

    <target name="installer-osx64" depends="-check-for-izpack, preppkg, delete-windows-files, delete-linux-files, delete-stub-jars" description="Create x86_64 installer for OSX">
        <echo file="${pkgtemp.dir}/bin/syndie.command"><![CDATA[#!/bin/sh
CP=%INSTALL_PATH/lib/i2p.jar:%INSTALL_PATH/lib/hsqldb.jar:%INSTALL_PATH/lib/swt.jar:%INSTALL_PATH/lib/syndie.jar
java -d64 -XstartOnFirstThread -cp $CP syndie.gui.SWTUI "$@"
]]></echo>
        <echo file="${pkgtemp.dir}/bin/syndie-cli.sh"><![CDATA[#!/bin/sh
CP=%INSTALL_PATH/lib/i2p.jar:%INSTALL_PATH/lib/hsqldb.jar:%INSTALL_PATH/lib/syndie.jar
java -d64 -XstartOnFirstThread -cp $CP syndie.db.TextUI "$@"
]]></echo>
        <echo file="${pkgtemp.dir}/bin/syndie-desktop.command"><![CDATA[#!/bin/sh
CP=%INSTALL_PATH/lib/i2p.jar:%INSTALL_PATH/lib/hsqldb.jar:%INSTALL_PATH/lib/syndie.jar
java -d64 -XstartOnFirstThread -cp $CP syndie.db.TextUI "$@"
]]></echo>
        <ant dir="swt" target="ensure-mac64-swt" />
        <ant target="repack-common" />
        <build-installer os="osx" arch="64" swt="${swt.mac64}" />
    </target>

    <target name="installer-all" depends="installer-linux, installer-windows, installer-osx64" description="Create Windows, Linux and OSX installers" />

    <target name="prep-osx" depends="jar, prep-docs, prep-mac-licenses">
        <mkdir dir="pkg-osx/Syndie.app/Contents/MacOS" />
        <mkdir dir="pkg-osx/Syndie.app/Contents/Resources" />
        <copy file="${hsqldb.jar}" todir="pkg-osx/Syndie.app/Contents/MacOS" />
        <copy file="${i2p.jar}" todir="pkg-osx/Syndie.app/Contents/MacOS" />
        <copy file="${build.dir}/syndie.jar" todir="pkg-osx/Syndie.app/Contents/MacOS" />
        <copy file="resources/osx.icns" tofile="pkg-osx/Syndie.app/Contents/syndie.icns" />
        <echo file="pkg-osx/Syndie.app/Contents/Info.plist"><![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>CFBundleExecutable</key>
        <string>startsyndie.sh</string>
        <key>CFBundleGetInfoString</key>
        <string>Syndie ${full.version} for Mac OS X</string>
        <key>CFBundleIconFile</key>
        <string>syndie.icns</string>
        <key>CFBundleIdentifier</key>
        <string>syndie.gui.SWTUI</string>
        <key>CFBundleInfoDictionaryVersion</key>
        <string>6.0</string>
        <key>CFBundleName</key>
        <string>Syndie</string>
        <key>CFBundlePackageType</key>
        <string>APPL</string>
        <key>CFBundleShortVersionString</key>
        <string>1.102.${syndie.build.number}</string>
        <key>CFBundleSignature</key>
        <string>synd</string>
        <key>CFBundleVersion</key>
        <string>1.0</string>
        <key>NSPrincipalClass</key>
        <string>NSApplication</string>
    </dict>
</plist>
            ]]></echo>
        <copy todir="pkg-osx/doc">
            <fileset dir="pkg-temp/doc" />
        </copy>
    </target>

    <target name="pkg-cli" depends="jar-cli, prep-docs">
        <copy file="${build.dir}/syndie-cli.jar" todir="${pkgtemp.dir}/bin" />
        <copy file="${hsqldb.jar}" todir="${pkgtemp.dir}/lib" />
        <copy file="${i2p.jar}" todir="${pkgtemp.dir}/lib" />
        <ant target="repack-cli" />
        <echo file="${pkgtemp.dir}/bin/readme.txt">In order to use this headless version of Syndie,
copy i2p.jar to the lib directory, then simply
run "java -jar syndie-cli.jar".

Alternatively, you can run a command like the following:
java -cp path/to/hsqldb.jar:path/to/i2p.jar:path/to/syndie-cli.jar syndie.db.TextUI
</echo>
        <tar destfile="syndie-cli-${syndie.release.version}.bin.tar.bz2" compression="bzip2">
            <tarfileset dir="${pkgtemp.dir}" prefix="syndie-cli-${syndie.release.version}" filemode="644">
                <include name="bin/*" />
                <exclude name="bin/*.exe" />
                <exclude name="bin/*.sh" />
                <exclude name="bin/*.command" />
                <include name="lib/hsqldb.jar" />
                <include name="doc/*" />
                <exclude name="doc/Uninstaller/" />
                <include name="doc/licenses/*.txt" />
                <exclude name="doc/web" />
            </tarfileset>
        </tar>
    </target>

    <!-- The pkg-osx* targets create OSX .app bundles that run Syndie with the tabs interface -->
    <target name="pkg-osx" depends="pkg-osx32, pkg-osx64" description="Create both i386 and x86_64 '.app' bundles for OSX" />
    <target name="pkg-osx32" depends="prep-osx" description="Create an i386 '.app' bundle for OSX">
        <ant dir="swt" target="ensure-mac32-swt" />
        <delete file="pkg-osx/Syndie.app/Contents/MacOS/swt.jar" />
        <copy file="${swt.mac32}" tofile="pkg-osx/Syndie.app/Contents/MacOS/swt.jar" />
        <ant target="repack-osx-bundle" />
        <echo file="pkg-osx/Syndie.app/Contents/MacOS/startsyndie.sh"><![CDATA[#!/bin/sh
DIR=`dirname $0`
CP=$DIR/swt.jar:$DIR/hsqldb.jar:$DIR/syndie.jar:$DIR/i2p.jar
exec java -d32 -XstartOnFirstThread -cp $CP syndie.gui.SWTUI
            ]]></echo>
        <tar destfile="syndie-${syndie.release.version}.bin.osx32.tar.bz2" compression="bzip2">
            <tarfileset dir="pkg-osx" prefix="syndie-${syndie.release.version}" filemode="644">
                <include name="**/**" />
                <exclude name="**/*.sh" />
            </tarfileset>
            <tarfileset dir="pkg-osx" prefix="syndie-${syndie.release.version}" filemode="755">
                <include name="**/*.sh" />
            </tarfileset>
        </tar>
    </target>

    <target name="pkg-osx64" depends="prep-osx" description="Create an x86_64 '.app' bundle for OSX">
        <ant dir="swt" target="ensure-mac64-swt" />
        <delete file="pkg-osx/Syndie.app/Contents/MacOS/swt.jar" />
        <copy file="${swt.mac64}" tofile="pkg-osx/Syndie.app/Contents/MacOS/swt.jar" />
        <ant target="repack-osx-bundle" />
        <echo file="pkg-osx/Syndie.app/Contents/MacOS/startsyndie.sh"><![CDATA[#!/bin/sh
DIR=`dirname $0`
CP=$DIR/swt.jar:$DIR/hsqldb.jar:$DIR/syndie.jar:$DIR/i2p.jar
exec java -d64 -XstartOnFirstThread -cp $CP syndie.gui.SWTUI
]]></echo>
        <tar destfile="syndie-${syndie.release.version}.bin.osx64.tar.bz2" compression="bzip2">
            <tarfileset dir="pkg-osx" prefix="syndie-${syndie.release.version}" filemode="644">
                <include name="**/**" />
                <exclude name="**/*.sh" />
            </tarfileset>
            <tarfileset dir="pkg-osx" prefix="syndie-${syndie.release.version}" filemode="755">
                <include name="**/*.sh" />
            </tarfileset>
        </tar>
    </target>

    <target name="pkg-all" depends="distclean, installer-all, pkg-osx64, source-tarball, pkg-cli" description="Create packages/installers for all supported systems." />

    <target name="-check-gpgkey">
        <echo message="Sign the files:" />
        <input message="Enter GPG key ID (e.g. 0x12345678) for signing:" addproperty="release.gpg.keyid" />
        <fail message="You must enter a key ID." >
            <condition>
                <not>
                    <isset property="release.gpg.keyid" />
                </not>
            </condition>
        </fail>
    </target>

    <target name="release" depends="-check-gpgkey, pkg-all, update-site" description="build, sign, and checksum files then update site">
        <delete dir="./dist" />
        <mkdir dir="./dist" />
        <sign-and-sum file="syndie-installer-${syndie.release.version}.bin.linux32.jar" />
        <sign-and-sum file="syndie-installer-${syndie.release.version}.bin.linux64.jar" />
        <sign-and-sum file="syndie-installer-${syndie.release.version}.bin.win32.exe" />
        <sign-and-sum file="syndie-installer-${syndie.release.version}.bin.win64.exe" />
        <sign-and-sum file="syndie-installer-${syndie.release.version}.bin.osx64.jar" />
        <sign-and-sum file="syndie-cli-${syndie.release.version}.bin.tar.bz2" />
        <sign-and-sum file="syndie-${syndie.release.version}.src.tar.bz2" />
        <sign-and-sum file="syndie-${syndie.release.version}.bin.osx64.tar.bz2" />
        <ant target="-torrent" />

        <move todir="./dist">
            <fileset dir="." includes="*.exe *.sha256 *.sig *.bz2 *.jar *.torrent"/>
        </move>
        <echo message="If you're happy with the results, remember to mtn tag w: ${ant.project.name}-${syndie.release.version}" />
    </target>

    <target name="-torrent" if="i2psnark.jar">
        <available property="i2psnark.available" file="${i2psnark.jar}" type="file" />
        <fail unless="i2psnark.available">ERROR: -Di2psnark.jar set but ${i2psnark.jar} could not be found!</fail>
        <make-torrent file="syndie-cli-${syndie.release.version}.bin.tar.bz2" />
        <make-torrent file="syndie-installer-${syndie.release.version}.bin.linux32.jar" />
        <make-torrent file="syndie-installer-${syndie.release.version}.bin.linux64.jar" />
        <make-torrent file="syndie-installer-${syndie.release.version}.bin.win32.exe" />
        <make-torrent file="syndie-installer-${syndie.release.version}.bin.win64.exe" />
        <make-torrent file="syndie-installer-${syndie.release.version}.bin.osx64.jar" />
        <make-torrent file="syndie-${syndie.release.version}.src.tar.bz2" />
        <make-torrent file="syndie-${syndie.release.version}.bin.osx64.tar.bz2" />
    </target>

    <target name="update-archivesite" depends="buildProperties" if="gpg.key">
        <replaceregexp flags="g" byline="false" file="data/archive/index.html"
            match="[0-9]\.[0-9]+(a|b|rc)(?:-[0-9]+)?(-[a-z0-9]{8})?"
            replace="${syndie.release.version}">
        </replaceregexp>
    </target>

    <target name="update-site" depends="buildProperties, copy-www" if="do.update.site">
        <replaceregexp flags="g" byline="false"
            match="[0-9]\.[0-9]+(a|b|rc)(?:-[0-9]+)?(-[a-z0-9]{8})?"
            replace="${syndie.release.version}">
            <fileset dir="doc/web" includes="download.html index.html" />
        </replaceregexp>
        <replaceregexp file="doc/web/index.html" flags="g" byline="false"
            match="\([0-9]{4}/[0-9]{2}/[0-9]{2}\)"
            replace="(${files.date})">
        </replaceregexp>
        <replaceregexp flags="g" byline="false" file="doc/web/download.html">
            <regexp pattern="files/(:?.*)?/syndie"/>
            <substitution expression="files/${release.number}/syndie" />
        </replaceregexp>

        <echo>Release date set to ${files.date}. Edit doc/web/index.html is this is incorrect.</echo>
    </target>

    <target name="copy-www" if="syndie.www">
        <copy todir="${syndie.www}" verbose="true" overwrite="true">
            <fileset dir="doc/web" includes="index.html download.html" />
        </copy>
    </target>

    <target name="testscripts" description="check PO files, XML, and HTML files for errors">
        <exec executable="tests/scripts/checkpo.sh" failonerror="true" />
        <exec executable="tests/scripts/checkxml.sh" failonerror="true" />
    </target>
</project>
<!-- vim: set ft=xml ts=4 sw=4 et: -->