File: build.xml

package info (click to toggle)
libxalan2-java 2.7.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 19,608 kB
  • sloc: java: 175,006; xml: 28,206; sh: 159; jsp: 43; makefile: 12; sql: 6
file content (1887 lines) | stat: -rw-r--r-- 92,403 bytes parent folder | download
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
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
<?xml version="1.0" encoding="utf-8"?>
<!--
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
-->

<!-- ===================================================================

   Build file for Xalan-J 2.x - for use with the Jakarta Ant java build tool
   
Setup instructions: 
   Before running an Ant build, you must
   
     - set the JAVA_HOME environment variable to the JDK root directory
     - To build 'servlet' sample: Include Servlet SDK in your classpath
     - To build docs/javadocs/xsltc: use JDK 1.2.x or higher
   
Build Instructions:   
  To build, run
    build.bat (win32) or build.sh (unix) [antoptions] [targets]
  in the directory where this file is located; you should also be 
  able to use an installation of Ant v1.4.1 or later.
   
  build -projecthelp  will show a list of supported targets.
   
  Developers: include a description="" attribute in all user-callable targets.
        
  If you build a target that depends on other targets, those other 
  targets are *usually* created in the correct order; however a 
  few of the larger targets like dist do not list all dependencies.

Other Important Notes:
- 'dist' produces a .tar file that works with GNU compatible tar 
  programs, because that's what Ant does when it finds a path that's 
  longer than 100 characters (like in our docs).  Sorry!
  
- External build maintainers: look for GUMP: comments; developers 
  please use great caution when changing these lines!

- Unusual build items: the docs and xsltc.compile targets leave 
  cruft in the source areas; various clean targets get most of this.
  
Authors:
  Shane Curcuru <shane_curcuru@lotus.com>
  Don Leslie <donald_leslie@lotus.com>

$Id: build.xml 1581694 2014-03-26 04:54:28Z ggregory $
==================================================================== -->

<project name="Xalan" default="jar" basedir=".">

  <property name="name"                   value="xalan"/>
  <property name="year"                   value="2014"/>
  <property name="build.debug"            value="on"/>
  <property name="compiler.target"        value="1.3"/>
  <property name="compiler.source"        value="1.3"/>

  <!-- Xalan Java version information -->
  <property name="version.VERSION"        value="2"/>
  <property name="version.RELEASE"        value="7"/>
  <property name="version.DEVELOPER"      value=""/><!-- Set this to 'D' if a developer release; blank "" if maintenance release -->
  <property name="version.MINOR"          value="2"/><!-- EITHER the developer release number, or a maintenance release number -->
  <property name="version"                value="${version.VERSION}_${version.RELEASE}_${version.DEVELOPER}${version.MINOR}"/><!-- GUMP: version # of dist file -->
  <property name="impl.version"           value="${version.VERSION}.${version.RELEASE}.${version.DEVELOPER}${version.MINOR}"/><!-- Used in jar task for filtering MANIFEST.MF file -->
  
  <!-- Xerces Java version information -->
  <property name="parser.version.VERSION" value="2"/>
  <property name="parser.version.RELEASE" value="11"/>
  <property name="parser.version.MINOR"   value="0"/> 
  
  <!-- Xalan Java directories -->  
  <!--  <property name="bin.dir"                value="./bin"/> -->
  <property name="build.dir"              value="./build"/> 
  <property name="lib.dir"                value="./lib"/>   
  <property name="endorsed.dir"           value="${lib.dir}/endorsed"/>   
  <property name="samples.dir"            value="./samples"/>   
  <property name="src.dir"                value="./src"/>  
  <property name="tools.dir"              value="./tools"/> 
  <property name="xdocs.dir"              value="./xdocs"/>
    
  <property name="apachexml.reldir"       value="org/apache/xml"/>
  <property name="serializer.reldir"      value="org/apache/xml/serializer"/>
  <property name="xpath.reldir"           value="org/apache/xpath"/>
  <property name="xalan.reldir"           value="org/apache/xalan"/>
  <property name="domxpath.reldir"        value="org/w3c/dom/xpath"/>
  <property name="xsltc.reldir"           value="${xalan.reldir}/xsltc"/>  

  <!-- Jars to run Xalan Java (Interpretive, Compiled, or both) -->
  <property name="xmlapis.jar.name"       value="xml-apis.jar"/>
  <property name="xmlapis.jar"            value="${endorsed.dir}/${xmlapis.jar.name}"/>
  <property name="parser.jar.name"        value="xercesImpl.jar"/>
  <property name="parser.jar"             value="${endorsed.dir}/${parser.jar.name}"/>
  <property name="bcel.jar.name"          value="BCEL.jar"/>
  <property name="bcel.jar"               value="${lib.dir}/${bcel.jar.name}"/>
  <property name="runtime.jar.name"       value="runtime.jar"/>
  <property name="runtime.jar"            value="${lib.dir}/${runtime.jar.name}"/>
  <property name="regexp.jar.name"        value="regexp.jar"/>
  <property name="regexp.jar"             value="${lib.dir}/${regexp.jar.name}"/>
  
  <!-- Jars to build Xalan Java (Interpretive, Compiled, or both) or build the docs -->
  <property name="java_cup.jar.name"      value="java_cup.jar"/>
  <property name="java_cup.jar"           value="${tools.dir}/${java_cup.jar.name}"/>
  <property name="jlex.jar.name"          value="JLex.jar"/>
  <property name="jlex.jar"               value="${tools.dir}/${jlex.jar.name}"/>  
  <property name="stylebook.jar.name"     value="stylebook-1.0-b3_xalan-2.jar"/>
  <property name="stylebook.jar"          value="${tools.dir}/${stylebook.jar.name}"/>
  <property name="doclet.jar.name"        value="xalan2jdoc.jar"/>
  <property name="doclet.jar"             value="${tools.dir}/${doclet.jar.name}"/>
  <property name="taglet.jar.name"        value="xalan2jtaglet.jar"/>
  <property name="taglet.jar"             value="${tools.dir}/${taglet.jar.name}"/>

  <!-- Jars to build Xalan Java samples -->
  <property name="servlet-api.jar.name"   value="servlet-api-2.5.jar"/>
  <property name="servlet-api.jar"        value="${lib.dir}/${servlet-api.jar.name}"/>
  <property name="javaee-api.jar.name"    value="javaee-api-5.0-2.jar"/>
  <property name="javaee-api.jar"         value="${lib.dir}/${javaee-api.jar.name}"/>
  <property name="brazil.jar.name"        value="brazil-2.1.jar"/>
  <property name="brazil.jar"             value="${lib.dir}/${brazil.jar.name}"/>
 
  <!-- Relative locations of source directories -->
  <property name="manifest.mf"            value="./src/MANIFEST.MF"/>
  <property name="manifest.xsltc.mf"      value="./src/manifest.xsltc"/>
  <property name="manifest.xalan-interpretive.mf" value="./src/manifest.xalan-interpretive"/>  
  <property name="XSLTInfo.props"         value="./src/org/apache/xalan/res/XSLTInfo.properties"/>  
  <property name="generated.xpathparser"  value="${src.dir}/${xsltc.reldir}/compiler/XPathParser.java"/>
  <property name="generated.xpathlexer"   value="${src.dir}/${xsltc.reldir}/compiler/XPathLexer.java"/>
  <property name="generated.xpathsym"     value="${src.dir}/${xsltc.reldir}/compiler/sym.java"/>
  
  <!-- Build and distribution output areas -->
  <property name="build.xalan.jar"              value="${build.dir}/${name}.jar"/><!-- GUMP: actual path/name of jar target output -->
  <property name="build.xalan-unbundled.jar"    value="${build.dir}/${name}-unbundled.jar"/>
  <property name="build.xalan-interpretive.jar" value="${build.dir}/${name}.jar"/>
  <property name="build.xsltc.jar"              value="${build.dir}/xsltc.jar"/>
  <property name="build.classes"                value="${build.dir}/classes"/>
  <property name="build.docs"                   value="${build.dir}/docs"/>
  <property name="build.samples"                value="${build.dir}/samples"/>
  <property name="build.servlet"                value="${build.samples}/servlet"/>
  <property name="build.apidocs"                value="${build.docs}/apidocs"/>
  <property name="dist.pkg"                     value="${name}-j_${version}"/><!-- GUMP: actual path/name of dist target .tar.gz/.zip-->
  <property name="dist.file"                    value="${dist.pkg}"/>
  <property name="dist.dir"                     value="${build.dir}/${dist.pkg}"/>
  
  <!-- xml-commons sources (for Javadoc) -->                                                                        
  <property name="xml-commons-srcs.tar.gz"      value="${src.dir}/xml-commons-external-1.3.02-src.tar.gz"/>
  <property name="xml-commons-srcs.tar"         value="${build.dir}/xml-commons-external-1.3.02-src.tar"/>
 
  <!-- Documentation and samples information  -->
  <property name="Name-in-docs"                 value="Xalan-Java"/>
  <property name="version.file"                 value="${xalan.reldir}/processor/XSLProcessorVersion.java"/>
  
  <property name="build.samples.jar"            value="${build.dir}/xalansamples.jar"/>
  <property name="build.servlet.war"            value="${build.dir}/xalanservlet.war"/>
  <property name="build.xsltc.applet.jar"       value="${build.dir}/xsltcapplet.jar"/>
  <property name="build.xsltc.brazil.jar"       value="${build.dir}/xsltcbrazil.jar"/>
  <property name="build.xsltc.ejb.jar"          value="${build.dir}/xsltcejb.jar"/>
  <property name="build.xsltc.servlet.jar"      value="${build.dir}/xsltcservlet.jar"/>
  
  <property name="xdocs.book"                   value="${xdocs.dir}/sources/xalan-jlocal.xml"/>
  <property name="xdocs.style"                  value="${xdocs.dir}/style"/>
  <property name="xalanonly-styledocs"
            value="dtd/xsl-html40s.dtd,dtd/spec.dtd,stylesheets/patterns.xsl,stylesheets/notice.xsl,stylesheets/spec.xsl,stylesheets/done.xsl,loaderdesign.xml,stylesheets/design2project.xsl,stylesheets/designdoc2html.xsl,stylesheets/xml2fo.xsl"/>
  <property name="xalan.cmdline.class"          value="org.apache.xalan.xslt.Process"/>
  <property name="doc.generator"                value="org.apache.stylebook.StyleBook"/>
  <property name="doc.generator.styletargz"     value="${xdocs.dir}/xml-site-style.tar.gz"/>
  <property name="doc.generator.styletar"       value="${xdocs.dir}/xml-site-style.tar"/>
  
  <property name="site.root"                    value="./xml-site"/>
  <property name="site.dir"                     value="${site.root}/target/xalan-j"/>
  <property name="site.book"                    value="${xdocs.dir}/sources/xalan-jsite.xml"/>
  
  <property name="xalan.apache.org.site.root"   value="./xalan-apache-org-site"/>
  <property name="xalan.apache.org.site.dir"    value="${xalan.apache.org.site.root}/target/xalan-apache-org"/>
  <property name="xalan.apache.org.site.book"   value="${xdocs.dir}/sources/xalan-apache-org-site.xml"/>  
  
  
  <property name="xdocs.DONE.file"              value="${xdocs.dir}/sources/xalan/DONE"/>
  <property name="xdocs.XSLTCDONE.file"         value="XSLTCDONE"/>
  <property name="xdocs.XSLTCDONE.location"     value="${xdocs.dir}/sources/xalan/${xdocs.XSLTCDONE.file}"/>

      
  <!-- PROPERTIES TO COMPILE THE SERIALIZER  ======================================= -->  
  <property name="serializer.src.dir"           value="./src"/>
  <property name="serializer.build.dir"         value="./build"/> 
  <property name="serializer.build.classes"     value="${serializer.build.dir}/serializer"/> 
  
  <!-- PROPERTIES TO MAKE THE SERIALIZER JAR ======================================= -->
  <property name="serializer.manifest.basename" value="MANIFEST.SERIALIZER"/> 
  <property name="serializer.manifest"          value="${serializer.src.dir}/${serializer.manifest.basename}"/>
  <property name="serializer.impl.version"      value="${impl.version}"/>
  <property name="serializer.java.version"      value="${java.version}"/>
  <property name="serializer.java.vendor"       value="${java.vendor}"/>
  <property name="serializer.jar.name"          value="serializer.jar"/>   
  <property name="build.serializer.jar"         value="${serializer.build.dir}/${serializer.jar.name}"/> 
  <property name="lib.serializer.jar"           value="./lib/${serializer.jar.name}"/>   
 
  <!-- Class paths used in various targets -->
  <path id="docs.class.path">
    <pathelement location="${xmlapis.jar}" />
    <pathelement location="${parser.jar}" />
    <pathelement location="${bcel.jar}" />
    <pathelement location="${runtime.jar}" />
    <pathelement location="${stylebook.jar}" />
    <pathelement location="${doclet.jar}" />
    <pathelement location="${taglet.jar}" />
    <pathelement location="${build.serializer.jar}" />
    <pathelement location="${build.xalan.jar}" />
    <pathelement path="${java.class.path}" />
  </path>
  <path id="samples.class.path">
    <pathelement location="${xmlapis.jar}" />
    <pathelement location="${build.serializer.jar}" />    
    <pathelement location="${parser.jar}" />  
    <pathelement location="${build.xalan.jar}" />
    <pathelement path="${java.class.path}" />
  </path>
  <path id="compile.class.path">
    <!-- Ensure the selected parser.jar file is used to compile against -->
    <pathelement location="${build.classes}" />
    <pathelement location="${serializer.build.classes}" />    
    <pathelement location="${xmlapis.jar}" />
    <pathelement location="${build.serializer.jar}" />
    <pathelement location="${parser.jar}" />
    <pathelement path="${java.class.path}" />
    <pathelement path="${build.boot.class.path}" />
  </path>
  <path id="xslt.boot.class.path">
    <!-- Put this version of xalan in front of the jdk's for JDK 1.4+ -->
    <!-- Set build.boot.class.path to a JDK 1.1.x classes.zip file to check
         compatibility with 1.1.x.  If you omit this property, compatability
         with 1.1.x will not be checked even though javac specifies a target of 1.1 -->
    <pathelement location="${build.classes}" />
    <pathelement location="${serializer.build.classes}" />
    <pathelement location="${xmlapis.jar}" />
    <pathelement location="${build.serializer.jar}" />    
    <pathelement location="${parser.jar}" />   
    <pathelement path="${build.boot.class.path}" />
    <pathelement path="${sun.boot.class.path}" />
  </path>
  <path id="compile.source.path">
    <dirset dir="${src.dir}" includes="/org/apache/**" />
  </path>

  <!-- patternsets for source and binary distribution packages -->
  <patternset id="bin-distro" >
    <include name="${dist.file}/LICENSE.txt"/>
    <include name="${dist.file}/NOTICE.txt"/>
    <include name="${dist.file}/readme.html"/>
    <include name="${dist.file}/xalan.jar"/>
    <!-- xsltc.jar will only be picked up if it has been built -->
    <include name="${dist.file}/xsltc.jar"/>     
    <include name="${dist.file}/${xmlapis.jar.name}"/>
    <include name="${dist.file}/${parser.jar.name}"/>
    <include name="${dist.file}/${serializer.jar.name}"/>
    <include name="${dist.file}/samples/"/>    
    <include name="${dist.file}/samples/xalansamples.jar"/>
    <include name="${dist.file}/samples/xalanservlet.war"/>
    <include name="${dist.file}/samples/xsltcapplet.jar"/>
    <include name="${dist.file}/samples/xsltcbrazil.jar"/>
    <include name="${dist.file}/samples/xsltcejb.jar"/>
    <include name="${dist.file}/samples/xsltcservlet.jar"/>
    <include name="${dist.file}/docs/"/>
  </patternset>
  <patternset id="bin-distro-nodocs" >
    <include name="${dist.file}/LICENSE.txt"/>
    <include name="${dist.file}/NOTICE.txt"/>
    <include name="${dist.file}/readme.html"/>
    <include name="${dist.file}/xalan.jar"/>
    <!-- xsltc.jar will only be picked up if it has been built -->
    <include name="${dist.file}/xsltc.jar"/>    
    <include name="${dist.file}/${xmlapis.jar.name}"/>
    <include name="${dist.file}/${parser.jar.name}"/>
    <include name="${dist.file}/${serializer.jar.name}"/>
    <include name="${dist.file}/samples/"/>        
    <include name="${dist.file}/samples/xalansamples.jar"/>
    <include name="${dist.file}/samples/xalanservlet.war"/>
    <include name="${dist.file}/samples/xsltcapplet.jar"/>
    <include name="${dist.file}/samples/xsltcbrazil.jar"/>
    <include name="${dist.file}/samples/xsltcejb.jar"/>
    <include name="${dist.file}/samples/xsltcservlet.jar"/>
  </patternset>
  <patternset id="src-distro" >
    <include name="${dist.file}/LICENSE.txt"/>
    <include name="${dist.file}/NOTICE.txt"/>      
    <include name="${dist.file}/build.*"/>
    <include name="${dist.file}/commits.xml"/>
    <include name="${dist.file}/KEYS"/>
    <include name="${dist.file}/readme.html"/>  
    <include name="${dist.file}/lib/"/>
    <include name="${dist.file}/tools/"/>
    <include name="${dist.file}/samples/"/>
    <exclude name="${dist.file}/samples/xalansamples.jar"/>
    <exclude name="${dist.file}/samples/xalanservlet.war"/>
    <exclude name="${dist.file}/samples/xsltcapplet.jar"/>
    <exclude name="${dist.file}/samples/xsltcbrazil.jar"/>
    <exclude name="${dist.file}/samples/xsltcejb.jar"/>
    <exclude name="${dist.file}/samples/xsltcservlet.jar"/>    
    <include name="${dist.file}/src/"/>
    <include name="${dist.file}/xdocs/"/>
  </patternset>

  <!-- XSLTC engine dependency .jar files -->    
  <patternset id="xsltc-deps-jars" >
    <include name="${dist.file}/lib/${bcel.jar.name}"/>
    <include name="${dist.file}/tools/${java_cup.jar.name}"/>
    <include name="${dist.file}/tools/${jlex.jar.name}"/>
    <include name="${dist.file}/lib/${runtime.jar.name}"/>
    <include name="${dist.file}/lib/${regexp.jar.name}"/>
  </patternset>

  <!-- =================================================================== -->
  <!-- Creates output build directories and doc prerequistes               -->
  <!-- =================================================================== -->
  <target name="prepare">
    <echo message="Project:${Name-in-docs} version:${version} build.xml $Revision: 1581694 $"/>
    <mkdir dir="${build.dir}"/>
    <mkdir dir="${build.classes}"/>
    <!-- Note that all testing-related targets *must* depend on 
         this target, either directly or indirectly, to get 
         the tests-available property set for them.
    -->
    <available file="${test.relpath}" property="tests-available" />
    <available property="xerces.present" 
      classname="org.apache.xerces.parsers.SAXParser"/>
      
    <!-- Update version information.  This copies the Version.src
         file into Version.java, while replacing the following tokens
    -->
    <filter token="version.VERSION"          value="${version.VERSION}"/>  
    <filter token="version.RELEASE"          value="${version.RELEASE}"/>
    <filter token="version.MINOR"            value="${version.MINOR}"/>
    <filter token="version.DEVELOPER"        value="${version.DEVELOPER}"/> 
    <filter token="parser.version.VERSION"   value="${parser.version.VERSION}"/>  
    <filter token="parser.version.RELEASE"   value="${parser.version.RELEASE}"/>
    <filter token="parser.version.MINOR"     value="${parser.version.MINOR}"/>    
    <copy tofile="${src.dir}/${xalan.reldir}/Version.java" file="${src.dir}/${xalan.reldir}/Version.src" filtering="true"/>
    <copy tofile="${src.dir}/${xalan.reldir}/processor/XSLProcessorVersion.java" file="${src.dir}/${xalan.reldir}/processor/XSLProcessorVersion.src" filtering="true"/>    
    <copy tofile="${src.dir}/${serializer.reldir}/Version.java" file="${src.dir}/${serializer.reldir}/Version.src" filtering="true"/>
    <copy tofile="${xdocs.dir}/sources/entities.ent" file="${xdocs.dir}/sources/entities.src" filtering="true"/>
  </target>

  <!-- Must depend on jar since we use Xalan to process xml files -->
  <target name="prepare.docs" depends="jar,prepare.docs.nojardepends"/>
  
  <target name="prepare.docs.nojardepends">  
    <mkdir dir="${build.docs}"/> 
    <mkdir dir="${build.apidocs}"/>

    <gunzip src="${doc.generator.styletargz}"/>
    <untar src="${doc.generator.styletar}" dest="${xdocs.dir}"/>
    <delete file="${doc.generator.styletar}"/>

    <!-- We use a sed script to extract Xalan-Java 2 commits from the repository into commits.xml
         The following operation transforms commits.xml (just including source code commits) and 
         puts the result in xdocs/sources/xalan for inclusion in the readme.xml -->      
    <echo message="Transform commits.xml and put the result in ${xdocs.dir}"/>
    <java fork="yes" classname="${xalan.cmdline.class}" >
      <jvmarg value="-Djava.awt.headless=true"/>
      <classpath refid="docs.class.path" />
      <arg line="-in commits.xml -xsl ${xdocs.style}/stylesheets/done.xsl -out ${xdocs.DONE.file} -param xsltcdone ${xdocs.XSLTCDONE.file}"/>
    </java>
    <echo message="Generate Xalan-J 2.x design document"/>
    <java fork="yes" classname="${doc.generator}" >
      <jvmarg value="-Djava.awt.headless=true"/>
      <classpath refid="docs.class.path" />
      <arg line="loaderConfig=sbk:/style/loaderdesign.xml targetDirectory=./build/docs/design/
                 ./xdocs/sources/xalandesign.xml ./xdocs/style"/>
    </java>
  </target>

  <!-- =================================================================== -->
  <!-- Compile the DTM implementation and xml utilities                    -->
  <!-- =================================================================== -->
    <target name="xml.compile" depends="prepare,serializer.jar">
    <echo message="Compiling DTM implementation and utilities" />
    <javac srcdir="${src.dir}"
           destdir="${build.classes}"
           debug="${build.debug}" 
    	   target="${compiler.target}" source="${compiler.source}">
      <include name="${apachexml.reldir}/**/*.java" />
      <!-- exclude the serializer -->
      <exclude name="${serializer.reldir}/**/*.java" />      
      <!-- Exclude file that depends upon presence of Xerces in build path -->
      <exclude name="**/IncrementalSAXSource_Xerces.java" 
        unless="xerces.present"	 />
      <classpath refid="compile.class.path" />
    </javac>
    <!-- Copy needed properties, resource, etc. files to be put into .jar file -->
    <copy todir="${build.classes}">
      <fileset dir="${src.dir}" 
          includes="${apachexml.reldir}/**/*.properties" 
          excludes="${serializer.reldir}/**/*.properties"
      />
    </copy>  
  </target>
  
  <!-- =================================================================== -->
  <!-- Compile the Xalan interpreter source tree                           -->
  <!-- =================================================================== -->
  <target name="xalan-interpretive.compile" depends="xml.compile"
    description="Compile the Xalan interpretive classes (skips XSLTC)" >
    <echo message="Compiling Xalan interpretive classes" />
    <javac srcdir="${src.dir}" 
           destdir="${build.classes}"
           debug="${build.debug}" 
    	   target="${compiler.target}" source="${compiler.source}">
      <include name="${xpath.reldir}/**/*.java" />
      <include name="${domxpath.reldir}/**/*.java" />
      <include name="${xalan.reldir}/**/*.java" />
      <exclude name="${xsltc.reldir}/**/*.java" />
      <classpath refid="compile.class.path" />
      <!--
      <sourcepath refid="compile.source.path" />
      -->
    </javac>
    <!-- Copy needed properties, resource, etc. files to be put into .jar file -->
    <copy todir="${build.classes}">
      <fileset dir="${src.dir}" includes="**/*.properties,META-INF/services/*" excludes="**/XSLTInfo.properties"/>
    </copy>  
    <filter token="impl.version" value="${impl.version}"/>
    <copy todir="${build.classes}/org/apache/xalan/res" file="${XSLTInfo.props}" filtering="true"/>
  </target>
  
  <!-- Compile all java sources (Xalan interpretive and XSLTC) -->
  <target name="compile" depends="xalan-interpretive.compile,xsltc.compile"
    description="Compile all java source files (Xalan interpretive + XSLTC)" >
  </target>

  <!-- =================================================================== -->
  <!-- Compile just the XSLTC compiler portion                             -->
  <!-- =================================================================== -->
  <path id="xsltc.class.path">
    <pathelement location="${xmlapis.jar}" />
    <pathelement location="${build.serializer.jar}" />
    <pathelement location="${bcel.jar}" />
    <pathelement location="${jlex.jar}" />
    <pathelement location="${java_cup.jar}" />
    <pathelement location="${runtime.jar}" />
    <!-- build.classes needed for 
         org.apache.xalan.xsltc.util.JavaCupRedirect -->
    <pathelement location="${build.classes}" />
    <pathelement path="${java.class.path}" />
  </path>

  <!-- Attempt to determine dependency info for generated sources -->
  <target name="xsltc.prepare" depends="prepare" >
    <!-- The first step compiles the utils directory, which includes 
         a special wrapper for the xsltc.codegen / java_cup step next. -->
    <echo message="Compiling XSLTC utilities"/>
    <javac srcdir="${src.dir}" 
           destdir="${build.classes}"
           includes="${xsltc.reldir}/util/**/*.java"
           debug="${build.debug}"
    	   target="${compiler.target}" source="${compiler.source}">
      <classpath refid="xsltc.class.path" />
    </javac>
    <!-- These tricky uptodate statements hopefully determine if we 
         actually need to generate the java_cup and jlex files 
         in the two sub-targets below
    -->
    <uptodate property="xsltc.java_cup.not_needed" targetfile="${generated.xpathparser}" >
      <srcfiles dir="${src.dir}/${xsltc.reldir}/compiler" includes="xpath.cup" />
    </uptodate>

    <uptodate property="xsltc.jlex.not_needed" targetfile="${generated.xpathlexer}" >
      <srcfiles dir="${src.dir}/${xsltc.reldir}/compiler" includes="xpath.lex" />
    </uptodate> 
    
    <!-- Determine whether the support jars are already expanded -->
    <available file="${build.classes}/org/apache/bcel"     type="dir" property="xsltc.bcel_jar.not_needed" />
    <available file="${build.classes}/JLex"                type="dir" property="xsltc.jlex_jar.not_needed" />
    <available file="${build.classes}/java_cup/Main.class" type="file" property="xsltc.java_cup_jar.not_needed" />
    <available file="${build.classes}/java_cup/runtime"    type="dir" property="xsltc.runtime_jar.not_needed" />
    <available file="${build.classes}/org/apache/regexp"   type="dir" property="xsltc.regexp_jar.not_needed" />
  </target>

  <!-- Generate the XPath parser sources for xsltc if needed -->
  <target name="xsltc.java_cup" depends="xsltc.prepare" unless="xsltc.java_cup.not_needed">
    <!-- The second step generates sym.java and XPathParser.java. -->
    <echo message="java_cup preparsing"/>
    <java fork="yes" failonerror="true" 
       classname="org.apache.xalan.xsltc.util.JavaCupRedirect" >
      <jvmarg value="-Djava.awt.headless=true"/>
      <classpath refid="xsltc.class.path" />
      <!-- need to bootclasspath java_cup for JDKs that include JavaCupRedirect -->
      <jvmarg value="-Xbootclasspath/a:${java_cup.jar}${path.separator}${runtime.jar}"/>
      <!-- We're using JavaCupRedirect to call the java_cup application -->
      <arg line="-parser XPathParser -expect 0 
         -stdin ${src.dir}/${xsltc.reldir}/compiler/xpath.cup"/>
    </java>
    <echo message="java_cup move output files"/>
    <move file="XPathParser.java" tofile="${generated.xpathparser}"/>
    <move file="sym.java" tofile="${generated.xpathsym}"/>
  </target>
  
  <!-- Generate the XPath lexer sources for xsltc if needed -->
  <target name="xsltc.jlex" depends="xsltc.java_cup" unless="xsltc.jlex.not_needed">
    <!-- The third step generates XPathLexer.java. The lexiographical analyser
    has to be generated after sym.java, so order is important. -->
    <echo message="JLex preparsing"/>
    <java fork="yes" failonerror="true" classname="JLex.Main" >
      <jvmarg value="-Djava.awt.headless=true"/>
      <classpath refid="xsltc.class.path" />
      <arg line="${src.dir}/${xsltc.reldir}/compiler/xpath.lex"/>
    </java>
    <echo message="JLex move output file"/>
    <move file="${src.dir}/${xsltc.reldir}/compiler/xpath.lex.java" tofile="${generated.xpathlexer}"/>
  </target>

  <!-- Compile the main XSLTC classes -->
  <target name="xsltc.compile" depends="xsltc.java_cup,xsltc.jlex,xml.compile"
    description="Compile just the XSLTC classes" >
    <echo message="Compiling remaining XSLTC classes"/>
    <javac srcdir="${src.dir}" 
           destdir="${build.classes}"
           includes="${xsltc.reldir}/**/*.java"
           excludes="${serializer.reldir}/**/*.java"
           debug="${build.debug}"
    	   target="${compiler.target}" source="${compiler.source}"> 
      <classpath refid="xsltc.class.path" />
    </javac>
  </target>

  <!-- Compile just the XSLTC classes w/o JLex, JCup recompilation -->
  <target name="xsltc.fcompile" depends="xml.compile"
    description="Compile just the XSLTC classes w/o JLex, JCup recompilation" >
    <echo message="Compiling remaining XSLTC classes"/>
    <javac srcdir="${src.dir}" 
           destdir="${build.classes}"
           includes="${xsltc.reldir}/**/*.java"
           debug="${build.debug}"
    	   target="${compiler.target}" source="${compiler.source}">
      <classpath refid="xsltc.class.path" />
    </javac>
  </target>

  <!-- Jar up the XSLTC classes w/o the support jars -->
  <target name="xsltc.unbundledjar" depends="xsltc.compile"
    description="Jar just the xsltc.jar file" >
    <!-- Copy over the manifest, with filtering (for version number) -->
    <filter token="impl.version" value="${impl.version}"/>
    <filter token="java.version" value="${java.version}"/>
    <filter token="java.vendor" value="${java.vendor}"/>        
    <copy todir="${build.dir}" file="${manifest.xsltc.mf}" filtering="true"/>
    <jar jarfile="${build.xsltc.jar}" manifest="${build.dir}/manifest.xsltc" basedir="${build.classes}" >
      <patternset><!-- relative to jar/@basedir -->
        <include name="org/apache/xml/**" />
        <include name="${xsltc.reldir}/**/*" />
        <exclude name="org/apache/xalan/xsltc/util/JavaCupRedirect*" />
      </patternset>
    </jar>
  </target>

  <!-- Copy license and readme files for XSLTC support jars -->
  <target name="xsltc.copy-licenses" depends="xsltc.prepare">
  </target>

  <!-- A parametrized target which is used to copy and expand a XSLTC support jar -->
  <target name="xsltc.copy-deps-jar" unless="${param_unless}">
    <!-- copy the jar file to the build/classes directory -->
    <copy todir="${build.classes}" file="${lib.dir}/${param_jar_name}"/>
    
    <!-- unjar the jar file -->
    <unjar src="${build.classes}/${param_jar_name}" dest="${build.classes}" />
    
    <!-- remove the jar file -->
    <delete file="${build.classes}/${param_jar_name}" />
  </target>
  
  <!-- Copy and expand the XSLTC support jars if needed -->
  <target name="xsltc.copy-deps-jars" depends="xsltc.copy-licenses">
    <echo message="Copying XSLTC support jars" />
    <!-- copy the 3rd party support jar files -->
    <antcall target="xsltc.copy-deps-jar">
      <param name="param_unless" value="xsltc.bcel_jar.not_needed" />
      <param name="param_jar_name" value="${bcel.jar.name}" />
    </antcall>

<!-- We don't need to package the JLex or java_cup jars in the xalan.jar.
     These are only required for building XSLTC, not for using XSLTC.
     
    <antcall target="xsltc.copy-deps-jar">
      <param name="param_unless" value="xsltc.jlex_jar.not_needed" />
      <param name="param_jar_name" value="${jlex.jar.name}" />
    </antcall>

    <antcall target="xsltc.copy-deps-jar">
      <param name="param_unless" value="xsltc.java_cup_jar.not_needed" />
      <param name="param_jar_name" value="${java_cup.jar.name}" />
    </antcall>
-->

    <antcall target="xsltc.copy-deps-jar">
      <param name="param_unless" value="xsltc.runtime_jar.not_needed" />
      <param name="param_jar_name" value="${runtime.jar.name}" />
    </antcall>

    <delete dir="${build.classes}">
      <include name="java_cup/*.class" />
      <include name="java_cup/anttask/**" />
      <include name="java_cup/anttask" />
    </delete>

    <antcall target="xsltc.copy-deps-jar">
      <param name="param_unless" value="xsltc.regexp_jar.not_needed" />
      <param name="param_jar_name" value="${regexp.jar.name}" />
    </antcall>
    
    <!-- remove the old META-INF/MANIFEST.MF file -->
    <delete file="${build.classes}/META-INF/MANIFEST.MF" quiet="true"/>  
  </target>

  <!-- =================================================================== -->
  <!-- Creates the xsltc jar including all support jars                    -->
  <!-- =================================================================== -->
  <target name="xsltc.jar" depends="xsltc.compile,xsltc.copy-deps-jars"
     description="Jar xsltc,xml,BCEL,JLex,java_cup,runtime and jakarta regexp">

    <!-- create new META-INF dir w/ transformer factory default -->
    <!-- GTM: comment this out so that bundled xsltc.jar does not have
         service provider default until further notice 2/20/2002
    <mkdir dir="${build.dir}/xsltctmp/META-INF"/>
    <mkdir dir="${build.dir}/xsltctmp/META-INF/services"/>
    <copy todir="${build.dir}/xsltctmp/META-INF/services"
      file="${src.dir}/${xsltc.reldir}/javax.xml.transform.TransformerFactory"
    />
    -->

    <!-- Copy over the manifest, with filtering (for version number) -->
    <filter token="impl.version" value="${impl.version}"/>
    <filter token="java.version" value="${java.version}"/>
    <filter token="java.vendor" value="${java.vendor}"/>     
    <copy todir="${build.dir}" file="${manifest.xsltc.mf}" filtering="true"/>
    
    <!-- make bundled jar named xsltc.jar -->
    <jar jarfile="${build.dir}/xsltc.jar" manifest="${build.dir}/manifest.xsltc" >
      <fileset dir="${build.classes}">
        <include name="org/apache/xalan/xsltc/**"/>
        <exclude name="org/apache/xalan/xsltc/util/JavaCupRedirect*" />
      </fileset>
      <fileset dir="${build.classes}" includes="org/apache/xml/**" 
                                      excludes="${serializer.reldir}/**" />
      <fileset dir="${build.classes}" includes="org/apache/bcel/**" />
      <fileset dir="${build.classes}" includes="JLex/**" />
      <fileset dir="${build.classes}" includes="java_cup/**" />
      <fileset dir="${build.classes}" includes="org/apache/regexp/**" />
    </jar>

  </target>
  
  <!-- =================================================================== -->
  <!-- Creates the xalan interpretive jar                                  -->
  <!-- =================================================================== -->
  <target name="xalan-interpretive.jar" depends="xalan-interpretive.compile"
    description="Jar up everything in Xalan interpretive (without XSLTC)" >
    <!-- Copy over the manifest, with filtering (for version number) -->
    <filter token="impl.version" value="${impl.version}"/>
    <filter token="java.version" value="${java.version}"/>
    <filter token="java.vendor" value="${java.vendor}"/>     
    <copy todir="${build.dir}" file="${manifest.xalan-interpretive.mf}" filtering="true"/>
    <jar jarfile="${build.xalan-interpretive.jar}" manifest="${build.dir}/manifest.xalan-interpretive" basedir="${build.classes}" >
      <patternset><!-- relative to jar/@basedir -->
        <include name="${apachexml.reldir}/**/*" />
        <include name="${xpath.reldir}/**/*" />
        <include name="${xalan.reldir}/**/*" />
        <include name="${domxpath.reldir}/**/*" />        
        <include name="META-INF/services/*" />
        <exclude name="${xsltc.reldir}/**/*" />
        <exclude name="${serializer.reldir}/**/*" />
      </patternset>
    </jar>
  </target>
  
  <!-- =================================================================== -->
  <!-- Creates the xalan unbundled jar (Xalan interpretive + XSLTC -       -->
  <!-- support jars                                                        -->
  <!-- =================================================================== -->
  <target name="unbundledjar" depends="xalan-interpretive.compile,xsltc.compile"
    description="Jar up Xalan and XSLTC, without the XSLTC dependencies" >
    <filter token="impl.version" value="${impl.version}"/>
    <filter token="java.version" value="${java.version}"/>
    <filter token="java.vendor" value="${java.vendor}"/>     
    <copy todir="${build.dir}" file="${manifest.mf}" filtering="true"/>
    <jar jarfile="${build.xalan-unbundled.jar}" manifest="${build.dir}/MANIFEST.MF" basedir="${build.classes}" >
      <patternset>
        <include name="${apachexml.reldir}/**/*" />
        <include name="${xpath.reldir}/**/*" />
        <include name="${xalan.reldir}/**/*" />
        <include name="META-INF/services/*" />
        <exclude name="${xsltc.reldir}/util/JavaCupRedirect*" />
        <exclude name="${serializer.reldir}/**/*.*" />
      </patternset>    
    </jar>
  </target>
  
  <!-- =================================================================== -->
  <!-- Creates one big xalan jar (Xalan interpretive + XSLTC + support jars) -->
  <!-- =================================================================== -->
  <target name="jar" depends="xalan-interpretive.compile,xsltc.compile,xsltc.copy-deps-jars"
    description="Jar up everything (Xalan, XSLTC and XSLTC dependencies)" >
    
    <!-- Copy over the manifest, with filtering (for version number) -->
    <filter token="impl.version" value="${impl.version}"/>
    <filter token="java.version" value="${java.version}"/>
    <filter token="java.vendor" value="${java.vendor}"/>     
    <copy todir="${build.dir}" file="${manifest.mf}" filtering="true"/>
    
    <!-- make bundled jar named xalan.jar -->
    <jar jarfile="${build.xalan.jar}" manifest="${build.dir}/MANIFEST.MF"
         basedir="${build.classes}" >
       <patternset>
         <exclude name="${xsltc.reldir}/util/JavaCupRedirect*" />
         <exclude name="${serializer.reldir}/**/*" />
       </patternset>
    </jar>  
 
  </target>
  
  <!-- =================================================================== -->
  <!-- Default all target simply Creates the xalan JAR                     -->
  <!-- =================================================================== -->
  <target name="all" depends="serializer.jar,jar"><!-- 'Standardizing build.xml files' <bloritsch@apache.org> -->
    <echo message="Redirect to jar target; please provide input on desired functionality of this target"/>
  </target>
  
  <!-- =================================================================== -->
  <!-- Compiles the samples (servlet excluded) and jars the class files    -->  
  <!-- =================================================================== -->
  <target name="samples" depends="jar,samples.nojardepends,xsltc.samples"/>

  <target name="samples.nojardepends" depends="xsltc.samples.nojardepends"
    description="Compile and jar the samples (except servlet)" >
    <property name="exclude" value="*.xml,*.xsl,*.txt,*.html,*.properties,*.out"/>
    <mkdir dir="${build.samples}"/>
    <!-- Since the samples are packageless, they must be compiled separately. -->   
    <javac srcdir="${samples.dir}/SimpleTransform" 
           destdir="${build.samples}"  excludes="${exclude}"
           debug="${build.debug}"
    	   target="${compiler.target}" source="${compiler.source}">
      <classpath refid="samples.class.path" />
    </javac>           
    <javac srcdir="${samples.dir}/UseStylesheetPI"   
           destdir="${build.samples}"  excludes="${exclude}"
           debug="${build.debug}"
    	   target="${compiler.target}" source="${compiler.source}">
      <classpath refid="samples.class.path" />
    </javac>           
    <javac srcdir="${samples.dir}/UseStylesheetParam" 
           destdir="${build.samples}"  excludes="${exclude}"
           debug="${build.debug}"
    	   target="${compiler.target}" source="${compiler.source}">
      <classpath refid="samples.class.path" />
    </javac>           
    <javac srcdir="${samples.dir}/SAX2SAX"  
           destdir="${build.samples}"  excludes="${exclude}"
           debug="${build.debug}"
    	   target="${compiler.target}" source="${compiler.source}">
      <classpath refid="samples.class.path" />
    </javac>           
    <javac srcdir="${samples.dir}/DOM2DOM"  
           destdir="${build.samples}"  excludes="${exclude}"
           debug="${build.debug}"
    	   target="${compiler.target}" source="${compiler.source}">
      <classpath refid="samples.class.path" />
    </javac>           
    <javac srcdir="${samples.dir}/Pipe"  
           destdir="${build.samples}"  excludes="${exclude}"
           debug="${build.debug}" >
      <classpath refid="samples.class.path" />
    </javac>           
    <javac srcdir="${samples.dir}/UseXMLFilters"  
           destdir="${build.samples}"  excludes="${exclude}"
           debug="${build.debug}"
    	   target="${compiler.target}" source="${compiler.source}">
      <classpath refid="samples.class.path" />
    </javac>           
    <javac srcdir="${samples.dir}/Trace"   
           destdir="${build.samples}"  excludes="${exclude}"
           debug="${build.debug}"
    	   target="${compiler.target}" source="${compiler.source}">
      <classpath refid="samples.class.path" />
    </javac>           
    <javac srcdir="${samples.dir}/ApplyXPath"  
           destdir="${build.samples}" excludes="${exclude}" 
           debug="${build.debug}"
    	   target="${compiler.target}" source="${compiler.source}">
      <classpath refid="samples.class.path" />
    </javac>
    <javac srcdir="${samples.dir}/ApplyXPathDOM"  
           destdir="${build.samples}" excludes="${exclude}" 
           debug="${build.debug}"
    	   target="${compiler.target}" source="${compiler.source}">
      <classpath refid="samples.class.path" />
    </javac>             
    <javac srcdir="${samples.dir}/trax"  
           destdir="${build.samples}" excludes="${exclude}" 
           debug="${build.debug}"
    	   target="${compiler.target}" source="${compiler.source}">
      <classpath refid="samples.class.path" />
    </javac>           
    <javac srcdir="${samples.dir}/extensions"  
           destdir="${build.samples}" excludes="${exclude}" 
           debug="${build.debug}"
    	   target="${compiler.target}" source="${compiler.source}">
      <classpath refid="samples.class.path" />
    </javac>           
    <javac srcdir="${samples.dir}/Validate"  
           destdir="${build.samples}" excludes="${exclude}" 
           debug="${build.debug}"
    	   target="${compiler.target}" source="${compiler.source}">
      <classpath refid="samples.class.path" />
    </javac> 
    <javac srcdir="${samples.dir}/TransformThread"  
           destdir="${build.samples}" excludes="${exclude}" 
           debug="${build.debug}"
    	   target="${compiler.target}" source="${compiler.source}">
      <classpath refid="samples.class.path" />
    </javac>
    <javac srcdir="${samples.dir}/XPathAPI"  
           destdir="${build.samples}" excludes="${exclude}" 
           debug="${build.debug}"
    	   target="${compiler.target}" source="${compiler.source}">
      <classpath refid="samples.class.path" />
    </javac>               
    <jar jarfile="${build.samples.jar}" basedir="${build.samples}"
         includes="*.class"/>
  </target>

  <!-- =================================================================== -->
  <!-- Compiles all samples that require extra standard components in      -->
  <!-- order to compile.                                                   -->
  <!-- =================================================================== -->
  <target name="extra.std.samples"
          depends="servlet,xsltc.applet,xsltc.ejb,xsltc.servlet"/>
          
  <target name="extra.std.samples.nojardepends"
          depends="servlet.jardepends,xsltc.applet.nojardepends,
                   xsltc.ejb.jardepends,xsltc.servlet.jardepends"/>

  <!-- =================================================================== -->
  <!-- Compiles all samples that require extra non-standard components in  -->
  <!-- order to compile.                                                   -->
  <!-- =================================================================== -->
  <target name="extra.nonstd.samples" depends="xsltc.brazil"/>
  
  <target name="extra.nonstd.samples.nojardepends" depends="xsltc.brazil.jardepends"/>

  <!-- =================================================================== -->
  <!-- Compiles the sample servlet and jars the class files.               --> 
  <!-- The javax.servlet and javax.servlet.http packages                   -->
  <!-- must be on the classpath                                            -->
  <!-- =================================================================== -->
  <target name="servlet" depends="jar,servlet.jardepends"/>

  <target name="servlet.jardepends"
    description="Compile and jar the servlet samples in xalanservlet.war" >
     <echo message="To compile the sample servlets, javax.servlet and javax.servlet.http must be on the classpath"/>   
     <mkdir dir="${build.servlet}"/>
     <mkdir dir="${build.servlet}/WEB-INF/classes/servlet"/>
     <mkdir dir="${build.servlet}/WEB-INF/lib"/>
     <javac srcdir="${samples.dir}/servlet"
            destdir="${build.servlet}/WEB-INF/classes"
            debug="${build.debug}"
     	    target="${compiler.target}" source="${compiler.source}">
        <classpath refid="samples.class.path" />
        <classpath location="${servlet-api.jar}" />
     </javac>           
      <copy todir="${build.servlet}/WEB-INF/classes/servlet">
        <fileset dir="${samples.dir}/servlet" includes="media.properties"/>
      </copy>  		         
      <copy todir="${build.servlet}/WEB-INF">
        <fileset dir="${samples.dir}/servlet" includes="web.xml"/>
      </copy>
      <copy todir="${build.servlet}">
        <fileset dir="${samples.dir}/servlet" 
        		includes="birds.xml, birds.xsl, booklist1.xsl, 
        		booklist2.xsl, catalog.xml, fooparam.xml, fooparam.xsl, jspSample.jsp"/>
      </copy>
      <copy todir="${build.servlet}/WEB-INF/lib">
      	<fileset dir="${lib.dir}" includes="${parser.jar.name}, ${xmlapis.jar.name}"/>
      </copy>
      <copy file="${build.xalan.jar}" todir="${build.servlet}/WEB-INF/lib" />
    <jar jarfile="${build.servlet.war}" 
         basedir="${build.servlet}" 
         includes="**"/>
  </target>
 
  <!-- =================================================================== -->
  <!-- Compiles (does not jar) the translet samples.                       -->
  <!-- For time being, classes are generated in place.                     -->
  <!-- To run these samples, add xsltc.jar, runtime.jar, bcel.jar,         -->
  <!-- and java_cup.jar (all in the bin directory) to the classpath        --> 
  <!--                                                                     -->
  <!-- When we have straightened out classpath issues,                     -->
  <!-- add samples in CompiledApplet, CompiledBrazil, CompiledEJB and      -->
  <!-- CompiledServlet.                                                    -->
  <!-- =================================================================== -->
  <target name="xsltc.samples" depends="jar,xsltc.samples.nojardepends"/>

  <target name="xsltc.samples.nojardepends">
    <mkdir dir="${build.samples}"/>
    <javac srcdir="${samples.dir}/translets"
           classpath="${java.class.path}:${build.xalan.jar}" 
           destdir="${build.samples}" excludes="${exclude}" 
           debug="${build.debug}"
  	       target="${compiler.target}" source="${compiler.source}"/>
    <javac srcdir="${samples.dir}/CompiledJAXP"
           destdir="${build.samples}" excludes="${exclude}"
           debug="${build.debug}"
  	       target="${compiler.target}" source="${compiler.source}"/>
  </target>

  <!-- =================================================================== -->
  <!-- Compiles the XSLTC applet example and jars the class files.         --> 
  <!-- =================================================================== -->
  <target name="xsltc.applet" depends="jar,xsltc.applet.nojardepends"/>

  <target name="xsltc.applet.nojardepends">
    <mkdir dir="${build.samples}/CompiledApplet"/>
    <javac srcdir="${samples.dir}/CompiledApplet"
           destdir="${build.samples}/CompiledApplet" excludes="${exclude}"
           debug="${build.debug}"
    	   target="${compiler.target}" source="${compiler.source}"/>
    <jar jarfile="${build.xsltc.applet.jar}"
         basedir="${build.samples}/CompiledApplet"
         includes="*.class"/>
  </target>

  <!-- =================================================================== -->
  <!-- Compiles the XSLTC brazil example and jars the class files.         --> 
  <!-- =================================================================== -->
  <target name="xsltc.brazil" depends="jar,xsltc.brazil.jardepends"/>

  <target name="xsltc.brazil.jardepends">
    <mkdir dir="${build.samples}/CompiledBrazil"/>
    <javac srcdir="${samples.dir}/CompiledBrazil"
           destdir="${build.samples}/CompiledBrazil" excludes="${exclude}"
           debug="${build.debug}"
    	   target="${compiler.target}" source="${compiler.source}">
    	<classpath location="${brazil.jar}"/>
  	</javac>
    <jar jarfile="${build.xsltc.brazil.jar}"
         basedir="${build.samples}/CompiledBrazil"
         includes="*.class"/>
  </target>

  <!-- =================================================================== -->
  <!-- Compiles the XSLTC EJB example and jars the class files.            --> 
  <!-- ejb.jar must be on the classpath to compile this sample.            -->
  <!-- EJB 2.0 can be found at http://java.sun.com/products/ejb/docs.html  -->
  <!-- =================================================================== -->
  <target name="xsltc.ejb" depends="jar,xsltc.ejb.jardepends"/>

  <target name="xsltc.ejb.jardepends">
    <mkdir dir="${build.samples}/CompiledEJB"/>
    <javac srcdir="${samples.dir}/CompiledEJB"
           destdir="${build.samples}/CompiledEJB" excludes="${exclude}"
           debug="${build.debug}"
    	   target="${compiler.target}" source="${compiler.source}">
    	<classpath location="${javaee-api.jar}"/>
    </javac>
    <jar jarfile="${build.xsltc.ejb.jar}"
         basedir="${build.samples}/CompiledEJB"
         includes="*.class"/>
  </target>

  <!-- =================================================================== -->
  <!-- Compiles the XSLTC servlet example and jars the class files.        --> 
  <!-- =================================================================== -->
  <target name="xsltc.servlet" depends="jar,xsltc.servlet.jardepends" />

  <target name="xsltc.servlet.jardepends">
    <mkdir dir="${build.samples}/CompiledServlet"/>
    <javac srcdir="${samples.dir}/CompiledServlet"
           destdir="${build.samples}/CompiledServlet" excludes="${exclude}"
           debug="${build.debug}"
    	   target="${compiler.target}" source="${compiler.source}">
    	<classpath location="${servlet-api.jar}"/>
    </javac>
    <jar jarfile="${build.xsltc.servlet.jar}"
         basedir="${build.samples}/CompiledServlet"
         includes="*.class"/>
  </target>

 
  <!-- =================================================================== -->
  <!-- Generate HTML docs                                                  -->
  <!-- =================================================================== -->
  <target name="docs" depends="jar,docs.nojardepends,xsltc.docs"/>
  
  <target name="docs.nojardepends" depends="prepare.docs.nojardepends,autodocs"  
    description="Build the documentation (overview, readme, etc.)" >
    <echo message="docs is human-usable target with dependencies"/>  
  </target>
  
  <target name="autodocs">
    <echo message="autodocs is for automated build process, without dependencies"/>   
    <java fork="yes" 
          classname="${doc.generator}" 
          classpathref="docs.class.path" >
      <jvmarg value="-Djava.awt.headless=true"/>
       <arg line="targetDirectory=${build.docs} ${xdocs.book} ${xdocs.style}"/>
    </java>	 
  </target>
  
  <!-- =================================================================== -->
  <!-- Creates the API documentation                                       -->
  <!-- =================================================================== -->
  <target name="javadocs" depends="jar,javadocs.nojardepends"/>
  
  <target name="javadocs.nojardepends" depends="prepare.docs.nojardepends,autojavadocs"
    description="Build the Javadocs for Xalan 2.x and jaxp sources" >
    <echo message="javadocs is human-usable target with dependencies"/> 
    
    <!-- Expand jaxp sources (JAXP 1.1, DOM 2, and SAX 2) into source tree for 
         inclusion in the Javadoc. -->           
    <!-- Note this is into the src area.-->                                          
    <gunzip src="${xml-commons-srcs.tar.gz}" dest="${build.dir}" />                                                                         
    <untar src="${xml-commons-srcs.tar}" 
           dest="${src.dir}">
       <patternset>
         <include name="**.java"/>
       </patternset>
    </untar>
           
    <delete file="${xml-commons-srcs.tar}"/>
         
    <antcall target="autojavadocs"/>
     
    <!-- remove the jaxp sources -->
    <delete dir="${src.dir}/javax" />
    <delete dir="${src.dir}/org/w3c" />
    <delete dir="${src.dir}/org/xml" />
    <delete dir="${src.dir}/org/apache/xmlcommons" />
    <delete file="${src.dir}/manifest.commons" />
         
  </target>

  <target name="autojavadocs" 
          depends="autojavadocs-1.4-or-higher-if,autojavadocs-non1.4-or-higher-if">
    <echo message="autojavadocs is for automated build process, without dependencies"/>
  </target>

  <target name="check-using-java-1.4-or-higher">
    <condition property="using-java-1.4-or-higher">
      <not>
          <or>
            <equals arg1="${ant.java.version}" arg2="1.1"/>
            <equals arg1="${ant.java.version}" arg2="1.2"/>
            <equals arg1="${ant.java.version}" arg2="1.3"/>
          </or>
      </not>
    </condition>
  </target>

  <target name="autojavadocs-1.4-or-higher-if" if="using-java-1.4-or-higher" 
          depends="check-using-java-1.4-or-higher">
    <antcall target="autojavadocs-1.4-or-higher"/>
  </target>

  <target name="autojavadocs-non1.4-or-higher-if" unless="using-java-1.4-or-higher" 
          depends="check-using-java-1.4-or-higher">
    <antcall target="autojavadocs-non1.4-or-higher"/>
  </target>

  <target name="autojavadocs-1.4-or-higher">
    
    <!-- Ant ignores destdir arg if doclet is set, so must send to doclet in doclet subelement-->
    <javadoc
         additionalparam="-breakiterator"
         destdir="${build.apidocs}"
         maxmemory="512m"
         public="true"
         sourcepath="${src.dir}"
         overview="${src.dir}/javadocOverview.html"
         packagenames="org.apache.*,org.xml.*,org.w3c.*,javax.xml.*"
         author="true"
         version="true"
         use="true"
         windowtitle="${Name-in-docs} ${impl.version}" 
         doctitle="${Name-in-docs} ${impl.version}"
         bottom="Copyright &#169; ${year} Apache XML Project. All Rights Reserved.">
          <classpath refid="docs.class.path" />
          <!--
          <taglet name="xalan2jtaglet.XSLUsageTag" path="${taglet.jar}"/>
          -->
          <group title="Transformations API for XML (TrAX)" packages="javax.xml.transform*"/>
          <group title="Java API for XML Parsing" packages="javax.xml.parsers"/>
          <group title="Xalan Core"
                 packages="org.apache.xalan.processor:org.apache.xalan.templates:org.apache.xalan.transformer"/>
          <group title="XPath" packages="org.apache.xpath*"/>
          <group title="Document Table Model (DTM)" packages="org.apache.xml.dtm*"/>          
          <group title="Utilities" packages="org.apache.xml.utils*"/>
          <group title="Xalan Other" packages="org.apache.xalan.client:org:org.apache.xalan.extensions:org.apache.xalan.res:org.apache.xalan.stree:org.apache.xalan.trace:org.apache.xalan.xslt"/>
          <group title="Xalan Extensions" packages="org.apache.xalan.lib*"/>
          <group title="Serializers" packages="org.apache.xml.serialize*, org.apache.xalan.serialize"/>
          <group title="SAX 2" packages="org.xml.sax*"/>
          <group title="DOM 2" packages="org.w3c.dom*"/>
          <group title="XSLTC Core"
                 packages="org.apache.xalan.xsltc*"/>
    </javadoc>
  </target>

  <target name="autojavadocs-non1.4-or-higher">
      
    <!-- Ant ignores destdir arg if doclet is set, so must send to doclet in doclet subelement-->
    <javadoc
         public="true"
         sourcepath="${src.dir}"
         overview="${src.dir}/javadocOverview.html"
         packagenames="org.apache.*,org.xml.*,org.w3c.*,javax.xml.*"
         author="true"
         version="true"
         use="true"
         windowtitle="${Name-in-docs} ${impl.version}" 
         doctitle="${Name-in-docs} ${impl.version}"
         bottom="Copyright &#169; ${year} Apache XML Project. All Rights Reserved.">
          <classpath refid="docs.class.path" />
          <doclet name="xalanjdoc.Standard" path="${doclet.jar}">
            <param name="-d" value="${build.apidocs}"/>
          </doclet>
          <group title="Transformations API for XML (TrAX)" packages="javax.xml.transform*"/>
          <group title="Java API for XML Parsing" packages="javax.xml.parsers"/>
          <group title="Xalan Core"
                 packages="org.apache.xalan.processor:org.apache.xalan.templates:org.apache.xalan.transformer"/>
          <group title="XPath" packages="org.apache.xpath*"/>
          <group title="Document Table Model (DTM)" packages="org.apache.xml.dtm*"/>          
          <group title="Utilities" packages="org.apache.xml.utils*"/>
          <group title="Xalan Other" packages="org.apache.xalan.client:org:org.apache.xalan.extensions:org.apache.xalan.res:org.apache.xalan.stree:org.apache.xalan.trace:org.apache.xalan.xslt"/>
          <group title="Xalan Extensions" packages="org.apache.xalan.lib*"/>
          <group title="Serializers" packages="org.apache.xml.serialize*, org.apache.xalan.serialize"/>
          <group title="SAX 2" packages="org.xml.sax*"/>
          <group title="DOM 2" packages="org.w3c.dom*"/>
          <group title="XSLTC Core"
                 packages="org.apache.xalan.xsltc*"/>
    </javadoc>
  </target>

  <!-- =================================================================== -->
  <!-- Various targets to clean the build tree                             -->
  <!-- =================================================================== -->
  <target name="distclean" depends="clean"
    description="Clean everything, including dist/jar/docs/xsltc.*" >
    <delete dir="${dist.dir}"/>
  </target>

  <target name="clean" depends="xsltc.clean"
    description="Clean the ${build.dir} tree and doc outputs" >
    <delete dir="${build.dir}"/>
    <delete dir="${site.root}"/>
    <delete dir="${xalan.apache.org.site.root}"/>    
    <delete quiet="true">
      <fileset dir="${xdocs.style}" excludes="${xalanonly-styledocs}"/>
    </delete>
    <delete file="${xdocs.DONE.file}"/>
    <delete file="${xdocs.XSLTCDONE.location}"/>
    <delete file="${src.dir}/${xalan.reldir}/Version.java"/>
    <delete file="${src.dir}/${serializer.reldir}/Version.java"/>
    <delete file="${src.dir}/${xalan.reldir}/processor/XSLProcessorVersion.java"/>
    <delete file="${xdocs.dir}/sources/entities.ent"/>       
    <!-- Also delete files expanded from ${xml-commons-srcs.tar.gz}-->
    <delete dir="${src.dir}/javax" includeEmptyDirs="true" quiet="true"/>
    <delete dir="${src.dir}/org/xml" includeEmptyDirs="true" quiet="true"/>
    <delete dir="${src.dir}/org/w3c" includeEmptyDirs="true" quiet="true"/>
    <delete dir="${src.dir}/xdocs/style/graphics" includeEmptyDirs="true" quiet="true"/>
    <delete dir="${src.dir}/xdocs/style/resources" includeEmptyDirs="true" quiet="true"/>    
  </target>
 
  <target name="xsltc.clean"
    description="Clean miscellaneous generated sources from xsltc.compile" >
    <delete file="${generated.xpathparser}" />
    <delete file="${generated.xpathsym}" />
    <delete file="${generated.xpathlexer}" />
  </target>

  <!-- =================================================================== -->
  <!-- Install/Uninstall targets - not currently applicable                -->
  <!-- =================================================================== -->
  <target name="install"><!-- 'Standardizing build.xml files' <bloritsch@apache.org> -->
    <echo message="install target currently not supported in ${Name-in-docs}; try jar or dist instead"/>
  </target>
  <target name="uninstall"><!-- 'Standardizing build.xml files' <bloritsch@apache.org> -->
    <echo message="uninstall target currently not supported in ${Name-in-docs}; try distclean instead"/>
  </target>

  <!-- =================================================================== -->
  <!-- Creates a distribution that depends only on standard pieces         -->
  <!-- =================================================================== -->
  <target name="dist" depends="build.std.dist,autodist"
              description="Create a .zip/.tar.gz distribution module containing
                           all components without dependencies on non-standard
                           jars that are not part of the build system." >
    <echo message="dist is human-useable target for distribution, with only standard dependencies"/>
  </target>

  <target name="dist-nodocs" depends="build.std.dist-nodocs,autodist-nodocs"
              description="Create a .zip/.tar.gz distribution module containing
                           all components without dependencies on non-standard
                           jars that are not part of the build system." >
    <echo message="dist-nodocs is human-useable target for distribution, with only standard dependencies and no documentation "/>
  </target>

  <!-- =================================================================== -->
  <!-- Creates a complete distribution in which the xalan.jar contains     -->
  <!-- the interpretive, compiled and the common packages                  -->
  <!-- =================================================================== -->
  <target name="fulldist" depends="build.nonstd.dist,autodist"
          description="Create a .zip/.tar.gz distribution module containing
                       all components.">
    <echo message="fulldist is human-useable target for distribution, with all dependencies"/>
  </target>
  
  <target name="fulldist-nodocs" depends="build.nonstd.dist-nodocs,autodist-nodocs"
          description="Create a .zip/.tar.gz distribution module containing
                       all components.">
    <echo message="fulldist-nodocs is human-useable target for distribution, with all dependencies and no documentation"/>
  </target>  

  <!-- =================================================================== -->
  <!-- Creates a complete distribution with separate xalan.jar and         -->
  <!-- xsltc.jar.  The common packages are contained in each jar.          -->
  <!-- =================================================================== -->
  <target name="fulldist-separatejars" depends="build.nonstd-separatejars.dist,autodist"
          description="Create a .zip/.tar.gz distribution module containing
                       all components.">
    <echo message="fulldist is human-useable target for distribution, with all dependencies"/>
  </target>

  <target name="fulldist-separatejars-nodocs" depends="build.nonstd-separatejars.dist-nodocs,autodist-nodocs"
          description="Create a .zip/.tar.gz distribution module containing
                       all components.">
    <echo message="fulldist-separatejars-nodocs is human-useable target for distribution, with all dependencies and no documentation"/>
  </target>
  
  <target name="build.std.dist" depends="build.std.parts">
    <property name="has.nonstd.parts" value="false"/>
  </target>
  <target name="build.std.dist-nodocs" depends="build.std.parts-nodocs">
    <property name="has.nonstd.parts" value="false"/>
  </target>  

  <target name="build.nonstd.dist" depends="build.std.parts,build.nonstd.parts">
    <property name="has.nonstd.parts" value="true"/>
  </target>
  <target name="build.nonstd.dist-nodocs" depends="build.std.parts-nodocs,build.nonstd.parts">
    <property name="has.nonstd.parts" value="true"/>
  </target>  
  
  <target name="build.nonstd-separatejars.dist" depends="build.std-separatejars.parts,
                                                         build.nonstd-separatejars.parts">
    <property name="has.nonstd.parts" value="true"/>
  </target>
  <target name="build.nonstd-separatejars.dist-nodocs" depends="build.std-separatejars.parts-nodocs,
                                                                build.nonstd-separatejars.parts">
    <property name="has.nonstd.parts" value="true"/>
  </target>

  <target name="build.std.parts"
          depends="jar,docs,javadocs,samples,extra.std.samples,xsltc.docs"/>
          
  <target name="build.std.parts-nodocs"
          depends="jar,samples,extra.std.samples"/>          
          
  <target name="build.std-separatejars.parts"
          depends="xalan-interpretive.jar,xsltc.jar,
                   docs.nojardepends,javadocs.nojardepends,
                   samples.nojardepends,extra.std.samples.nojardepends,
                   xsltc.docs"/>
                    
  <target name="build.std-separatejars.parts-nodocs"
          depends="xalan-interpretive.jar,xsltc.jar,
                   samples.nojardepends,extra.std.samples.nojardepends"/>                            
          
  <target name="build.nonstd.parts" depends="extra.nonstd.samples"/>
  <target name="build.nonstd-separatejars.parts" depends="extra.nonstd.samples.nojardepends"/>

  <!-- =================================================================== -->
  <!-- Autodist targets.  Used by the distribution targets.                -->
  <!-- =================================================================== -->  
  <target name="autodist-mkdirs">
    <mkdir dir="${dist.dir}"/>
    <mkdir dir="${dist.dir}/lib"/>   
    <mkdir dir="${dist.dir}/samples"/>       
    <mkdir dir="${dist.dir}/src"/>
    <mkdir dir="${dist.dir}/tools"/>     
    <mkdir dir="${dist.dir}/xdocs"/>
  </target>

  <target name="autodist-mkdirs-docs">
    <mkdir dir="${dist.dir}/docs"/>
    <mkdir dir="${dist.dir}/docs/apidocs"/>
  </target>

  <target name="autodist-copy-files">

    <!-- Copy license files to distribution root -->
    <copy todir="${dist.dir}">
      <fileset dir=".">
        <include name="LICENSE.txt,NOTICE.txt"/>
      </fileset>
    </copy>

    <!-- Copy sources and source documentation -->
    <copy todir="${dist.dir}/src">
      <fileset dir="${src.dir}" excludes="javax/**,org/xml/**,org/w3c/**"/><!-- exclude jaxp, sax, dom -->
    </copy>
    <copy todir="${dist.dir}/xdocs">
      <fileset dir="${xdocs.dir}"/>
    </copy>

    <!-- Copy samples -->
    <copy todir="${dist.dir}/samples">
      <fileset dir="${samples.dir}"/>
    </copy>
    
    <!-- Copy tools; used for source distribution -->    
    <copy todir="${dist.dir}/tools">
      <fileset dir="${tools.dir}">
        <include name="*.*"/>
      </fileset>
    </copy>

    <!-- Copy runtime libs; used for source distribution -->    
    <copy todir="${dist.dir}/lib">
      <fileset dir="${lib.dir}">
        <include name="*.*"/>
      </fileset>
    </copy>    

    <!-- Copy built jars -->
    <copy file="${build.dir}/xalansamples.jar" todir="${dist.dir}/samples"/>
    <copy file="${build.dir}/xalanservlet.war" todir="${dist.dir}/samples"/>
    <copy file="${build.dir}/xsltcapplet.jar"  todir="${dist.dir}/samples"/>
    <copy file="${build.dir}/xsltcbrazil.jar"  todir="${dist.dir}/samples"
          failonerror="${has.nonstd.parts}"/>
    <copy file="${build.dir}/xsltcejb.jar"     todir="${dist.dir}/samples"/>
    <copy file="${build.dir}/xsltcservlet.jar" todir="${dist.dir}/samples"/>
    
    <copy file="${build.xalan.jar}" todir="${dist.dir}" />
    
    <!-- only copy the xsltc.jar file if it has been built -->
    <copy todir="${dist.dir}">
      <fileset dir="${build.dir}" includes="xsltc.jar"/>
    </copy>
    <copy file="${build.serializer.jar}" todir="${dist.dir}" />
    
    <copy file="${xmlapis.jar}" todir="${dist.dir}" />  
    <copy file="${parser.jar}" todir="${dist.dir}" />        

    <copy todir="${dist.dir}">
      <fileset dir="." includes="readme.html,KEYS,build.xml,build.sh,build.bat,commits.xml,
                                 LICENSE.txt,NOTICE.txt"/>      
    </copy>
  </target>

  <target name="autodist-copy-files-docs">
    <!-- Copy built documentation and javadoc -->
    <copy todir="${dist.dir}/docs">
      <fileset dir="${build.docs}"/>
    </copy>
  </target>

  <target name="autodist-create-bin-packages">
    <tar tarfile="${build.dir}/${dist.pkg}-bin.tar" >
      <tarfileset dir="${build.dir}">
        <patternset refid="bin-distro"/>
      </tarfileset>
    </tar>
    <gzip src="${build.dir}/${dist.pkg}-bin.tar" zipfile="${build.dir}/${dist.pkg}-bin.tar.gz"/>
    <delete file="${build.dir}/${dist.pkg}-bin.tar" />

    <zip zipfile="${build.dir}/${dist.pkg}-bin.zip" >
      <fileset dir="${build.dir}">
        <patternset refid="bin-distro"/>
      </fileset>
    </zip>
  </target>
  <target name="autodist-create-bin-packages-nodocs">
    <tar tarfile="${build.dir}/${dist.pkg}-bin-nodocs.tar" >
      <tarfileset dir="${build.dir}">
        <patternset refid="bin-distro-nodocs"/>
      </tarfileset>
    </tar>
    <gzip src="${build.dir}/${dist.pkg}-bin-nodocs.tar" zipfile="${build.dir}/${dist.pkg}-bin-nodocs.tar.gz"/>
    <delete file="${build.dir}/${dist.pkg}-bin-nodocs.tar" />

    <zip zipfile="${build.dir}/${dist.pkg}-bin-nodocs.zip" >
      <fileset dir="${build.dir}">
        <patternset refid="bin-distro-nodocs"/>
      </fileset>
    </zip>
  </target>
  <target name="autodist-create-src-packages">
    <tar tarfile="${build.dir}/${dist.pkg}-src.tar" >
      <tarfileset dir="${build.dir}">
        <patternset refid="src-distro"/>
        <patternset refid="xsltc-deps-jars"/>
      </tarfileset>
    </tar>
    <gzip src="${build.dir}/${dist.pkg}-src.tar" zipfile="${build.dir}/${dist.pkg}-src.tar.gz"/>
    <delete file="${build.dir}/${dist.pkg}-src.tar" />

    <zip zipfile="${build.dir}/${dist.pkg}-src.zip" >
      <fileset dir="${build.dir}">
        <patternset refid="src-distro"/>
        <patternset refid="xsltc-deps-jars"/>
      </fileset>
    </zip>
  </target>

  <target name="autodist">
    <echo message="autodist is for automated build processes, without dependencies"/>
    <antcall target="autodist-mkdirs"/>
    <antcall target="autodist-mkdirs-docs"/>
    <antcall target="autodist-copy-files"/>
    <antcall target="autodist-copy-files-docs"/>
    <antcall target="autodist-create-bin-packages"/>
    <antcall target="autodist-create-src-packages"/>
  </target>

  <target name="autodist-nodocs">
    <echo message="autodist-nodocs is for automated build processes, without dependencies"/>
    <antcall target="autodist-mkdirs"/>
    <antcall target="autodist-copy-files"/>
    <antcall target="autodist-create-bin-packages-nodocs"/>
    <antcall target="autodist-create-src-packages"/>
  </target>
  
  <!-- =================================================================== -->
  <!-- Creates the documentation tree for the xml.apache.org/xalan-j       -->
  <!-- website                                                             -->
  <!-- =================================================================== -->
  <target name="site" depends="prepare.docs,javadocs,xsltc.docs"
    description="Build documentation for posting to the website" >
 
    <mkdir dir="${site.dir}/apidocs"/>
    <mkdir dir="${site.dir}/design"/>
    <mkdir dir="${site.dir}/xsltc"/>    
    <java fork="yes" 
          classname="${doc.generator}" 
          classpathref="docs.class.path" >
      <jvmarg value="-Djava.awt.headless=true"/>
       <arg line="targetDirectory=${site.dir} ${site.book} ${xdocs.style}"/>
    </java>

    <!-- put xalan design doc in the site design subdir -->
    <copy todir="${site.dir}/design">
      <fileset dir="${build.docs}/design"/>
    </copy>
    <!-- put xsltc design doc in the site xsltc subdir -->
    <copy todir="${site.dir}/xsltc">
      <fileset dir="${build.docs}/xsltc"/>
    </copy>  
    
    <!-- put in the javadoc -->
    <copy todir="${site.dir}/apidocs">
      <fileset dir="${build.apidocs}"/>
    </copy>      
  </target>
  
  <!-- =================================================================== -->
  <!-- Creates the documentation tree for the xalan.apache.org website     -->
  <!-- =================================================================== -->
  <target name="xalan.apache.org.site"
    description="Build documentation for posting to the website" >
 
    <mkdir dir="${xalan.apache.org.site.dir}"/>
    <java fork="yes" 
          classname="${doc.generator}" 
          classpathref="docs.class.path" >
      <jvmarg value="-Djava.awt.headless=true"/>
       <arg line="targetDirectory=${xalan.apache.org.site.dir} ${xalan.apache.org.site.book} ${xdocs.style}"/>
    </java>

  </target>  
   
  <!-- =================================================================== -->
  <!-- Compiles and runs mini/smoketest from xml-xalan\test, if present    -->
  <!-- =================================================================== -->
  <property name="test.relpath" value="../test"/>

  <target name="minitest" depends="prepare,minitest-run,tests-not-available" 
    description="Run the Minitest from xml-xalan/test" >
    <!-- This target simply asks the minitest-run worker target to 
         actually have the Minitest run (by the test/build.xml file);
         we then also call the tests-not-available target in case 
         the user never checked out the tests.
    -->
  </target>
  <target name="minitest-run" if="tests-available" depends="jar" >
    <echo message=" [minitest] Calling ${test.relpath}/build.xml to run the Minitest" />
    <ant dir="${test.relpath}" antfile="build.xml" target="minitest.gump" >
    </ant>
  </target>

  <target name="smoketest" depends="prepare,smoketest-run,tests-not-available" 
    description="Run Smoketests (Minitest, conf, harness) from xml-xalan/test" >
  </target>
  <target name="smoketest-run" if="tests-available" depends="jar" >
    <echo message=" [minitest] Calling ${test.relpath}/build.xml to run the Smoketest" />
    <ant dir="${test.relpath}" antfile="build.xml" target="smoketest.dev" >
    </ant>
  </target>

  <target name="check" depends="smoketest"><!-- 'Standardizing build.xml files' <bloritsch@apache.org> -->
    <echo message="Redirect to smoketest target"/>
  </target>

  <!-- Called from various testing targets if the test dir doesn't exist. -->
  <target name="tests-not-available" unless="tests-available" >
    <echo message=" [tests] The tests do not seem to be present in ${test.relpath}" />
    <echo message=" [tests] You must have checked out from CVS to run the tests," />
    <echo message=" [tests]   it is not included in binary distributions." />
    <echo message=" [tests] See http://xml.apache.org/xalan-j/test/ for more info." />
  </target>

  <!-- =================================================================== -->
  <!-- Creates the xalan design document                                   -->
  <!-- =================================================================== -->
    <target name="xalan-j2-design">
    <java fork="yes" 
          classname="${doc.generator}" 
          classpathref="docs.class.path" >
      <jvmarg value="-Djava.awt.headless=true"/>
      <arg line="loaderConfig=sbk:/style/loaderdesign.xml targetDirectory=${build.dir}/docs/design/
      ${xdocs.dir}/sources/xalandesign.xml ${xdocs.style}"/>
    </java>
  </target>
  
  <!-- =================================================================== -->
  <!-- Use FOP to create preliminary print (pdf) doc                       -->
  <!-- Note: fop.jar and xml.jar (from xml-fop) must be on classpath       -->
  <!-- This is VERY preliminary, not yet for inclusion in distribution     -->
  <!-- =================================================================== -->
  <!--Collate the xml sources into a single xml source with a litle extra structure -->
  <target name="printerdocs" depends="prepare.docs">
    <echo message="NOTICE: requires fop.jar and xml.jar on the classpath"/>
    <java fork="yes" 
          classname="${xalan.cmdline.class}"
          classpathref="docs.class.path" >
      <jvmarg value="-Djava.awt.headless=true"/>
      <arg line="-xsl ${xdocs.dir}/sources/xalan-collate.xsl 
                 -out xdocs/sources/xalan/xalan-collate.xml"/>
    </java>
    
    <!-- Transform collation into Formatting Objects 
         (with a little work on links along the way) -->    
    <java fork="yes" 
          classname="${xalan.cmdline.class}"
          classpathref="docs.class.path" >
      <jvmarg value="-Djava.awt.headless=true"/>
      <arg line="-in  ${xdocs.dir}/sources/xalan/xalan-collate.xml
                 -param resourceFile '../../sources/xalan/resources.xml'
                 -param project ${Name-in-docs}      
                 -xsl ${xdocs.style}/stylesheets/xml2fo.xsl 
                 -out build/docs/xalan-collate.fo"/>
    </java>
    
    <!-- Use FOP to generate a pdf file (classpath may need updating! -sc 18-Apr-01)-->
    <java fork="yes" 
          classname="org.apache.fop.apps.CommandLine"
      classpath="${java.class.path}:${build.xalan.jar}:${bin.dir}/fop.jar:${bin.dir}/w3c.jar">
      <jvmarg value="-Djava.awt.headless=true"/>
      <arg line="${build.docs}/xalan-collate.fo build/docs/xalan.pdf"/>
    </java>
  </target>

 
  <!-- =================================================================== -->
  <!-- Build XSLTC design documentation. Eventually intend to incorporate -->
  <!-- XSLTC into the Xalan book.                                         -->
  <!-- =================================================================== -->


  <target name="xsltc.prepare.docs" depends="prepare.docs.nojardepends">
   <mkdir dir="${build.docs}/xsltc"/>
   <!--   
   <echo message="Transform xsltc_todo.xml and put the result in ${build.docs}/xsltc"/>
   <java fork="yes" classname="${xalan.cmdline.class}">
      <classpath refid="docs.class.path" />
      <arg line="-in xsltc_todo.xml -xsl todo.xsl -out build/docs/xsltc/todo.html"/>
   </java>  -->
  </target>  
 
 <target name="xsltc.docs" depends="xsltc.prepare.docs">
   <echo message="Build the XSLTC Architectural documentation"/>
   <java fork="yes" 
         classname="${doc.generator}" 
         classpathref="docs.class.path" >
      <jvmarg value="-Djava.awt.headless=true"/>
      <arg line="targetDirectory=${build.docs}/xsltc ${xdocs.dir}/sources/xsltc.xml ${xdocs.style}"/>
    </java>	 
    <copy todir="${build.docs}/xsltc" 
	file="${xdocs.dir}/sources/xsltc/README.xslt" />
    <copy todir="${build.docs}/xsltc" 
	file="${xdocs.dir}/sources/xsltc/README.xsltc" />
 </target>
 
   <!-- pack all doc for transfer to website -->
 <target name="pack.docs">
    <!--tar tarfile="./build/xalan-j-docs.tar" basedir="./xml-site/target/xalan-j" includes="**"/>
    <gzip src="./build/xalan-j-docs.tar" zipfile="./build/xalan-j-docs.tar.gz"/-->
    <zip zipfile="./build/xalan-j-docs.zip" basedir="./xml-site/target/xalan-j" includes="**"/>
  </target>


<!-- ####################################################
     # START OF SECTION TO BUILD STAND-ALONE SERIALIZER #
     #################################################### -->

  <!-- try not to use other properties directly when building the serializer -->
  <!-- either create new values, or copy, just in case we separate into      -->
  <!-- a totally new build.xml file                                          -->
  <property name="serializer.build.debug"   value="${build.debug}"            />
 
  
  <!-- PROPERTIES TO MAKE THE SOURCE DISTRIBUTION ========================== -->
  <property name="serializer.name"          value="serializer"                />
  <property name="serializer.version"       value="${version}"                />
  <property name="serializer.dist.file"     value="${serializer.name}-j_${serializer.version}"/>
  <property name="serializer.dist.dir"      value="${serializer.build.dir}/${serializer.dist.file}"/>

  <!-- patternset for source distribution packages -->
  <patternset id="serializer-src-distro" >
    <!-- some license and legal stuff -->
    <include name="${serializer.dist.file}/LICENSE.txt"/>
    <include name="${serializer.dist.file}/NOTICE.txt"/> 
    <include name="${serializer.dist.file}/KEYS"/>  

    <!-- The build stuff that uses Ant and this file itself, build.xml
         this is getting into a strange loop but the source distribution
         needs to build, and it uses this file, build.xml to do so ... -->
    <include name="${serializer.dist.file}/build.bat"/>
    <include name="${serializer.dist.file}/build.sh"/>
    <include name="${serializer.dist.file}/build.xml"/>

    <!-- The source code that the source distribution would build -->
    <include name="${serializer.dist.file}/src/${serializer.reldir}/**/*.java" />
    <include name="${serializer.dist.file}/src/${serializer.reldir}/**/*.properties" />
    <include name="${serializer.dist.file}/src/${serializer.manifest.basename}" />

    <!-- We need Ant in order to run build.xml in the source distribution -->
    <include name="${serializer.dist.file}/tools/ant.jar"/>
    <include name="${serializer.dist.file}/tools/antRun"/>
    <include name="${serializer.dist.file}/tools/antRun.bat"/>

    <!-- The serializer needs this jar in order to build -->
    <include name="${serializer.dist.file}/xml-apis.jar"/>
    
    <!-- Ant needs an XML parser in order to read in the build.xml, so it
         can even do the build ... this is a strange loop ... -->
    <include name="${serializer.dist.file}/xercesImpl.jar"/>
  </patternset>

  <!-- patternset for  binary distribution packages ... if needed
  <patternset id="serializer-bin-distro" >
    <include name="${serializer.dist.file}/LICENSE.txt"/>
    <include name="${serializer.dist.file}/NOTICE.txt"/>
    <include name="${serializer.dist.file}/KEYS"/>
    <include name="${serializer.dist.file}/${serializer.name}.jar"/>
    <include name="${serializer.dist.file}/${xmlapis.jar.name}"/>
    <include name="${serializer.dist.file}/${parser.jar.name}"/>    
  </patternset>
  -->
  
  <!-- =================================================================== -->
  <!-- Creates the Serializer jar                                          -->
  <!-- =================================================================== -->
  <target name="serializer.jar"
    depends="serializer.prepare,serializer.compile"
    description="Build the serializer and created serializer.jar" >
    <!-- Copy over the manifest, with filtering (for version number) -->
    <filter token="impl.version" value="${serializer.impl.version}"/>
    <filter token="java.version" value="${serializer.java.version}"/>
    <filter token="java.vendor"  value="${serializer.java.vendor}"/>
    <copy todir="${serializer.build.dir}" file="${serializer.manifest}" filtering="true"/>

    <jar jarfile="${build.serializer.jar}"
      manifest="${serializer.build.dir}/${serializer.manifest.basename}"
      basedir="${serializer.build.classes}" >
      <patternset><!-- relative to jar/@basedir -->
        <include name="${serializer.reldir}/**/*" />
      </patternset>
    </jar>
  </target>

  <target name="serializer.prepare">
    <mkdir dir="${serializer.build.dir}"/>
    <mkdir dir="${serializer.build.classes}"/>
  </target>

  <target name="serializer.compile">
    <echo message="Compiling the Serializer" />
    <javac srcdir="${serializer.src.dir}"
           destdir="${serializer.build.classes}"
           debug="${serializer.build.debug}" 
    	   target="${compiler.target}" source="${compiler.source}">
      <include name="${serializer.reldir}/**/*.java" />
      <classpath refid="compile.class.path" />
    </javac>
    <!-- Copy needed properties, resource, etc. files to be put into .jar file -->
    <copy todir="${serializer.build.classes}">
      <fileset dir="${serializer.src.dir}" includes="${serializer.reldir}/**/*.properties"/>
    </copy>

  </target>


  <!-- =================================================================== -->
  <!-- Creates the API documentation                                       -->
  <!-- =================================================================== -->
  <target name="serializer.javadocs"
    description="Build the Javadocs for the Serializer" >
    <echo message="javadocs is human-usable target with dependencies"/>  
    
    <mkdir dir="${build.docs}"/> 
    <mkdir dir="${build.apidocs}"/>
    <antcall target="serializer.autojavadocs"/>
  </target>

  <target name="serializer.autojavadocs" 
          depends="serializer.autojavadocs-1.4-or-higher-if,serializer.autojavadocs-non1.4-or-higher-if">
    <echo message="serializer.autojavadocs is for automated build process, without dependencies"/>
  </target>

  <target name="serializer.autojavadocs-1.4-or-higher-if" if="using-java-1.4-or-higher" 
          depends="check-using-java-1.4-or-higher">
    <antcall target="serializer.autojavadocs-1.4-or-higher"/>
  </target>

  <target name="serializer.autojavadocs-non1.4-or-higher-if" unless="using-java-1.4-or-higher" 
          depends="check-using-java-1.4-or-higher">
    <antcall target="serializer.autojavadocs-non1.4-or-higher"/>
  </target>

  <target name="serializer.autojavadocs-1.4-or-higher">
    
    <!-- Ant ignores destdir arg if doclet is set, so must send to doclet in doclet subelement-->
    <javadoc
         additionalparam="-breakiterator"
         destdir="${build.apidocs}"
         public="true"
         sourcepath="${src.dir}"
         packagenames="org.apache.*"
         author="true"
         version="true"
         use="true"
         windowtitle="${Name-in-docs} Serializer ${impl.version}" 
         doctitle="${Name-in-docs} Serializer ${impl.version}"
         bottom="Copyright ${year} Apache XML Project. All Rights Reserved.">
          <classpath refid="docs.class.path" />
          <taglet name="xalan2jtaglet.XSLUsageTag" path="${taglet.jar}"/>
          <group title="Serializer" packages="org.apache.xml.serialize*"/>
    </javadoc>
  </target>

  <target name="serializer.autojavadocs-non1.4-or-higher">
    <!-- Ant ignores destdir arg if doclet is set, so must send to doclet in doclet subelement-->
    <javadoc
         public="true"
         sourcepath="${src.dir}"
         packagenames="org.apache.*"
         author="true"
         version="true"
         use="true"
         windowtitle="${Name-in-docs} Serializer ${impl.version}" 
         doctitle="${Name-in-docs} Serializer ${impl.version}"
         bottom="Copyright ${year} Apache XML Project. All Rights Reserved.">
          <classpath refid="docs.class.path" />
          <doclet name="xalanjdoc.Standard" path="${doclet.jar}">
            <param name="-d" value="${build.apidocs}"/>
          </doclet>
          <group title="Serializer" packages="org.apache.xml.serialize*"/>
    </javadoc>
  </target>


  <!-- =================================================================== -->
  <!-- Create the serializer source distribution                           -->
  <!-- =================================================================== -->
  <target name="serializer-dist"
          depends="serializer.jar"
          description="Build the serializer source distribution .tar and .zip">
    <antcall target="serializer-autodist-mkdirs"/>
    <antcall target="serializer-autodist-copy-files"/>
      <!-- <antcall target="serializer-autodist-create-bin-packages"/> -->
    <antcall target="serializer-autodist-create-src-packages"/>
  </target>

  <target name="serializer-autodist-mkdirs">
    <echo message="Serializer: making distribution directories" />
    <mkdir dir="${serializer.dist.dir}"/> 
    <mkdir dir="${serializer.dist.dir}/src"/>
    <mkdir dir="${serializer.dist.dir}/tools"/>      
  </target>

  <target name="serializer-autodist-copy-files">
    <!-- Copy bin directory, which includes preexisting checked-in .jar files -->
<!--    <copy todir="${serializer.dist.dir}/bin">
      <fileset dir="${serializer.bin.dir}" />
    </copy> -->

    <echo message="Serializer: copy source files to ${serializer.dist.dir}/src" />
    <echo message="            ... from ${serializer.src.dir}/${serializer.reldir}" />
    <!-- Copy sources -->
    <copy todir="${serializer.dist.dir}/src/${serializer.reldir}">
      <fileset dir="${serializer.src.dir}/${serializer.reldir}"/>
    </copy>
    <!-- Copy the manifest -->
    <copy file="${serializer.src.dir}/${serializer.manifest.basename}"
          todir="${serializer.dist.dir}/src" />

    <!-- Copy built jars -->
    <copy file="${build.serializer.jar}" todir="${serializer.dist.dir}" />
    
    <!-- Copy runtime jars -->    
    <copy file="${lib.dir}/${xmlapis.jar.name}" todir="${serializer.dist.dir}" />
    <copy file="${lib.dir}/${parser.jar.name}" todir="${serializer.dist.dir}" />

    <!-- Copy licenses -->
    <copy todir="${serializer.dist.dir}">
      <fileset dir="." 
               includes="LICENSE.txt,NOTICE.txt"/>
    </copy>

    <!-- Copy tools -->
    <copy todir="${serializer.dist.dir}/tools">
      <fileset dir="./tools" includes="ant*"/>
    </copy>    

    <copy todir="${serializer.dist.dir}">
      <fileset dir="." includes="KEYS,build.xml,build.sh,build.bat"/>
    </copy>
  </target>

  <target name="serializer-autodist-create-bin-packages">
    <tar tarfile="${serializer.build.dir}/${serializer.dist.file}-bin.tar" >
      <tarfileset dir="${serializer.build.dir}">
        <patternset refid="serializer-bin-distro"/>
      </tarfileset>
    </tar>
    <gzip src="${serializer.build.dir}/${serializer.dist.file}-bin.tar" 
      zipfile="${serializer.build.dir}/${serializer.dist.file}-bin.tar.gz"/>

    <!--  
    <delete file="${serializer.build.dir}/${serializer.dist.file}-bin.tar" />
      -->

    <zip zipfile="${serializer.build.dir}/${serializer.dist.file}-bin.zip" >
      <fileset dir="${serializer.build.dir}">
        <patternset refid="serializer-bin-distro"/>
      </fileset>
    </zip>
  </target>

  <target name="serializer-autodist-create-src-packages">
    <tar tarfile="${serializer.build.dir}/${serializer.dist.file}-src.tar" >
      <tarfileset dir="${serializer.build.dir}">
        <patternset refid="serializer-src-distro"/>
      </tarfileset>
    </tar>
    <gzip src="${serializer.build.dir}/${serializer.dist.file}-src.tar" zipfile="${serializer.build.dir}/${serializer.dist.file}-src.tar.gz"/>

    <delete file="${serializer.build.dir}/${serializer.dist.file}-src.tar" />

    <zip zipfile="${serializer.build.dir}/${serializer.dist.file}-src.zip" >
      <fileset dir="${serializer.build.dir}">
        <patternset refid="serializer-src-distro"/>
      </fileset>
    </zip>
  </target>
<!-- ##################################################
     # END OF SECTION TO BUILD STAND-ALONE SERIALIZER #
     ################################################## -->

</project>