File: build.xml

package info (click to toggle)
libdb-je-java 3.3.98-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 13,064 kB
  • sloc: java: 153,077; xml: 2,034; sh: 11; makefile: 5
file content (1581 lines) | stat: -rw-r--r-- 61,553 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
<?xml version="1.0"?>

<!-- ============================================ -->
<!-- Ant Build File for Berkeley DB Java Database -->
<!-- ============================================ -->

<project name="JE" default="jar" basedir=".">
<description>Compile and test JE</description>

    <fail message="Ant 1.7.0 or greater is required">
      <condition><not><antversion atleast="1.7.0"/></not></condition>
    </fail>

    <!-- Modify build.properties to point to the proper j2ee paths for
         JCA and JMX support  -->
    <property file="build.properties"/>

    <property name="srcdir" value="${basedir}/src"/>
    <property name="builddir" value="${basedir}/build"/>
    <property name="destdir" value="${builddir}/classes"/>
    <condition property="specificjar" value="${testjar}">
      <isset property="testjar"/>
    </condition>
    <condition property="specificjar" value="${destdir}">
      <not>
        <isset property="testjar"/>
      </not>
    </condition>
    <property name="libdir" value="${builddir}/lib"/>
    <property name="extdir" value="${basedir}/ext"/>

    <property name="dist.srcdir" value="${basedir}/dist"/>
    <property name="dist.destdir" value="${builddir}/dist"/>

    <property name="unittest.srcdir" value="${basedir}/test"/>
    <property name="unittest.dir" value="${builddir}/test"/>
    <property name="unittest.destdir" value="${unittest.dir}/classes"/>
    <property name="unittest.datadir" value="${unittest.dir}/data"/>
    <property name="unittest.extraenvdir" value="${unittest.destdir}/propTest"/>
    <property name="unittest.extraenvdir2" value="${unittest.destdir}/propTest2"/>
    <property name="unittest.reportsdir" value="${unittest.dir}/reports"/>
    <property name="unittest.testserialdir" value="${unittest.dir}/testserial"/>
    <property name="unittest.testevolvedir" value="${unittest.dir}/testevolve"/>

    <property name="doc.dir" value="${basedir}/docs"/>
    <property name="doc.javadir" value="${doc.dir}/java"/>
    <property name="docsrc.dir" value="${basedir}/docs_src"/>
    <property name="doclet.classes.dir"  
              value="${doc.dir}/doclet/Classes"/>
    <property name="doclet.src.dir" value="${doc.dir}/doclet"/>
    <property name="doclet.jar" value="${doc.dir}/HidingDoclet.jar"/>

    <property name="jarfile" value="${libdir}/je.jar"/>
    <property name="jcararfile" value="${libdir}/jejca.rar"/>
    <property name="srczipfile" value="${basedir}/src.zip"/>
    <property name="buildzipfile" value="${basedir}/build.zip"/>
    <property name="zipfile" value="${basedir}/je.zip"/>
    <property name="plugin.id" value="com.sleepycat.je"/>

    <property name="clover.tmpdir" value="${builddir}/tmp"/>
    <property name="clover.initstring"
              location="${clover.tmpdir}/jecoverage.db"/>
      <property name="clover.libdir" value="/clover/lib"/>
    <property name="clover.excludes" value="**/rpcserver/** **/je/examples/** **/je/junit/** **/*Test.java **/*TestBase.java **/compat/** **/je/util/**"/>

    <property name="example.srcdir" value="${basedir}/examples"/>
    <property name="example.destdir" value="${destdir}"/>

    <property name="packages" value="com.sleepycat.*"/>
    <property file="${user.home}/ant.properties"/>
    <property name="build.propertyfile"
              value="${dist.destdir}/build.properties"/>
    <property name="installdestdir" value="/usr/local"/>

    <!--
    Can be used to specify a different JVM for <java> tasks, for example:
      ant "-Djvm=/usr/local/jdk1.6.0_01/bin/java" ...
    -->
    <property name="jvm" value="java"/>

    <!--
    Can be used to override JVM args for <java> tasks, for example:
      ant "-Djvmargs=-Xmx32M -client" ...
    -->
    <property name="jvmargs" value=""/>

    <!--
    For unit testing using different default isolation levels.  May be:
     empty string (repeatableRead)
     readCommitted (degree 2)
     serializable (degree 3)
    -->
    <property name="isolationLevel" value=""/>

    <!-- For long and short version of unit tests. May be:
               empty string (false);
	       true
	       false
    -->
    <property name="longtest" value="false"/>

    <path id="empty.classpath"/>

    <path id="class.path">
      <pathelement location="${specificjar}"/>
      <pathelement location="."/>
    </path>

    <path id="unittest.classpath">
      <pathelement location="${specificjar}"/>
      <pathelement location="."/>
      <pathelement location="${unittest.destdir}"/>
    </path>

    <path id="clover.classpath">
      <pathelement path="${clover.libdir}/clover.jar"/>
      <pathelement path="${clover.libdir}/velocity.jar"/>
    </path>

    <path id="unittest-j2ee.classpath">
      <pathelement location="${destdir}"/>
      <pathelement location="."/>
      <pathelement location="${unittest.destdir}"/>
      <pathelement location="${examples.destdir}"/>
      <pathelement path="${j2ee.jarfile}"/>
    </path>

    <path id="jca.classpath">
      <pathelement location="${destdir}"/>
      <pathelement location="."/>
      <pathelement path="${j2ee.jarfile}"/>
      <pathelement path="${example.resources}"/>
    </path>

    <path id="j2ee.classpath">
      <pathelement location="${destdir}"/>
      <pathelement location="."/>
      <pathelement path="${j2ee.jarfile}"/>
    </path>

    <fileset id="jarclasses" dir="${destdir}"
             includes="com/sleepycat/asm/**/*.class,
                       com/sleepycat/bind/**/*.class,
                       com/sleepycat/collections/**/*.class,
                       com/sleepycat/compat/**/*.class,
                       com/sleepycat/je/**/*.class,
                       com/sleepycat/persist/**/*.class,
                       com/sleepycat/util/**/*.class"
             excludes="com/sleepycat/je/rep/**/*.class"/>

    <target name="buildDbg">
    <description>debug the build file itself</description>
      <property name="classpath.string" refid="class.path"/>
      <property name="unittestclasspath.string" refid="unittest.classpath"/>
      <echoproperties/>
    </target>

    <!-- ============================================================ -->
    <!-- Global Targets                                               -->
    <!-- ============================================================ -->
    <target name="init">
        <mkdir dir="${builddir}"/>
        <mkdir dir="${destdir}"/>
        <mkdir dir="${libdir}"/>
        <mkdir dir="${dist.destdir}"/>
        <mkdir dir="${doc.dir}"/>
        <mkdir dir="${doc.javadir}"/>
        <mkdir dir="${clover.tmpdir}"/>
        <mkdir dir="${unittest.dir}"/>
        <mkdir dir="${unittest.destdir}"/>
        <mkdir dir="${unittest.extraenvdir}"/>
        <mkdir dir="${unittest.extraenvdir2}"/>
        <mkdir dir="${unittest.testserialdir}"/>
        <mkdir dir="${unittest.testevolvedir}"/>
        <tstamp/>
	<antcall target="do-internal">
	   <param name="target" value="init"/>
        </antcall>
    </target>

    <target name="compile"
            depends="compile-src,
	             compile-examples,
		     compile-unittest">
	<antcall target="do-internal">
	   <param name="target" value="compile"/>
        </antcall>
    </target>

    <target name="compile-j2ee"
            depends="check-j2ee-present,
	             compile-jmx,
	             compile-jca"/>
       
    <target name="check-j2ee-present">
        <available classname="javax.resource.ResourceException"
	           property="j2eelib.present">
	  <classpath refid="j2ee.classpath"/>
	</available>

	<fail message="You need to set the 'j2ee.jarfile' property in
	the build.properties file"
	      unless="j2eelib.present"/>

    </target>

    <!-- ====== Internal (non-public) targets delegated to internal.xml =======

    For each top level target in internal.xml, a target here is used to compile
    all JE and internal sources and then invoke the target via internal.xml.
    Any other parameters for each target are passed using properties (-D
    propName=propValue).
    ======================================================================= -->
    <target name="do-internal">
       <ant antfile="ant/internal.xml" target="${target}"
            inheritAll="true" inheritrefs="true"/>
    </target>
    
    <!-- ============================================================ -->
    <!-- Clean                                                        -->
    <!-- ============================================================ -->
    <target name="clean" depends="clean-src,
                                  clean-unittest,
                                  clean-clover,
				  clean-jar,
                                  clean-package">
	<antcall target="do-internal">
	   <param name="target" value="clean"/>
        </antcall>
    </target>

    <!-- ============================================================ -->
    <!-- Compiles                                                     -->
    <!-- ============================================================ -->
    <target name="clean-src" depends="init">
        <delete>
            <fileset dir="${destdir}"
             includes="**/*.class,**/package.html,**/*.xml"/>
        </delete>
        <delete dir="${dist.destdir}"/>
    </target>

    <target name="compile-src" depends="init">
        <ant antfile="ant/compile.xml" dir="." inheritall="false">
            <reference refid="class.path" torefid="compile.classpath"/>
        </ant>
        <!-- Enhance the built-in persistent proxy classes. -->
        <taskdef name="enhancer"
                 classname="com.sleepycat.persist.model.ClassEnhancerTask">
          <classpath refid="class.path"/>
        </taskdef>
        <enhancer verbose="off">
          <fileset dir="${destdir}"
                   includes="com/sleepycat/persist/impl/*Proxy.class"/>
        </enhancer>
    </target>

    <target name="compile-examples" depends="compile-src">
        <ant antfile="ant/compile.xml" dir="." inheritall="false">
            <property name="srcdir" value="${example.srcdir}"/>
            <property name="include" value="**/*.java"/>
            <property name="exclude1" value="jmx/**/*.java"/>
            <property name="exclude2" value="jca/**/*.java"/>
            <reference refid="class.path" torefid="compile.classpath"/>
        </ant>
    </target>

    <target name="compile-jmx" depends="check-j2ee-present,compile-src, init">
        <ant antfile="ant/compile.xml" dir="." inheritall="false">
            <reference refid="j2ee.classpath" torefid="compile.classpath"/>
            <property name="include" value="com/sleepycat/je/jmx/**/*.java"/>
            <property name="exclude2" value=""/>
        </ant>
    </target>

    <target name="compile-jmxexamples" depends="compile-jmx">
        <ant antfile="ant/compile.xml" dir="." inheritall="false">
            <reference refid="j2ee.classpath" torefid="compile.classpath"/>
            <property name="srcdir" value="${example.srcdir}"/>
            <property name="include" value="jmx/**/*.java"/>
            <property name="exclude2" value=""/>
        </ant>
    </target>

    <target name="compile-jca" depends="check-j2ee-present,compile-src">
        <ant antfile="ant/compile.xml" dir="." inheritall="false">
            <reference refid="j2ee.classpath" torefid="compile.classpath"/>
            <property name="include" value="com/sleepycat/je/jca/**/*.java"/>
            <property name="exclude1" value=""/>
        </ant>
    </target>

    <target name="compile-jcaexamples" depends="compile-jca">
        <ant antfile="ant/compile.xml" dir="." inheritall="false">
            <reference refid="j2ee.classpath" torefid="compile.classpath"/>
            <property name="srcdir" value="${example.srcdir}"/>
            <property name="include" value="jca/**/*.java"/>
            <property name="exclude1" value=""/>
        </ant>
    </target>

    <!-- for jar packaging -->
    <target name="compile-dist" depends="init">
        <javac srcdir="${dist.srcdir}"
               destdir="${dist.destdir}" 
               source="1.5">
            <classpath refid="class.path"/>
        </javac>
    </target>


    <!-- ============================================================ -->
    <!-- Jars                                                         -->
    <!-- ============================================================ -->
    <target name="clean-jar">
        <delete dir="${libdir}"/>
    </target>

    <!-- JE jar -->
    <target name="jar" depends="compile, clean-package">
        <jar jarfile="${jarfile}">
	<fileset refid="jarclasses"/>
        <manifest>
            <attribute name="Main-Class"
                       value="com.sleepycat.je.utilint.JarMain"/>
            <attribute name="Premain-Class"
                       value="com.sleepycat.persist.model.ClassEnhancer"/>
        </manifest>
        </jar>
    </target>

    <!-- jca jar -->
    <target name="jcajar" depends="compile-jca">
        <jar jarfile="${libdir}/jejca.jar">
	<fileset dir="${destdir}"
	         includes="com/sleepycat/je/jca/ra/**"/>
       </jar>
    </target>

    <target name="clean-jca" depends="init">
         <delete>
              <fileset dir="${destdir}"
               includes="**/jca/**/*.class,package"/>
         </delete>
         <delete dir="${dist.destdir}/**/jca"/>
    </target>

    <target name="jca" depends="jcajar,jar">
       <jar destfile="${jcararfile}">
	  <metainf dir="${srcdir}/com/sleepycat/je/jca/ra" includes="ra.xml"/>
	  <fileset dir="${libdir}" includes="jejca.jar"/>
	  <fileset dir="${libdir}" includes="je.jar"/>
       </jar>
    </target>

    <!-- JCA examples jar -->
    <target name="jca-examples" depends="compile-jcaexamples,jca">

	<jar jarfile="${libdir}/jejca-example.jar">
	   <metainf dir="${example.srcdir}/jca/simple"
	            includes="ejb-jar.xml"/>
	   <metainf dir="${example.jca.srcdir}"
	             includes="${example.jca.descriptorname}"/>
	   <fileset dir="${destdir}"
	      includes="jca/simple/*"
	      excludes="jca/simple/ExClient.class"
	   />
	</jar>
    </target>

    <!-- jmx jar -->
    <target name="jmx" depends="compile-jmx,jar">
        <jar jarfile="${libdir}/jejmx.jar">
	<fileset dir="${destdir}"
	         includes="com/sleepycat/je/jmx/**"/>
        </jar>
    </target>

    <!-- jmx examples jar -->
    <target name="jmx-examples" depends="compile-jmxexamples,jmx">
        <jar jarfile="${libdir}/jejmx-example.jar">
	<fileset dir="${destdir}" includes="jmx/**"/>
        </jar>
    </target>

    <!-- create hidingdoclet jar. -->
    <target name="jar-hidingdoclet" depends="init, copy-doc-materials">
        <delete dir="${doclet.classes.dir}"/>
	<delete file="${doclet.jar}"/>

	<mkdir dir="${doclet.classes.dir}"/>
	<javac srcdir="${doclet.src.dir}" destdir="${doclet.classes.dir}" source="1.5">
            <include name="*.java"/>
        </javac>	    

	<jar jarfile="${doclet.jar}">
            <fileset dir="${doclet.classes.dir}" includes="*.class"/>
	</jar>
    </target>


    <!-- Eclipse "wrapper plug-in" jar -->
    <target name="je-version" depends="compile-src">
       <java fork="yes" 
             classname="com.sleepycat.je.util.DbDump"
             outputproperty="version.result"
             failonerror="true">
	  <arg value="-V"/>
          <classpath refid="class.path"/>
       </java>

    </target>

    <target name="eclipsejar" depends="je-version,compile,clean-package">
        <property name="eclipsejarfile"
                  value="${libdir}/${plugin.id}_${version.result}.jar"/>
        <jar jarfile="${eclipsejarfile}">
	<fileset refid="jarclasses"/>
        <manifest>
            <attribute name="Export-Package"
                       value="com.sleepycat.bind,com.sleepycat.bind.serial,com.sleepycat.bind.tuple,com.sleepycat.collections,com.sleepycat.je,com.sleepycat.je.util,com.sleepycat.persist,com.sleepycat.persist.evolve,com.sleepycat.persist.model,com.sleepycat.persist.raw,com.sleepycat.util"/>
            <attribute name="Bundle-Vendor"
                       value="Oracle"/>
            <attribute name="Bundle-Version"
                       value="${version.result}"/>
            <attribute name="Eclipse-BuddyPolicy"
                       value="registered"/>
            <attribute name="Bundle-Name"
                       value="Berkeley DB Java Edition"/>
            <attribute name="Bundle-ManifestVersion"
                       value="2"/>
            <attribute name="Bundle-SymbolicName"
                       value="${plugin.id}"/>
        </manifest>
        </jar>
    </target>

    <!-- ============================================================ -->
    <!-- Package .jar and other files into a .zip                     -->
    <!-- ============================================================ -->
    <target name="clean-package">
        <delete file="${zipfile}"/>
        <delete file="${buildzipfile}"/>
        <delete file="${srczipfile}"/>
        <mkdir dir="${libdir}"/>
    </target>

    <target name="package" depends="jar, javadoc">
        <description>
            The package target builds the distribution package.
        </description>

	<!-- copy the README in, adding the current release number and date-->
        <copy overwrite="true" file="${dist.srcdir}/README" todir="${basedir}">
	   <filterset>
	       <filter token="RELEASE_VERSION" value="${release.version}"/>
	       <filter token="DATE" value="${release.date}"/>
	   </filterset>	
        </copy>	   

        <copy overwrite="true" file="${dist.srcdir}/example.properties"
            todir="${basedir}"/>

        <zip basedir="${builddir}"
             destfile="build.zip"
             includes="bin/**,lib/**,dist/build.properties"/>
        <zip basedir="${basedir}"
             destfile="src.zip"
             excludes="test/rpcserver/**,test/experiments/**,test/examples/**,test/regress/*/**,test/**/MiniStress.java,test/**/AbortStress.java,dist/,**/jca/README.txt,examples/com/**,src/com/sleepycat/je/rep/**,examples/je/rep/**,test/com/sleepycat/je/rep/**,test/standalone/scalability/**"
             includes="src/**,examples/**,test/**,docs/**,ant/**,regress/,build.xml,build.properties,example.properties,README,LICENSE,FindBugsExclude.xml"/>
        <zip basedir="${basedir}"
             destfile="${zipfile}"
             excludes="**/">
             <zipfileset src="build.zip"
                         prefix="je/"/>
             <zipfileset src="src.zip"
                         prefix="je/"/>
        </zip>
    </target>


    <!-- ============================================================ -->
    <!-- Testing                                                      -->
    <!-- ============================================================ -->

    <!-- ============================================================ -->
    <!-- JUnit unit tests                                             -->
    <!-- ============================================================ -->

    <target name="init-unittest" depends="init">
        <delete dir="${unittest.datadir}"/>
        <delete dir="${unittest.reportsdir}"/>
        <mkdir dir="${unittest.datadir}"/>
        <mkdir dir="${unittest.reportsdir}"/>
    </target>

    <target name="clean-unittest" depends="init-unittest">
        <delete dir="${unittest.destdir}"/>
        <mkdir dir="${unittest.destdir}"/>
        <delete dir="${unittest.testserialdir}"/>
        <mkdir dir="${unittest.testserialdir}"/>
        <delete dir="${unittest.testevolvedir}"/>
        <mkdir dir="${unittest.testevolvedir}"/>
    </target>

    <target name="compile-unittest" depends="compile-src">
      <ant antfile="ant/compile.xml" dir="." inheritall="false">
        <property name="srcdir" value="${unittest.srcdir}"/>
        <property name="destdir" value="${unittest.destdir}"/>
        <reference refid="unittest.classpath" torefid="compile.classpath"/>
      </ant>

      <copy todir="${unittest.destdir}">
        <fileset dir="${unittest.srcdir}" 
	         excludes="**/*.java,experiments/**,examples/**"/>
      </copy>

      <!-- for testing je.properties -->
      <copy file="${unittest.destdir}/com/sleepycat/je/je.properties"
            todir="${unittest.extraenvdir}"/>
      <!-- for testing rep.properties -->
      <copy file="${unittest.destdir}/com/sleepycat/je/rep.properties"
            tofile="${unittest.extraenvdir2}/je.properties"/>

      <!-- Compile original version of TestSerial class separately. -->
      <property name="testserialpath"
                value="com/sleepycat/collections/test/serial/TestSerial"/>
      <copy file="${unittest.srcdir}/${testserialpath}.java.original"
            tofile="${unittest.testserialdir}/${testserialpath}.java"/>
      <ant antfile="ant/compile.xml" dir="." inheritall="false">
          <property name="srcdir" value="${unittest.testserialdir}"/>
          <property name="destdir" value="${unittest.testserialdir}"/>
          <reference refid="class.path" torefid="compile.classpath"/>
      </ant>

      <!-- Compile original version of EvolveClasses separately. -->
      <property name="testevolvepath"
                value="com/sleepycat/persist/test/EvolveClasses"/>
      <copy file="${unittest.srcdir}/${testevolvepath}.java.original"
            tofile="${unittest.testevolvedir}/${testevolvepath}.java"/>
      <copy file=
             "${unittest.srcdir}/com/sleepycat/persist/test/EvolveCase.java"
            tofile=
             "${unittest.testevolvedir}/com/sleepycat/persist/test/EvolveCase.java"/>
      <copy file=
             "${unittest.srcdir}/com/sleepycat/persist/test/PersistTestUtils.java"
            tofile=
             "${unittest.testevolvedir}/com/sleepycat/persist/test/PersistTestUtils.java"/>
      <ant antfile="ant/compile.xml" dir="." inheritall="false">
          <property name="srcdir" value="${unittest.testevolvedir}"/>
          <property name="destdir" value="${unittest.testevolvedir}"/>
          <reference refid="class.path" torefid="compile.classpath"/>
      </ant>
    </target>

    <target name="compile-unittest-j2ee"
            depends="compile, compile-j2ee, compile-jmxexamples">
        <ant antfile="ant/compile.xml" dir="." inheritall="false">
            <property name="srcdir" value="${unittest.srcdir}"/>
            <property name="destdir" value="${unittest.destdir}"/>
            <property name="include" value="com/sleepycat/je/jmx/**/*.java"/>
            <property name="exclude2" value=""/>
            <reference refid="unittest-j2ee.classpath"
	               torefid="compile.classpath"/>
        </ant>
    </target>


    <!-- Do one of the following:

         ant test -Dtestcase=com.sleepycat.je.db.DbTest   (run one test)
         ant test -Dsuite=db                           (run one package)
         ant test                       (run all tests except rep tests)
         ant test -Dtestcase=com.sleepycat.je.db.DbTest -Dtestjar=je.jar
                                      (run one test with a specific jar)
         ant test -Dsuite=db -Dtestjar=je.jar 
                                   (run one package with a specific jar)
         ant test -Dtestjar=je.jar   (run all tests with a specific jar) 
         ant reptest              (run all com.sleepycat.je.rep.* tests)
     -->

    <target name="test-j2ee"
            depends="compile-unittest-j2ee,test"/>

    <target name="reptest">
	 <antcall target="test">
             <param name="param-rep" value="true"/>
	 </antcall>
    </target>

    <path id="testserial-classpath">
      <pathelement location="${unittest.testserialdir}"/>
    </path>

    <path id="testevolve-classpath">
      <pathelement location="${unittest.testevolvedir}"/>
    </path>

    <target name="test"
            depends="compile-unittest, init-unittest, jar">

      <!-- Determine which tests to run. -->
      <condition property="alltests">
        <not>
          <or>
            <isset property="suite"/>
            <isset property="testcase"/>
            <isset property="param-rep"/>
          </or>
        </not>
      </condition>
      <condition property="testserial">
        <or>
          <isset property="alltests"/>
          <contains string="${suite}" substring="serial"/>
          <equals arg1="${testcase}" arg2=
           "com.sleepycat.collections.test.serial.StoredClassCatalogTest"/>
        </or>
      </condition>
      <condition property="testevolve">
        <or>
          <isset property="alltests"/>
          <contains string="${suite}" substring="persist"/>
          <equals arg1="${testcase}"
                  arg2="com.sleepycat.persist.test.EvolveTest"/>
        </or>
      </condition>
      <condition property="testpersist">
        <or>
          <isset property="alltests"/>
          <contains string="${suite}" substring="persist"/>
        </or>
      </condition>

      <!-- Performs initialization needed before StoredClassCatalogTest. -->
      <antcall target="do-junit">
        <param name="param-msg" value="Run testserial initialization"/>
        <param name="param-if" value="testserial"/>
        <param name="param-jvmarg" value=""/>
        <param name="param-classpath" value="testserial-classpath"/>
        <param name="param-testcase" value=
         "com.sleepycat.collections.test.serial.StoredClassCatalogTestInit"/>
      </antcall>

      <!-- Performs initialization needed before persist evolve tests. -->
      <antcall target="do-junit">
        <param name="param-msg" value="Run testevolve initialization"/>
        <param name="param-if" value="testevolve"/>
        <param name="param-jvmarg" value=""/>
        <param name="param-classpath" value="testevolve-classpath"/>
        <param name="param-testcase"
               value="com.sleepycat.persist.test.EvolveTestInit"/>
      </antcall>

      <!-- Run all unit tests except for replication.  -->
      <antcall target="do-junit">
        <param name="param-msg" value="Run all unit tests"/>
        <param name="param-if" value="alltests"/>
        <param name="param-jvmarg" value=""/>
        <param name="param-classpath" value="empty.classpath"/>
        <param name="param-includes" value="**/*Test.class"/>
	<param name="param-excludes" value="**/rep/**/*Test.class"/>
      </antcall>

      <!-- Run a test suite.  -->
      <antcall target="do-junit">
        <param name="param-msg" value="Run a test suite: ${suite}"/>
        <param name="param-if" value="suite"/>
        <param name="param-jvmarg" value=""/>
        <param name="param-classpath" value="empty.classpath"/>
        <param name="param-includes" value="**/${suite}/*Test.class"/>
      </antcall>

      <!-- Run a single test case.  -->
      <antcall target="do-junit">
        <param name="param-msg" value="Run a test case: ${testcase}"/>
        <param name="param-if" value="testcase"/>
        <param name="param-jvmarg" value=""/>
        <param name="param-classpath" value="empty.classpath"/>
        <param name="param-testcase" value="${testcase}"/>
      </antcall>

      <!-- Run the persist test variants. -->
      <antcall target="test-persist-enhance-javaagent"/>
      <antcall target="test-persist-enhance-task"/>
      <antcall target="test-persist-enhance-main"/>

      <!-- Run the replication tests. -->
      <antcall target="do-junit">
        <param name="param-msg" value="Run replication tests only"/>
        <param name="param-if" value="param-rep"/>
        <param name="param-jvmarg" value=""/>
        <param name="param-classpath" value="empty.classpath"/>
        <param name="param-includes" value="**/rep/**/*Test.class"/>
      </antcall>

      <!-- Generate test reports -->

      <junitreport todir="${unittest.datadir}">
        <fileset dir="${unittest.datadir}">
          <include name="TEST-*.xml"/>
        </fileset>
        <report format="frames"
          todir="${unittest.reportsdir}"/>
      </junitreport>
    </target>

    <!-- Run the persist tests with -javaagent to enhance classes. -->
    <target name="test-persist-enhance-javaagent" if="testpersist">
      <antcall target="do-junit">
        <param name="param-msg" value="Run persist tests with -javaagent"/>
        <param name="param-if" value="testpersist"/>
        <param name="param-sysprop-key" value="expectEnhanced"/>
        <param name="param-sysprop-value" value="true"/>
        <param name="param-jvmarg"
               value="-javaagent:${jarfile}=enhance:-v,com.sleepycat.persist"/>
        <param name="param-classpath" value="empty.classpath"/>
        <param name="param-includes"
               value="com/sleepycat/persist/**/*Test.class"/>
      </antcall>
    </target>

    <!-- Enhance persist test classes and run the persist tests again,
         setting the expectEnhanced system property to cause the test to
         fail if classes are not enhanced.  -->
    <property name="enhance-task.tmpdir" value="${builddir}/enhance.task"/>
    <path id="enhanced-task.classpath">
      <pathelement location="${enhance-task.tmpdir}"/>
    </path>
    <target name="test-persist-enhance-task" if="testpersist">
      <delete dir="${enhance-task.tmpdir}"/>
      <mkdir dir="${enhance-task.tmpdir}"/>
      <copy todir="${enhance-task.tmpdir}">
        <fileset dir="${unittest.destdir}"
                 includes="com/sleepycat/persist/**/*.class"/>
      </copy>
      <enhancer verbose="on">
        <fileset dir="${enhance-task.tmpdir}"/>
      </enhancer>
      <antcall target="do-junit">
        <param name="param-msg"
               value="Run persist tests with ClassEnhancer ant task"/>
        <param name="param-if" value="testpersist"/>
        <param name="param-sysprop-key" value="expectEnhanced"/>
        <param name="param-sysprop-value" value="true"/>
        <param name="param-jvmarg" value=""/>
        <param name="param-classpath" value="enhanced-task.classpath"/>
        <param name="param-includes"
               value="com/sleepycat/persist/**/*Test.class"/>
      </antcall>
    </target>

    <!-- Same as above but use the ClassEnhancer main program. -->
    <property name="enhance-main.tmpdir" value="${builddir}/enhance.main"/>
    <path id="enhanced-main.classpath">
      <pathelement location="${enhance-main.tmpdir}"/>
    </path>
    <path id="enhanced-main.classpath">
      <pathelement location="${enhance-main.tmpdir}"/>
      <path refid="class.path"/>
      <path refid="clover.classpath"/>
    </path> 
    <target name="test-persist-enhance-main" if="testpersist">
      <delete dir="${enhance-main.tmpdir}"/>
      <mkdir dir="${enhance-main.tmpdir}"/>
      <copy todir="${enhance-main.tmpdir}">
        <fileset dir="${unittest.destdir}"
                 includes="com/sleepycat/persist/**/*.class"/>
      </copy>
      <java fork="yes" jvm="${jvm}"
            classname="com.sleepycat.persist.model.ClassEnhancer">
        <jvmarg line="${jvmargs}"/>
        <arg line="-v ${enhance-main.tmpdir}"/>
        <classpath refid="enhanced-main.classpath"/>
      </java>
      <antcall target="do-junit">
        <param name="param-msg"
               value="Run persist tests with ClassEnhancer main program"/>
        <param name="param-if" value="testpersist"/>
        <param name="param-sysprop-key" value="expectEnhanced"/>
        <param name="param-sysprop-value" value="true"/>
        <param name="param-jvmarg" value=""/>
        <param name="param-classpath" value="enhanced-main.classpath"/>
        <param name="param-includes"
               value="com/sleepycat/persist/**/*Test.class"/>
      </antcall>
    </target>

    <!-- Called via antcall above to run the junit task.
     Specify one of these params:
      param-includes: path of class files to run a batchtest
      param-testcase: class name that to run a single test
     Required params:
      param-msg: message printed to identify this test run
      param-if: variable name that must be set to run tests
      param-jvmarg: value of additional jvmarg, may be empty
      param-classpath: refid of classpath to insert, may be empty.classpath
     Optional params:
      param-sysprop-key: key of additional sysproperty
      param-sysprop-value: value of additional sysproperty
      -->
    <target name="do-junit" if="${param-if}">
      <echo message="${param-msg}"/>
      <junit printsummary="false"
             errorProperty="unittest.failed"
             failureProperty="unittest.failed"
	     haltOnFailure="false"
             showoutput="true"
             fork="yes">
        <jvmarg value="-ea"/>
	<!--
        <jvmarg value="-d64"/>
	-->
        <jvmarg value="-Xmx256M"/>
        <jvmarg line="${param-jvmarg}"/>
        <classpath refid="${param-classpath}"/>
        <classpath refid="unittest.classpath"/>
        <classpath refid="clover.classpath"/>
        <sysproperty key="testdestdir" value="${unittest.destdir}"/>
        <sysproperty key="testevolvedir" value="${unittest.testevolvedir}"/>
        <sysproperty key="txnnosync" value="true"/>
	<sysproperty key="isolationLevel" value="${isolationLevel}"/>
	<sysproperty key="setErrorListener" value="true"/>
        <sysproperty key="longtest" value="${longtest}"/>
        <sysproperty key="${param-sysprop-key}"
                     value="${param-sysprop-value}"/>
        <sysproperty key="java.util.logging.config.file"
            value="${logging.config.file}"/>
        <formatter type="plain" usefile="false"/>
        <formatter type="xml"/>
        <test todir="${unittest.datadir}"
              if="param-testcase"
              name="${param-testcase}"/>
        <batchtest todir="${unittest.datadir}"
                   if="param-includes">
          <fileset dir="${unittest.destdir}" 
	           includes="${param-includes}"
                   excludes="${param-excludes}"/>
        </batchtest>
      </junit>
      <fail message="UnitTests failed.Check log and/or reports.">
        <condition>
          <and>
            <istrue value="${unittest.failed}"/>
	    <isfalse value="${clover.ignorefailure}"/>
	  </and>
	</condition>
      </fail>
    </target>

    <!-- Runs XxxTestMain test programs and other misc non-JUnit test. -->
    <target name="misctest" depends="compile-unittest, init-unittest">

      <antcall target="do-testmain">
        <param name="cls" value="je.test.SecondarySplitTestMain"/>
      </antcall>

      <!-- Special case JUnit test that only failed when run separately. -->
      <junit printsummary="false"
             showoutput="on"
	     haltOnFailure="true"
             fork="yes">
        <jvmarg value="-ea"/>
        <jvmarg value="-Xmx256M"/>
        <classpath refid="unittest-j2ee.classpath"/>
        <classpath refid="clover.classpath"/>
        <sysproperty key="testdestdir" value="${unittest.destdir}"/>
        <test name="com.sleepycat.je.dbi.SR12641"/>
      </junit>

    </target>

    <target name="do-testmain">
      <echo message="Running: ${cls}"/>
      <java fork="yes" failonerror="true" jvm="${jvm}"
            classname="com.sleepycat.${cls}">
        <jvmarg value="-Xmx256M"/>
        <jvmarg line="${jvmargs}"/>
        <sysproperty key="testdestdir" value="${unittest.destdir}"/>
        <classpath refid="unittest-j2ee.classpath"/>
        <classpath refid="clover.classpath"/>
      </java>
    </target>

    <!-- logversiondata is run at the end of each major release.  After running
         add the je-x.y.z.* files that were generated to CVS.  Be sure to use
         -kb to add the .jdb file.  Then add a test_x_y_z() method to
         com/sleepycat/je/logversion/LogEntryVersionTest.java.
    -->
    <target name="logversiondata" depends="compile-unittest">
      <java fork="yes" jvm="${jvm}"
            classname="com.sleepycat.je.logversion.MakeLogEntryVersionData">
        <jvmarg line="${jvmargs}"/>
        <arg line="${unittest.destdir}"/>
        <classpath refid="unittest.classpath"/>
      </java>
      <copy todir="test/com/sleepycat/je/logversion">
        <fileset dir="${unittest.destdir}">
          <include name="je-*.jdb"/>
          <include name="je-*.txt"/>
        </fileset>
      </copy>
    </target>

    <!-- ============================================================ -->
    <!-- Test CLI utils -->
    <!-- ============================================================ -->

    <target name="testcli"
        depends="testcli-dbdump"/>

    <target name="testcli-dbdump" depends="compile-src,compile-examples">
      <delete dir="${builddir}/tmp"/>
      <mkdir dir="${builddir}/tmp"/>
      <java fork="yes" dir="${builddir}" jvm="${jvm}"
            classname="je.SimpleExample">
        <jvmarg line="${jvmargs}"/>
        <arg line="tmp insert 5"/>
        <classpath refid="class.path"/>
      </java>
      <java fork="yes" dir="${builddir}" jvm="${jvm}"
            classname="com.sleepycat.je.util.DbDump">
        <jvmarg line="${jvmargs}"/>
        <arg line="-f ./dump.out -h tmp -s simpleDb"/>
        <classpath refid="class.path"/>
      </java>
      <delete dir="${builddir}/tmp"/>
      <mkdir dir="${builddir}/tmp"/>
      <java fork="yes" dir="${builddir}" jvm="${jvm}"
            classname="com.sleepycat.je.util.DbLoad">
        <jvmarg line="${jvmargs}"/>
        <arg line="-f ./dump.out -h tmp -s simpleDb"/>
        <classpath refid="class.path"/>
      </java>
      <java fork="yes" dir="${builddir}" jvm="${jvm}"
            classname="com.sleepycat.je.util.DbDump">
        <jvmarg line="${jvmargs}"/>
        <arg line="-h tmp -r"/>
        <classpath refid="class.path"/>
      </java>
    </target>

    <!-- ========= Standalone test targets delegated to internal.xml ==========

    Standalone tests are run by passing the testcase property as the name of
    the target in internal.xml.  Other parameters for each target are passed
    using the args property, for example:

      ant -Dtestcase=MemoryStress -Dargs=-dups standalone

    See the individual standalone targets in ant/internal.xml for details.
    ======================================================================= -->
    <target name="standalone" depends="jar">
	<antcall target="do-internal">
	   <param name="target" value="standalone"/>
        </antcall>
    </target>

    <!-- ============================================================ -->
    <!-- Internal Use Only: Test examples -->
    <!-- ============================================================ -->

    <!-- testex runs all examples, but does not include testex-access because
         it is interactive.  Does not test JCA examples.
    -->
    <target name="testex"
        depends="testex-simple, testex-binding, testex-secondary,
        testex-sequence, testex-tomany, testex-measureinsertsize,
        testex-persist-person, testex-persist-dpldump,
        testex-persist-customkeyorder, testex-persist-eventexample,
        testex-persist-eventexampledpl, testex-persist-sqlapp,
        testex-hello, testex-ship-basic, testex-ship-index, testex-ship-entity,
        testex-ship-tuple, testex-ship-sentity, testex-ship-marshal,
        testex-ship-factory"/>

    <target name="testex-simple" depends="compile-examples">
      <delete dir="${builddir}/tmp"/>
      <mkdir dir="${builddir}/tmp"/>
      <java fork="yes" dir="${builddir}" jvm="${jvm}"
            classname="je.SimpleExample">
        <jvmarg line="${jvmargs}"/>
        <arg line="tmp insert 5"/>
        <classpath refid="class.path"/>
      </java>
      <java fork="yes" dir="${builddir}" jvm="${jvm}"
            classname="je.SimpleExample">
        <jvmarg line="${jvmargs}"/>
        <arg line="tmp retrieve 5"/>
        <classpath refid="class.path"/>
      </java>
    </target>

    <target name="testex-binding" depends="compile-examples">
      <delete dir="${builddir}/tmp"/>
      <mkdir dir="${builddir}/tmp"/>
      <java fork="yes" dir="${builddir}" jvm="${jvm}"
            classname="je.BindingExample">
        <jvmarg line="${jvmargs}"/>
        <arg line="tmp insert 5"/>
	<classpath refid="class.path"/>
      </java>
      <java fork="yes" dir="${builddir}" jvm="${jvm}"
            classname="je.BindingExample">
        <jvmarg line="${jvmargs}"/>
        <arg line="tmp retrieve 5"/>
        <classpath refid="class.path"/>
      </java>
    </target>

    <target name="testex-secondary" depends="compile-examples">
      <delete dir="${builddir}/tmp"/>
      <mkdir dir="${builddir}/tmp"/>
      <java fork="yes" dir="${builddir}" jvm="${jvm}"
            classname="je.SecondaryExample">
        <jvmarg line="${jvmargs}"/>
        <arg line="tmp insert 5"/>
        <classpath refid="class.path"/>
      </java>
      <java fork="yes" dir="${builddir}" jvm="${jvm}"
            classname="je.SecondaryExample">
        <jvmarg line="${jvmargs}"/>
        <arg line="tmp retrieve 5"/>
        <classpath refid="class.path"/>
      </java>
    </target>

    <target name="testex-sequence" depends="compile-examples">
      <delete dir="${builddir}/tmp"/>
      <mkdir dir="${builddir}/tmp"/>
      <java fork="yes" dir="${builddir}" jvm="${jvm}"
            classname="je.SequenceExample">
        <jvmarg line="${jvmargs}"/>
        <arg line="tmp"/>
        <classpath refid="class.path"/>
      </java>
      <java fork="yes" dir="${builddir}" jvm="${jvm}"
            classname="je.SequenceExample">
        <jvmarg line="${jvmargs}"/>
        <arg line="tmp"/>
        <classpath refid="class.path"/>
      </java>
    </target>

    <target name="testex-tomany" depends="compile-examples">
      <delete dir="${builddir}/tmp"/>
      <mkdir dir="${builddir}/tmp"/>
      <java fork="yes" dir="${builddir}" jvm="${jvm}"
            classname="je.ToManyExample">
        <jvmarg line="${jvmargs}"/>
        <arg line="-h tmp"/>
        <classpath refid="class.path"/>
      </java>
    </target>

    <target name="testex-measureinsertsize" depends="compile-examples">
      <delete dir="${builddir}/tmp"/>
      <mkdir dir="${builddir}/tmp"/>
      <java fork="yes" dir="${builddir}" jvm="${jvm}"
            classname="je.MeasureInsertSize">
        <jvmarg line="${jvmargs}"/>
        <arg line="-h tmp -records 100 -key 10 -data 100"/>
        <classpath refid="class.path"/>
      </java>
      <echo>MeasureInsertSize ran OK</echo>
    </target>

    <!-- Using fork="yes" does not work for AccessExample, apparently because
         it is interactive and the input stream of the forked process isn't
         functional; therefore this sample writes to the base directory.
    -->
    <target name="testex-access" depends="compile-examples">
      <java fork="yes" jvm="${jvm}"
            classname="collections.access.AccessExample">
        <jvmarg line="${jvmargs}"/>
        <classpath refid="class.path"/>
      </java>
    </target>

    <target name="testex-persist-person" depends="compile-examples">
      <delete dir="${builddir}/tmp"/>
      <mkdir dir="${builddir}/tmp"/>
      <java fork="yes" dir="${builddir}" jvm="${jvm}"
            classname="persist.PersonExample">
        <jvmarg value="-ea"/>
        <jvmarg line="${jvmargs}"/>
        <arg line="-h tmp"/>
        <classpath refid="class.path"/>
      </java>
    </target>

    <!--
    Before running this example, first run another DPL example that writes to
    the tmp directory, such as testex-persist-person.
    -->
    <target name="testex-persist-dpldump" depends="compile-examples">
      <java fork="yes" dir="${builddir}" jvm="${jvm}"
            classname="persist.DplDump">
        <jvmarg line="${jvmargs}"/>
        <arg line="-h tmp"/>
        <classpath refid="class.path"/>
      </java>
    </target>

    <target name="testex-persist-customkeyorder" depends="compile-examples">
      <delete dir="${builddir}/tmp"/>
      <mkdir dir="${builddir}/tmp"/>
      <java fork="yes" dir="${builddir}" jvm="${jvm}"
            classname="persist.CustomKeyOrderExample">
        <jvmarg line="${jvmargs}"/>
        <arg line="-h tmp"/>
        <classpath refid="class.path"/>
      </java>
    </target>

    <target name="testex-persist-eventexample" depends="compile-examples">
      <delete dir="${builddir}/tmp"/>
      <mkdir dir="${builddir}/tmp"/>
      <java fork="yes" dir="${builddir}" jvm="${jvm}"
            classname="persist.EventExample">
        <jvmarg line="${jvmargs}"/>
        <arg line="-h tmp"/>
        <classpath refid="class.path"/>
      </java>
    </target>

    <target name="testex-persist-eventexampledpl" depends="compile-examples">
      <delete dir="${builddir}/tmp"/>
      <mkdir dir="${builddir}/tmp"/>
      <java fork="yes" dir="${builddir}" jvm="${jvm}"
            classname="persist.EventExampleDPL">
        <jvmarg line="${jvmargs}"/>
        <arg line="-h tmp"/>
        <classpath refid="class.path"/>
      </java>
    </target>

    <target name="testex-persist-sqlapp" depends="compile-examples">
      <delete dir="${builddir}/tmp"/>
      <mkdir dir="${builddir}/tmp"/>
      <java fork="yes" dir="${builddir}" jvm="${jvm}"
            classname="persist.sqlapp.SQLApp">
        <jvmarg line="${jvmargs}"/>
        <arg line="-h tmp"/>
        <classpath refid="class.path"/>
      </java>
    </target>

    <target name="testex-hello" depends="compile-examples">
      <delete dir="${builddir}/tmp"/>
      <mkdir dir="${builddir}/tmp"/>
      <java fork="yes" dir="${builddir}" jvm="${jvm}"
            classname="collections.hello.HelloDatabaseWorld">
        <jvmarg line="${jvmargs}"/>
        <classpath refid="class.path"/>
      </java>
    </target>

    <target name="testex-ship-basic" depends="compile-examples">
      <delete dir="${builddir}/tmp"/>
      <mkdir dir="${builddir}/tmp"/>
      <java fork="yes" dir="${builddir}" jvm="${jvm}"
            classname="collections.ship.basic.Sample">
        <jvmarg line="${jvmargs}"/>
        <classpath refid="class.path"/>
      </java>
    </target>

    <target name="testex-ship-index" depends="compile-examples">
      <delete dir="${builddir}/tmp"/>
      <mkdir dir="${builddir}/tmp"/>
      <java fork="yes" dir="${builddir}" jvm="${jvm}"
            classname="collections.ship.index.Sample">
        <jvmarg line="${jvmargs}"/>
        <classpath refid="class.path"/>
      </java>
    </target>

    <target name="testex-ship-entity" depends="compile-examples">
      <delete dir="${builddir}/tmp"/>
      <mkdir dir="${builddir}/tmp"/>
      <java fork="yes" dir="${builddir}" jvm="${jvm}"
            classname="collections.ship.entity.Sample">
        <classpath refid="class.path"/>
      </java>
    </target>

    <target name="testex-ship-tuple" depends="compile-examples">
      <delete dir="${builddir}/tmp"/>
      <mkdir dir="${builddir}/tmp"/>
      <java fork="yes" dir="${builddir}" jvm="${jvm}"
            classname="collections.ship.tuple.Sample">
        <jvmarg line="${jvmargs}"/>
        <classpath refid="class.path"/>
      </java>
    </target>

    <target name="testex-ship-sentity" depends="compile-examples">
      <delete dir="${builddir}/tmp"/>
      <mkdir dir="${builddir}/tmp"/>
      <java fork="yes" dir="${builddir}" jvm="${jvm}"
            classname="collections.ship.sentity.Sample">
        <jvmarg line="${jvmargs}"/>
        <classpath refid="class.path"/>
      </java>
    </target>

    <target name="testex-ship-marshal" depends="compile-examples">
      <delete dir="${builddir}/tmp"/>
      <mkdir dir="${builddir}/tmp"/>
      <java fork="yes" dir="${builddir}" jvm="${jvm}"
            classname="collections.ship.marshal.Sample">
        <jvmarg line="${jvmargs}"/>
        <classpath refid="class.path"/>
      </java>
    </target>

    <target name="testex-ship-factory" depends="compile-examples">
      <delete dir="${builddir}/tmp"/>
      <mkdir dir="${builddir}/tmp"/>
      <java fork="yes" dir="${builddir}" jvm="${jvm}"
            classname="collections.ship.factory.Sample">
        <jvmarg line="${jvmargs}"/>
        <classpath refid="class.path"/>
      </java>
    </target>
        
    <!-- testex-jejca runs all JCA examples.
    -->
    <target name="testex-jejca"
        depends="testex-jejcasimple"/>

    <target name="testex-jejcasimple" depends="compile-jcaexamples">
      <java fork="yes" dir="${builddir}" jvm="${jvm}"
            classname="jca.simple.SimpleClient">
        <jvmarg line="${jvmargs}"/>
        <classpath refid="jca.classpath"/>
	<arg value="${key}"/>
	<arg value="${data}"/>
      </java>
    </target>

    <!-- ============================================================ -->
    <!-- Internal Use Only: Javadocs for Entire Source Tree           -->
    <!-- ============================================================ -->
    <target name="javadoc-all" depends="init">
        <mkdir dir="${doc.dir}"/>
        <javadoc packagenames="${packages}"
                maxmemory="128M"
                sourcepath="${srcdir}"
                destdir="${doc.dir}"
                classpathref="class.path"
                version="true"
                nodeprecated="false"
		windowtitle="${name} Classes"
                doctitle="${name}"
                package="true"
                source="1.5"
                bottom="Copyright (c) 2004,2008 Oracle.  All rights reserved.">

          <link href="http://java.sun.com/j2se/1.5/docs/api"/>
        </javadoc>
    </target>

    <!-- ============================================================ -->
    <!-- Javadocs for the public api for distribution                 -->
    <!-- This is a complex process that incorporates M4 processing of -->
    <!-- documentation template files.                                -->
    <!-- ============================================================ -->

    <!-- Make sure we update the version in the build properties file -->
    <path id="dist.classpath">
        <path refid="class.path"/>
	<pathelement location="${dist.destdir}"/>
    </path>

    <target name="update-version" depends="compile-src, compile-dist">
       <!-- Create an up to date property file for the build -->
       <java fork="yes" jvm="${jvm}"
             classname="CreateRELEASEFile"
	     classpathref="dist.classpath">
          <jvmarg line="${jvmargs}"/>
	  <arg value="${build.propertyfile}"/>
       </java>

       <!-- read it in -->
       <property file="${build.propertyfile}"/>
    </target>

    <target name="clean-javadoc" depends="init">
        <delete dir="${doc.dir}"/>
    </target>

    <!-- create javadoc -->
    <target name="javadoc" depends="init, update-version, clean-javadoc">

        <!-- create fresh directories --> 
        <mkdir dir="${doc.dir}"/>
        <mkdir dir="${doc.javadir}"/>

        <!-- set the time -->
        <tstamp>
	   <format property="release.date" pattern="MMMMMMMM dd, yyyy"/>
	</tstamp>

	<!-- Copy the main page, images and release notes, to the
             docs directory, putting in the release version where
	     appropriate -->
        <copy overwrite="true" todir="${doc.dir}">
	   <filterset>
	       <filter token="RELEASE_VERSION" value="${release.version}"/>
	       <filter token="RELEASE_NUMERIC_VERSION"
	               value="${release.numeric.versionc.version}"/>
	       <filter token="DATE" value="${release.date}"/>
	   </filterset>
	   <fileset dir="${docsrc.dir}">
               <include name="*.html"/>
               <include name="*.css"/>
           </fileset>
        </copy>
        <copy todir="${doc.dir}/images">
	    <fileset dir="${docsrc.dir}/images"/>
	</copy>
        <copy todir="${doc.dir}/sleepycat">
	    <fileset dir="${docsrc.dir}/sleepycat"/>
	</copy>

	<!-- Copy everything for the Getting Started Guide and the
             Writing Transactional Applications Guide to the docs 
             directory -->
        <copy todir="${doc.dir}/GettingStartedGuide">
	    <fileset dir="${docsrc.dir}/GettingStartedGuide">
	    </fileset>
	</copy>

        <copy todir="${doc.dir}/TransactionGettingStarted">
	    <fileset dir="${docsrc.dir}/TransactionGettingStarted">
	    </fileset>
	</copy>

	<!-- Copy everything for the collections tutorial to the docs 
             directory -->
        <copy todir="${doc.dir}/collections">
	    <fileset dir="${docsrc.dir}/collections">
	    </fileset>
        </copy>
	
	<antcall target="javadoc-src"/>
    </target>

    <available file="${docsrc.dir}" type="dir" property="UserOrMember"/>

    <target name="copy-doc-materials" if="UserOrMember">
        <copy overwrite="true" todir="${doclet.src.dir}">
            <fileset dir="${docsrc.dir}/doclet"/>
	</copy>

	<copy overwrite="true" todir="${doc.dir}" file="${docsrc.dir}/style.css"/>
    </target>

    <target name="javadoc-src" depends="init, copy-doc-materials">
	<antcall target="jar-hidingdoclet"/>
	
	<delete dir="${doc.dir}/java"/>
	<mkdir dir="${doc.dir}/java"/>

        <!-- Run javadoc on public API -->
	<echo>Javadoc public api</echo>
        <javadoc  sourcepath="${srcdir}"
                destdir="${doc.javadir}"
		version="true"
                nodeprecated="false"
		protected="true"
                source="1.5"
		use="true"
		docletpath="docs/HidingDoclet.jar"
		stylesheetfile="${doc.dir}/style.css"
		windowtitle="Oracle - Berkeley DB Java Edition API">
	  <classpath refid="j2ee.classpath"/>
	  <classpath path="${ant.library.dir}/ant.jar"/>
	  <arg value="-author"/>
	  <doclet name="HidingDoclet"/>
          <group title="Berkeley DB Java Edition Packages">
              <package name="com.sleepycat.je*"/>
              <package name="com.sleepycat.je.util"/>
              <package name="com.sleepycat.je.jmx"/>
              <package name="com.sleepycat.je.jca.ra"/>
	  </group>
          <group title="Berkeley DB Direct Persistence Layer (DPL) Packages">
              <package name="com.sleepycat.persist"/>
              <package name="com.sleepycat.persist.model"/>
              <package name="com.sleepycat.persist.evolve"/>
              <package name="com.sleepycat.persist.raw"/>
	  </group>
          <group title="Berkeley DB Bind and Collections Packages">
              <package name="com.sleepycat.bind*"/>
              <package name="com.sleepycat.collections*"/>
              <package name="com.sleepycat.util*"/>
	  </group>
	  <header><![CDATA[<b>Berkeley DB Java Edition</b><br><font size=\"-1\"> version ${release.version}</font>]]>
	  </header>
	  <bottom><![CDATA[<font size=1>Copyright (c) 2004,2008 Oracle.  All rights reserved.</font>]]> </bottom> 
          <package name="com.sleepycat.je"/>
          <package name="com.sleepycat.je.jmx"/>
         <!-- We'd like to include the com.sleepycat.je.jca.ra package
              and use the @hidden tag, but the doclet seems to have some
              problems there. -->
          <fileset dir="${srcdir}">
	        <include name="com/sleepycat/je/jca/ra/JEConnection.java"/>
	        <include name="com/sleepycat/je/jca/ra/JEConnectionFactory.java"/>	        
	        <include name="com/sleepycat/je/jca/ra/JEException.java"/>
          </fileset>
          <package name="com.sleepycat.je.util"/>
          <package name="com.sleepycat.collections"/>
          <package name="com.sleepycat.bind.*"/>
          <package name="com.sleepycat.persist"/>
          <package name="com.sleepycat.persist.model"/>
          <package name="com.sleepycat.persist.evolve"/>
          <package name="com.sleepycat.persist.raw"/>
          <package name="com.sleepycat.util"/>
          <link href="http://java.sun.com/j2se/1.5/docs/api"/>
          <link href="http://java.sun.com/javase/6/docs/api"/>
        </javadoc>
    </target>

    <target name="install">
    <description>Install JE into destdir</description>
      <condition property="isWindows">
         <os family="windows"/>
      </condition>
      <property file="dist/build.properties"/>
      <echo message="Installing JE into ${installdestdir}"/>
      <fail message="Install manually on Windows" if="isWindows"/>
      <property name="installdir"
             value="${installdestdir}/JE.${release.major}.${release.minor}"/>
      <mkdir dir="${installdir}"/>
      <mkdir dir="${installdir}/docs"/>
      <mkdir dir="${installdir}/bin"/>
      <mkdir dir="${installdir}/lib"/>
      <copy todir="${installdir}/docs">
         <fileset dir="docs">
	   <include name="**/*"/>
	 </fileset>
      </copy>
      <copy todir="${installdir}/lib">
	 <fileset dir="lib"/>
      </copy>
      <copy todir="${installdir}/bin">
	 <fileset dir="bin"/>
      </copy>
    </target>

    <!-- ============================================================ -->
    <!-- Clover, code coverage. To run with clover                    -->
    <!--        set the clover.libdir property above.                 -->
    <!--        make sure the clover.jar and clover.license are in    -->
    <!--           the ant/lib directory                              -->
    <!--        change inheritall=true above for the compile-src      -->
    <!--           target above.                                      -->
    <!--           and inheritall=false in ant/internal.xml to        -->
    <!--               inheritall=true                                -->
    <!--                                                              -->
    <!--  To run single test and generate report,we should type       -->
    <!--           ant clover.singletestdone                          -->
    <!--  and default single test is for no parameters, if you want   -->
    <!--  to change to other test, you can change the second parameter-->
    <!--  of the depends attribute of "clover.singletestrun" target   -->
    <!--                                                              -->
    <!--  To run all the tests and generate  report,we should type    -->
    <!--           ant clover.alltestsdone                            -->
    <!-- ============================================================ -->
    <target name="init-clover">
      <delete dir="${clover.tmpdir}"/>
      <mkdir dir="${clover.tmpdir}"/>
    </target>

    <target name="clean-clover" depends="init-clover">
      <delete dir="${clover.tmpdir}"/>
      <mkdir dir="${clover.tmpdir}"/>
    </target>

    <target name="clover.setup">
      <antcall target="clean"/>
      <antcall target="compile"/>
      <antcall target="clean-src"/>
      <taskdef resource="clovertasks"/>
      <clover-setup initString="${clover.tmpdir}/jecoverage.db"/>
      <antcall target="compile-src"/>
    </target>

    <target name="clover.runtest">
      <taskdef resource="clovertasks"/>
      <clover-setup initString="${clover.tmpdir}/jecoverage.db"/>
      <antcall target="test"/>
    </target>

    <target name="clover.runtest.LruOnly">
      <echo file="${unittest.srcdir}/je.properties" 
            message="je.evictor.lruOnly=true"/>
      <antcall target="clover.runtest"/>
      <echo file="${unittest.srcdir}/je.properties" message=""/>
    </target>

    <target name="clover.runtest.SharedLatches">
      <echo file="${unittest.srcdir}/je.properties" 
            message="je.env.sharedLatches=true"/>
      <antcall target="clover.runtest"/>
      <echo file="${unittest.srcdir}/je.properties" message=""/>
    </target>

    <target name="clover.runtest.Isolation">
      <echo file="${unittest.srcdir}/je.properties" 
            message="je.txn.serializableIsolation=true"/>
      <antcall target="clover.runtest"/>
      <echo file="${unittest.srcdir}/je.properties" message=""/>
    </target>

    <target name="clover.runtest.DirectNIO">
      <echo file="${unittest.srcdir}/je.properties">
        je.log.useNIO=true
        je.log.directNIO=true
      </echo>
      <antcall target="clover.runtest"/>
      <echo file="${unittest.srcdir}/je.properties" message=""/>  
    </target>

    <target name="clover.runtest.ChunkNIO">
      <echo file="${unittest.srcdir}/je.properties">
        je.log.useNIO=true
        je.log.chunkedNIO=4096
      </echo>
      <antcall target="clover.runtest"/>
      <echo file="${unittest.srcdir}/je.properties" message=""/>
    </target>
	
    <target name="clover.alltestsrun" 
            depends="clover.setup, clover.runtest, 
            clover.runtest.DirectNIO, clover.runtest.SharedLatches, 
            clover.runtest.LruOnly, clover.runtest.Isolation,
            clover.runtest.ChunkNIO">
    </target>

    <target name="clover.swing" depends="clover.alltestsrun">
      <taskdef resource="clovertasks"/>
      <clover-view/>
    </target>

    <target name="clover.log" depends="clover.alltestsrun">
      <taskdef resource="clovertasks"/>
      <clover-log/>
    </target>

    <target name="clover.pdf" depends="clover.alltestsrun">
      <taskdef resource="clovertasks"/>
      <clover-report>
      	<current outfile="jecoverage.pdf">
      	  <format type="pdf"/>
        </current>
      </clover-report>
    </target>

    <target name="clover.alltestsdone" depends="clover.alltestsrun">
      <taskdef resource="clovertasks"/>
      <clover-setup initString="${clover.tmpdir}/jecoverage.db"/>
      <clover-report>
        <current outfile="clover_html">
          <format type="html"/>
        </current>
      </clover-report>
    </target>

    <target name="clover.singletestdone" depends="clover.setup,clover.runtest">
      <taskdef resource="clovertasks"/>
      <clover-setup initString="${clover.tmpdir}/jecoverage.db"/>
      <clover-report>
        <current outfile="clover_html">
          <format type="html"/>
        </current>
      </clover-report>
    </target>

</project>