-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
2152 lines (1943 loc) · 85.5 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
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
<?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.envdirroot" value="${unittest.dir}/envdata"/>
<property name="unittest.failures" value="${unittest.dir}/failures"/>
<property name="unittest.copylimit" value="10"/>
<property name="unittest.datadir" value="${unittest.dir}/data"/>
<property name="unittest.extraenvdir" value="${unittest.dir}/propTest"/>
<property name="unittest.extraenvdir2" value="${unittest.dir}/propTest2"/>
<property name="unittest.reportsdir" value="${unittest.dir}/reports"/>
<property name="unittest.testclassloader"
value="${unittest.dir}/testclassloader"/>
<property name="unittest.testserialdir" value="${unittest.dir}/testserial"/>
<property name="unittest.testevolvedir" value="${unittest.dir}/testevolve"/>
<property name="unittest.serialtest.bdb"
value="${unittest.dir}/StoredClassCatalogTest-bdb"/>
<property name="unittest.serialtest.txn"
value="${unittest.dir}/StoredClassCatalogTest-txn"/>
<property name="unittest.showoutput" value="true"/>
<property name="doc.dir" value="${basedir}/docs"/>
<property name="doc.javadir" value="${doc.dir}/java"/>
<property name="doc.examplesdir" value="${doc.dir}/examples"/>
<property name="docsrc.dir" value="${basedir}/docs_src"/>
<property name="doclet.src.dir" value="${doc.dir}/doclet"/>
<property name="doclet.classes.dir" value="${doclet.src.dir}/Classes"/>
<property name="doclet.jar" value="${doc.dir}/HidingDoclet.jar"/>
<property name="javadoc.proxy.host" value=""/>
<property name="javadoc.proxy.port" value="80"/>
<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"/>
<property name="android.libdir" value="${basedir}/dist/android.jar"/>
<!--
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=""/>
<!-- The JDK source and target version for compiles and javadoc -->
<property name="jdk.version" value="1.5"/>
<!-- Check whether we're running under Java 6 or earlier -->
<condition property="using.jdk6.or.earlier">
<matches pattern="^1[.][56][.].*" string="${java.version}"/>
</condition>
<!--
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="examples.classpath">
<path refid="class.path"/>
<pathelement location="${android.libdir}"/>
</path>
<path id="unittest.classpath">
<path refid="class.path"/>
<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>
<path id="jconsole.classpath">
<pathelement location="${destdir}"/>
<pathelement location="."/>
<pathelement path="${jconsole.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,
com/sleepycat/utilint/**/*.class"/>
<fileset id="excludeclasses" dir="src/com/sleepycat">
<exclude name="asm/**/*.java" />
<exclude name="bind/RecordNumberBinding.java" />
<exclude name="collections/StoredList.java" />
</fileset>
<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="${doc.examplesdir}"/>
<mkdir dir="${clover.tmpdir}"/>
<mkdir dir="${unittest.dir}"/>
<mkdir dir="${unittest.destdir}"/>
<mkdir dir="${unittest.envdirroot}"/>
<mkdir dir="${unittest.extraenvdir}"/>
<mkdir dir="${unittest.extraenvdir2}"/>
<mkdir dir="${unittest.testclassloader}"/>
<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-jarfile-present">
<available classname="${jar-classname}" property="jar.present">
<classpath refid="${jar-classpath}"/>
</available>
<fail message="You need to set the '${jar.filename}' property in the
build.properties file." unless="jar.present"/>
</target>
<target name="check-j2ee-present">
<antcall target="check-jarfile-present">
<param name="jar-classname"
value="javax.resource.ResourceException"/>
<param name="jar-classpath" value="j2ee.classpath"/>
<param name="jar.filename" value="j2ee.jarfile"/>
</antcall>
</target>
<target name="check-jconsole-present">
<antcall target="check-jarfile-present">
<param name="jar-classname"
value="com.sun.tools.jconsole.JConsolePlugin"/>
<param name="jar-classpath" value="jconsole.classpath"/>
<param name="jar.filename" value="jconsole.jarfile"/>
</antcall>
</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">
<!-- Compile source codes in bind, je (without rep), util package
to remove the dependency between je (without rep), bind, util,
compat and other packages.-->
<ant antfile="ant/compile.xml" dir="." inheritall="false">
<property name="exclude2"
value="com/sleepycat/je/rep/**/*.java,
com/sleepycat/asm/**/*.java,
com/sleepycat/collections/**/*.java,
com/sleepycat/persist/**/*.java"/>
<reference refid="class.path" torefid="compile.classpath"/>
</ant>
<!-- Compile the rest packages. -->
<ant antfile="ant/compile.xml" dir="." inheritall="false">
<reference refid="class.path" torefid="compile.classpath"/>
</ant>
<!-- Enhance the built-in persistent proxy classes. -->
<!-- ONEJAVASTART -->
<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>
<!-- ONEJAVASTOP -->
</target>
<available classname="android.os.Bundle" property="androidjar-exists">
<classpath refid="examples.classpath"/>
</available>
<target name="compile-examples-with-androidjar" if="androidjar-exists">
<ant antfile="ant/compile.xml" dir="." inheritall="false">
<property name="srcdir" value="${example.srcdir}"/>
<property name="include" value="**/*.java"/>
<property name="exclude2" value="jca/**/*.java"/>
<reference refid="examples.classpath" torefid="compile.classpath"/>
</ant>
<!-- Compile the andriod example. -->
<ant antfile="ant/compile.xml" dir="." inheritall="false">
<property name="srcdir"
value="${example.srcdir}/android/JECursorAdapter/gen"/>
<property name="include"
value="android/JECursorAdapter/**/*.java"/>
<property name="exclude2" value="jca/**/*.java"/>
<property name="exclude5" value="android/salesdemos/**"/>
<reference refid="examples.classpath" torefid="compile.classpath"/>
</ant>
<ant antfile="ant/compile.xml" dir="." inheritall="false">
<property name="srcdir"
value="${example.srcdir}/android/JECursorAdapter/src"/>
<property name="include"
value="android/JECursorAdapter/**/*.java"/>
<property name="exclude2" value="jca/**/*.java"/>
<property name="exclude5" value="android/salesdemos/**"/>
<reference refid="examples.classpath" torefid="compile.classpath"/>
</ant>
</target>
<target name="compile-examples-without-androidjar"
unless="androidjar-exists">
<ant antfile="ant/compile.xml" dir="." inheritall="false">
<property name="srcdir" value="${example.srcdir}"/>
<property name="include" value="**/*.java"/>
<property name="exclude2" value="jca/**/*.java"/>
<reference refid="examples.classpath" torefid="compile.classpath"/>
</ant>
</target>
<target name="compile-examples" depends="compile-src">
<ant target="compile-examples-with-androidjar"/>
<ant target="compile-examples-without-androidjar"/>
</target>
<target name="compile-jmx" depends="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>
<target name="compile-jconsoleplugin"
depends="check-jconsole-present, compile-src">
<ant antfile="ant/compile.xml" dir="." inheritall="false">
<reference refid="jconsole.classpath" torefid="compile.classpath"/>
<property name="include"
value="com/sleepycat/je/jmx/plugin/*.java"/>
<property name="exclude3" value=""/>
<property name="jdk.version" value="1.6"/>
</ant>
</target>
<target name="compile-rep-jconsoleplugin" depends="compile-jconsoleplugin">
<ant antfile="ant/compile.xml" dir="." inheritall="false">
<reference refid="jconsole.classpath" torefid="compile.classpath"/>
<property name="include"
value="com/sleepycat/je/rep/jmx/plugin/*.java"/>
<property name="exclude4" value=""/>
<property name="jdk.version" value="1.6"/>
</ant>
</target>
<!-- for jar packaging -->
<target name="compile-dist" depends="init">
<javac srcdir="${dist.srcdir}"
destdir="${dist.destdir}"
includeantruntime="true"
source="${jdk.version}"
target="${jdk.version}">
<classpath refid="class.path"/>
<!-- Specify an empty boot classpath to use the default but
suppress warnings about missing version checks -->
<bootclasspath path=""/>
</javac>
</target>
<!-- ============================================================ -->
<!-- Jars -->
<!-- ============================================================ -->
<target name="clean-jar">
<delete dir="${libdir}"/>
</target>
<!-- JE jar -->
<target name="jar" depends="compile,clean-package,je-version">
<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"/>
<attribute name="Implementation-Title"
value="Berkeley DB Java Edition"/>
<attribute name="Implementation-Version"
value="${version.result}"/>
<attribute name="Implementation-Vendor"
value="Oracle"/>
<attribute name="Implementation-URL"
value="http://www.oracle.com/"/>
</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>
<!-- jconsole plugin jar -->
<target name="jconsoleplugin"
depends="compile-jconsoleplugin,je-version,jar">
<jar jarfile="${libdir}/JEJConsole.jar">
<metainf dir="${srcdir}/com/sleepycat/je/jmx/plugin"
excludes="*.java"/>
<fileset dir="${destdir}"
includes="com/sleepycat/je/EnvironmentStats.class,
com/sleepycat/je/jmx/JEMonitor.class,
com/sleepycat/je/jmx/plugin/*.class"/>
<manifest>
<attribute name="Implementation-Title"
value="Berkeley DB Java Edition jconsole Plugin"/>
<attribute name="Implementation-Version"
value="${version.result}"/>
<attribute name="Implementation-Vendor"
value="Oracle"/>
<attribute name="Implementation-URL"
value="http://www.oracle.com/"/>
</manifest>
</jar>
</target>
<target name="repjconsoleplugin"
depends="compile-rep-jconsoleplugin,je-version,jar">
<jar jarfile="${libdir}/RepJEJConsole.jar">
<metainf dir="${srcdir}/com/sleepycat/je/rep/jmx/plugin"
excludes="*.java"/>
<fileset dir="${destdir}"
includes="com/sleepycat/je/EnvironmentStats.class,
com/sleepycat/je/jmx/JEMonitor.class,
com/sleepycat/je/jmx/plugin/*.class,
com/sleepycat/je/rep/ReplicatedEnvironmentStats.class,
com/sleepycat/je/rep/jmx/RepJEMonitor.class
com/sleepycat/je/rep/jmx/plugin/*.class,
com/sleepycat/je/utilint/*Stat.class"/>
<manifest>
<attribute name="Implementation-Title"
value="Berkeley DB Java Edition HA jconsole Plugin"/>
<attribute name="Implementation-Version"
value="${version.result}"/>
<attribute name="Implementation-Vendor"
value="Oracle"/>
<attribute name="Implementation-URL"
value="http://www.oracle.com/"/>
</manifest>
</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, get-boot-classpath">
<delete dir="${doclet.classes.dir}"/>
<delete file="${doclet.jar}"/>
<mkdir dir="${doclet.classes.dir}"/>
<javac srcdir="${doclet.src.dir}"
destdir="${doclet.classes.dir}"
includeantruntime="true"
source="${jdk.version}"
target="${jdk.version}"
bootclasspath="${jdk.boot.class.path}">
<include name="*.java"/>
</javac>
<jar jarfile="${doclet.jar}">
<fileset dir="${doclet.classes.dir}" includes="*.class"/>
</jar>
</target>
<!-- Set the value of the jdk.boot.class.path property to the
value of the boot classpath in the earlier version Java
installation specified by the jdk.version.home property, if
any. If the jdk.version.home property is set when running Java
7, the boot classpath value will be used by the javac and
javadoc tools to check that only Java APIs available in the JDK
source version are being used. If the jdk.version.home
property is not set, the default boot classpath will be used.
In that case, when running Java 7, the tools will generate
warnings about the missing boot classpath setting, and calls to
more recent APIs will not be flagged, but the compiler will
still enforce the language rules and generate class files in
the byte code format specified by the jdk.version property. -->
<target name="get-boot-classpath"
depends="maybe-warn-set-jdk-version-home, init, compile-dist"
if="jdk.version.home">
<java fork="yes"
jvm="${jdk.version.home}/bin/java"
failonerror="true"
classname="PrintBootClassPath"
classpathref="dist.classpath"
outputproperty="jdk.boot.class.path"/>
</target>
<!-- Print a warning message if jdk.version.home needs to be set -->
<target name="maybe-warn-set-jdk-version-home"
depends="check-need-jdk-version-home"
if="warn.set.jdk.version.home">
<echo message="warning: The jdk.version.home property is not set, not
checking JDK ${jdk.version} compatibility"/>
</target>
<target name="check-need-jdk-version-home">
<condition property="warn.set.jdk.version.home">
<and>
<not><isset property="using.jdk6.or.earlier"/></not>
<not><isset property="jdk.version.home"/></not>
</and>
</condition>
</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"/>
<classpath refid="clover.classpath"/>
</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, jconsoleplugin, repjconsoleplugin, 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="examples/android/salesdemos/**,test/rpcserver/**,test/experiments/**,test/examples/**,test/regress/*/**,test/**/MiniStress.java,test/**/AbortStress.java,dist/,**/jca/README.txt,examples/com/**,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.envdirroot}"/>
<mkdir dir="${unittest.envdirroot}"/>
<delete dir="${unittest.failures}"/>
<mkdir dir="${unittest.failures}"/>
<delete dir="${unittest.testclassloader}"/>
<mkdir dir="${unittest.testclassloader}"/>
<delete dir="${unittest.testserialdir}"/>
<mkdir dir="${unittest.testserialdir}"/>
<delete dir="${unittest.testevolvedir}"/>
<mkdir dir="${unittest.testevolvedir}"/>
<delete dir="${unittest.serialtest.bdb}"/>
<delete dir="${unittest.serialtest.txn}"/>
</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}/je.properties"
todir="${unittest.envdirroot}"/>
<!-- 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 LoadedClassImpl.java separately. -->
<property name="loadedclassimpl"
value="com/sleepycat/je/LoadedClassImpl.java"/>
<copy file="${unittest.srcdir}/${loadedclassimpl}.original"
tofile="${unittest.testclassloader}/${loadedclassimpl}"/>
<ant antfile="ant/compile.xml" dir="." inheritall="false">
<property name="srcdir" value="${unittest.testclassloader}"/>
<property name="destdir" value="${unittest.testclassloader}"/>
<reference refid="unittest.classpath" torefid="compile.classpath"/>
</ant>
<!-- Compile original version of TestSerial class separately. -->
<property name="testserialpath"
value="com/sleepycat/collections/test/serial/TestSerial.java"/>
<copy file="${unittest.srcdir}/${testserialpath}.original"
tofile="${unittest.testserialdir}/${testserialpath}"/>
<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.java"/>
<copy file="${unittest.srcdir}/${testevolvepath}.original"
tofile="${unittest.testevolvedir}/${testevolvepath}"/>
<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>
<!-- Compile rep/persist/test/AppImpl variants separately. -->
<antcall target="do-compile-dpl-upgrade">
<param name="v" value="0"/>
</antcall>
<antcall target="do-compile-dpl-upgrade">
<param name="v" value="1"/>
</antcall>
</target>
<!-- Copy AppImpl.java.${v} to dplUpgrade.${v} directory, compile it. -->
<target name="do-compile-dpl-upgrade">
<mkdir dir="${unittest.testevolvedir}/dplUpgrade.${v}"/>
<copy file="${unittest.srcdir}/com/sleepycat/je/rep/persist/test/AppImpl.java.${v}"
tofile="${unittest.testevolvedir}/dplUpgrade.${v}/com/sleepycat/je/rep/persist/test/AppImpl.java"/>
<ant antfile="ant/compile.xml" dir="." inheritall="false">
<property name="srcdir"
value="${unittest.testevolvedir}/dplUpgrade.${v}"/>
<property name="destdir"
value="${unittest.testevolvedir}/dplUpgrade.${v}"/>
<property name="include" value=""/>
<reference refid="unittest.classpath" 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>
<!--
Unit test targets:
Run all tests ant test
Note: it would run base and replicated tests.
Run base tests ant test -Dnorep=<any value>
Run replicated tests ant test -Dreponly=<any value>
Note: You can set these two properties with any value you want, but if
assign a null value to it, it will only run dpl/persist tests.
Run one test case ant test -Dtestcase=com.sleepycat.je.db.DbTest
Run one package ant test -Dsuite=db
Note: Base and replicated tests may have the same directory name.
If don't want to run both base and rep tests together, please
specify the full path of the package, e.g:
ant test -Dsuite=com/sleepycat/je/txn.
If running both tests, only need to specify the package name, e.g:
ant test -Dsuite=txn
Run one test case ant test -Dtestcase=com.sleepycat.je.db.DbTest
with a specific jar -Dtestjar=je.jar
Run one test case ant test -Dtestcase=com.sleepycat.je.db.DbTest
with specific methods -Dtestcase.methods=testOne,testTwo
Run one package ant test -Dsuite=db -Dtestjar=je.jar
with a specific jar
Run all tests with ant test -Dtestjar=je.jar
a specific jar
Run replicated tests ant test -Dreponly=<any value> -Dtestjar=je.jar
with a specific jar
Run no replicated tests ant test -Dnorep=<any value> -Dtestjar=je.jar
with a specific jar
-->
<target name="test-j2ee"
depends="compile-unittest-j2ee,test"/>
<path id="testserial-classpath">
<pathelement location="${unittest.testserialdir}"/>
</path>
<path id="testevolve-classpath">
<pathelement location="${unittest.testevolvedir}"/>
</path>
<!--
The property socketlistener is used to enable remote debugging for
unit tests. For example, ant test -Dsocketlistener=1 will let you
attach a debugger to a unit test run. This functionality is disabled
by default.
-->
<property name="socketdebugparamvalue"
value="-Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=n -Xdebug"/>
<condition property="socketdebugparam" value="${socketdebugparamvalue}">
<isset property="socketlistener"/>
</condition>
<condition property="socketdebugparam" value="">
<not>
<isset property="socketlistener"/>
</not>
</condition>
<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="reponly"/>
<isset property="norep"/>
</or>
</not>
</condition>
<condition property="testserial">
<or>
<isset property="alltests"/>
<isset property="norep"/>
<contains string="${suite}" substring="serial"/>
<equals arg1="${testcase}" arg2=
"com.sleepycat.collections.test.serial.StoredClassCatalogTest"/>
</or>
</condition>
<condition property="testevolve">
<or>
<isset property="alltests"/>
<isset property="norep"/>
<contains string="${suite}" substring="persist"/>
<equals arg1="${testcase}"
arg2="com.sleepycat.persist.test.EvolveTest"/>
</or>
</condition>
<condition property="testpersist">
<or>
<isset property="alltests"/>
<isset property="norep"/>
<contains string="${suite}" substring="persist"/>
</or>
</condition>
<condition property="param-rep">
<and>
<isset property="reponly"/>
<not>
<isset property="norep"/>
</not>
</and>
</condition>
<condition property="param-base">
<and>
<isset property="norep"/>
<not>
<isset property="reponly"/>
</not>
</and>
</condition>
<condition property="testcase-all-methods">
<and>
<isset property="testcase"/>
<not>
<isset property="testcase.methods"/>
</not>
</and>
</condition>
<condition property="testcase-specific-methods">
<and>
<isset property="testcase"/>
<isset property="testcase.methods"/>
</and>
</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>