forked from apavlo/h-store
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
2598 lines (2346 loc) · 102 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" ?>
<!DOCTYPE project [
<!ENTITY common SYSTEM "build-common.xml">
]>
<project default="default" name="H-Store">
<!-- GENERAL HELPER MACROS -->
<macrodef name="envdefault">
<attribute name="prop" />
<attribute name="var" />
<attribute name="default" />
<sequential>
<condition property="@{prop}" value="${env.@{var}}" else="@{default}">
<isset property="env.@{var}" />
</condition>
</sequential>
</macrodef>
<!-- PATHS AND PROPERTIES -->
<!-- make environment var foo available as env.foo -->
<property environment="env"/>
<!-- allow env.VOLTBUILD to override "build" property -->
<envdefault prop="build" var="VOLTBUILD" default="release" />
<!-- <property name='build.dir' location='obj/${build}' /> -->
<property name='output.dir' location='obj' />
<property name='build.dir' location='${output.dir}/release' />
<property name='build.prod.dir' location='${build.dir}/prod' />
<property name='build.benchmarks.dir' location='${build.dir}/benchmarks' />
<property name='build.test.dir' location='${build.dir}/test' />
<property name='build.preprocessor.dir' location='${build.dir}/preprocessor' />
<property name='dist.dir' location='${build.dir}/dist' />
<property name='dist.examples.dir' location='${dist.dir}/examples' />
<property name='dist.examples.auction.dir' location='${dist.examples.dir}/auction' />
<property name='dist.examples.satellite.dir' location='${dist.examples.dir}/satellite' />
<property name='dist.examples.voter.dir' location='${dist.examples.dir}/voter' />
<property name='properties.dir' location='properties' />
<property name='benchmark.dir' location='${properties.dir}/benchmarks' />
<property name='doc.dir' location='doc' />
<property name='src.dir' location='src' />
<property name='src.frontend.dir' location='${src.dir}/frontend' />
<property name='src.benchmarks.dir' location='${src.dir}/benchmarks' />
<property name='src.hsqldb.dir' location='${src.dir}/hsqldb19b3' />
<property name='src.protorpc.dir' location='${src.dir}/protorpc' />
<property name='src.test.dir' location='tests/frontend' />
<property name='src.hsqldb.test.dir' location='tests/hsqldb' />
<property name='src.ee.parent.dir' location='src/ee' />
<property name='src.ee.dir' location='src/ee' />
<property name='tools.dir' location='tools' />
<property name='build.testoutput.dir' location='${build.dir}/testoutput' />
<property name='build.testobjects.dir' location='${build.dir}/testobjects' />
<property name='build.protorpc.dir' location='${build.dir}/protorpc' />
<property name='thirdpartylib.dir' location='third_party/java/jars' />
<property name='thirdpartysrc.dir' location='third_party/java/src' />
<property name='m1catalog' location='${src.test.dir}/org/voltdb/catalog/catalog.txt' />
<property name='depcache' value='.depcache' />
<!-- Supplmental H-Store Files -->
<property name='files.dir' location='files' />
<property name='files.stats.dir' location='${files.dir}/stats' />
<property name='files.workloads.dir' location='${files.dir}/workloads' />
<property name='files.markovs.dir' location='${files.dir}/markovs' />
<property name='files.hints.dir' location='${files.dir}/designhints' />
<!-- BerkeleyDB Source -->
<property name="src.berkeleydb.dir" location="third_party/cpp/berkeleydb" />
<property name="build.berkeleydb.dir" location="${build.dir}/berkeleydb" />
<!-- ProtocolBuffer Source -->
<property name="src.protobuf.dir" location="third_party/cpp/protobuf" />
<property name="build.protobuf.dir" location="${build.dir}/protobuf" />
<property name="build.protobuf.protoc.dir" location="${build.protobuf.dir}/src/protoc" />
<!-- emma build instrumentation location -->
<property name='build.instr.dir' location='${build.dir}/instr' />
<!-- JProfiler Parameters -->
<property name='jprofiler.dir' location='/home/ubuntu/Programs/jprofiler' />
<property name='jprofiler.port' value='8849' />
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="${thirdpartylib.dir}/ant-contrib.jar"/>
</classpath>
</taskdef>
<!--
******************************************************************************
** H-STORE CONFIGURATION
******************************************************************************
-->
<!-- Default H-Store Configuration File -->
<condition property="conf" value="${properties.dir}/default.properties">
<not><isset property="conf"/></not>
</condition>
<property file="${conf}"/>
<!-- IMPORTANT: We always need to set global.defaulthost if the user doesn't -->
<condition property="global.defaulthost" value="localhost">
<not><isset property="global.defaulthost"/></not>
</condition>
<!-- SITE ASSERTS -->
<condition property="site.jvm_asserts" value="true">
<not><isset property="site.jvm_asserts"/></not>
</condition>
<if>
<equals arg1="${site.jvm_asserts}" arg2="true" />
<then>
<assertions id="site.assertions"><enable /></assertions>
</then>
<else>
<assertions id="site.assertions"><disable /></assertions>
</else>
</if>
<!-- CLIENT ASSERTS -->
<condition property="client.jvm_asserts" value="true">
<not><isset property="client.jvm_asserts"/></not>
</condition>
<if>
<equals arg1="${client.jvm_asserts}" arg2="true" />
<then>
<assertions id="client.assertions"><enable /></assertions>
</then>
<else>
<assertions id="client.assertions"><disable /></assertions>
</else>
</if>
<!--
******************************************************************************
** BENCHMARK CONFIGURATION
******************************************************************************
-->
<!-- Default Project -->
<!--<condition property="project" value="tpcc">
<not><isset property="project"/></not>
</condition>-->
<!-- Project Jar File -->
<property name="benchmark.jar" location="${project}.jar" />
<condition property="jar" value="${benchmark.jar}">
<not><isset property="jar"/></not>
</condition>
<!--
******************************************************************************
** ADDITIONAL CONFIGURATION
******************************************************************************
-->
<!-- Default heap size for Volt server (MB) -->
<condition property="volt.server.memory" value="2048">
<not><isset property="volt.server.memory"/></not>
</condition>
<!-- Default heap size for Volt clients+loaders (MB) -->
<condition property="volt.client.memory" value="1024">
<not><isset property="volt.client.memory"/></not>
</condition>
<!-- Overridden in the Hudson test script. -->
<property name='junit.haltonfailure' value='false' />
<property name="j2se_api" value="http://java.sun.com/javase/6/docs/api/"/>
<path id='project.classpath'>
<pathelement location='${build.instr.dir}' />
<pathelement location='${build.prod.dir}' />
<pathelement location='${build.benchmarks.dir}' />
<pathelement location='${build.test.dir}' />
<fileset dir='${thirdpartylib.dir}'>
<include name='*.jar' />
<exclude name='ant.jar' />
</fileset>
<pathelement path="${java.class.path}"/>
</path>
<!-- select which set of regression suite configuration types to run -->
<condition property="regressions" value="${regressions}" else="all">
<isset property="regressions"/>
</condition>
<!-- Workload Tracer Properties -->
<condition property="workload.trace.class" value="">
<not><isset property="workload.trace.class"/></not>
</condition>
<condition property="workload.trace.path" value="">
<not><isset property="workload.trace.path"/></not>
</condition>
<condition property="workload.trace.ignore" value="">
<not><isset property="workload.trace.ignore"/></not>
</condition>
<!--
******************************************************************************
PRIMARY ENTRY POINTS
******************************************************************************
-->
<target name="build"
depends="default"
description="Compile Java classes and C++ JNI library."
/>
<target name="build-java"
depends="protorpc, compile"
description="Compile Java classes."
/>
<target name="build-cpp"
depends="ee"
description="Compile C++ JNI library."
/>
<target name="default"
depends="protorpc, compile, ee"
description="Compile Java classes and C++ JNI library."
/>
<target name="check"
depends="compile, voltdbipc, eecheck, junit, pythonfser"
description="Run Java and C++ JNI testcases and test plan fragments."
/>
<target name="check_quick"
depends="compile, voltdbipc, junit"
description="Run a subset of Java testcases and test fragments."
/>
<!-- "junit, eecheck, doc, eedoc, jars" -->
<target name="build-all"
depends="protobuf.java, protorpc, compile, ee"
description="Do all tasks."
/>
<target name="jars"
depends="hstore.jar"
description="Create production JAR files."
/>
<target name="dist"
depends="dist_internal"
description="Create VoltDB release package with examples and documentation."
/>
<target name="checkstyle">
<checkstyle config="checkstyle.xml">
<fileset dir='${src.frontend.dir}'>
<include name='**/*.java' />
<exclude name='org/voltdb/network/*.java' />
</fileset>
<fileset dir='${src.test.dir}'>
<include name='**/*.java' />
</fileset>
<formatter type="plain"/>
</checkstyle>
</target>
<!--
******************************************************************************
ENVIRONMENT SETUP
******************************************************************************
-->
<target name="getcpus"
description="Get the number of CPUs on this machine"
unless="numcpus">
<exec executable="${tools.dir}/getcpus.py" outputproperty="numcpus" />
</target>
<target name="getjava"
description="Get local Java version"
unless="global.jvm_version">
<exec executable="${tools.dir}/getjava.py" outputproperty="global.jvm_version" />
</target>
<!--<target name="default_properties.check">
<available property="default_properties.exists" file="${propeties.dir}/default.properties" />
</target>
<target name="default_properties" depends="default_properties.check" unless="default_properties.exists">
<property name="default.properties" location="log4j.properties"/>
<symlink link="${build.prod.dir}" resource="${log4j.properties}" failonerror="false"/>
</target>-->
<!--
******************************************************************************
DISTRIBUTION
******************************************************************************
-->
<target name="dist_internal" depends="compile, ee, hstore.jar">
<!-- prepare release directory for new content -->
<delete includeemptydirs="true" failonerror='false'>
<fileset dir="${dist.dir}" includes="**/*" />
</delete>
<mkdir dir="${dist.dir}" />
<mkdir dir="${dist.dir}/doc" />
<mkdir dir="${dist.dir}/tools" />
<mkdir dir="${dist.dir}/voltdb" />
<!-- populate selected server/compiler javadoc documentation -->
<javadoc
destdir="${dist.dir}/doc/procedure-api"
Public="true"
version="true"
use="true"
nodeprecated="true"
Overview='${src.frontend.dir}/overview-public.html'
Windowtitle='VoltDB Server APIs'>
<link href="${j2se_api}"/>
<classpath refid='project.classpath' />
<fileset dir="." defaultexcludes="yes">
<include name="src/frontend/org/voltdb/VoltTable.java" />
<include name="src/frontend/org/voltdb/VoltTableRow.java" />
<include name="src/frontend/org/voltdb/VoltProcedure.java" />
<include name="src/frontend/org/voltdb/SQLStmt.java" />
<include name="src/frontend/org/voltdb/VoltType.java" />
<include name="src/frontend/org/voltdb/ProcInfo.java" />
</fileset>
</javadoc>
<!-- populate selected client javadoc documentation -->
<javadoc
destdir="${dist.dir}/doc/java-client-api"
access="protected"
version="true"
use="true"
nodeprecated="true"
Overview='${src.frontend.dir}/overview-public.html'
Windowtitle='VoltDB Client APIs'>
<link href="${j2se_api}"/>
<classpath refid='project.classpath' />
<fileset dir="." defaultexcludes="yes">
<include name="src/frontend/org/voltdb/VoltTable.java" />
<include name="src/frontend/org/voltdb/VoltTableRow.java" />
<include name="src/frontend/org/voltdb/VoltClient.java" />
<include name="src/frontend/org/voltdb/VoltType.java" />
<include name="src/frontend/org/voltdb/client/Client.java" />
<include name="src/frontend/org/voltdb/client/NoConnectionsException.java" />
<include name="src/frontend/org/voltdb/client/ProcedureCallback.java" />
<include name="src/frontend/org/voltdb/client/ClientFactory.java" />
<include name="src/frontend/org/voltdb/client/SyncCallback.java" />
<include name="src/frontend/org/voltdb/client/NullCallback.java" />
<include name="src/frontend/org/voltdb/client/ProcCallException.java" />
<include name="src/frontend/org/voltdb/client/ClientStatusListener.java" />
<include name="src/frontend/org/voltdb/client/ClientResponse.java" />
</fileset>
</javadoc>
<!-- populate java and native libraries -->
<copy todir="${dist.dir}/voltdb" flatten="true" >
<fileset dir="${build.dir}" defaultexcludes="yes">
<include name="prod/voltdb-${dist.version}.jar" />
<include name="nativelibs/libvoltdb*" />
</fileset>
</copy>
<!-- populate top level README by copying and renaming user_guide -->
<copy tofile="${dist.dir}/README" file="doc/user_guide"/>
<!-- populate examples top level README -->
<copy tofile="${dist.dir}/examples/README" file="examples/README"/>
<!-- populate the other examples -->
<copy todir="${dist.dir}/examples" >
<fileset dir="examples" defaultexcludes="yes">
<include name="**/*"/>
</fileset>
</copy>
<!-- populate the ad hoc tool -->
<copy todir="${dist.dir}/tools" >
<fileset dir="tools" defaultexcludes="yes">
<include name="browser_adhoc/**"/>
</fileset>
</copy>
<!-- copy fastserializer.py for python examples -->
<copy todir="${dist.dir}/tools/browser_adhoc" file="tests/scripts/fastserializer.py"/>
<copy todir="${dist.dir}/tools/browser_adhoc" file="tests/scripts/Query.py"/>
<!-- populate project generator -->
<exec dir="src/proj_gen/" executable="python">
<arg line="generator_compiler.py"/>
</exec>
<move tofile="${dist.dir}/tools/generate" file="src/proj_gen/generate" />
<chmod perm="ugo+rx">
<fileset dir="${dist.dir}/tools" defaultexcludes="yes">
<include name="generate"/>
</fileset>
</chmod>
<!-- copy licenses -->
<copy todir="${dist.dir}" file="COPYING"/>
<copy todir="${dist.dir}/voltdb" file="COPYING"/>
<!-- create an archive for distribution -->
<tar destfile="${build.dir}/voltdb-temp.tar" >
<tarfileset
prefix="voltdb-${dist.version}"
dir="${dist.dir}"
includes="**/*"
excludes="**/*.py generate"
/>
<tarfileset
prefix="voltdb-${dist.version}"
dir="${dist.dir}"
includes="**/*.py generate"
/>
</tar>
<gzip src="${build.dir}/voltdb-temp.tar" destfile="${build.dir}/voltdb-${dist.version}.tar.gz" />
<delete file="${build.dir}/voltdb-temp.tar" />
</target>
<!--
******************************************************************************
CLEANING
******************************************************************************
-->
<target name="clean" depends="clean-all" />
<target name="clean-java">
<delete includeemptydirs="true" dir="${build.prod.dir}" />
<delete includeemptydirs="true" dir="${build.benchmarks.dir}" />
<delete includeemptydirs="true" dir="${build.test.dir}" />
</target>
<target name="clean-cpp">
<delete includeemptydirs="true" dir="${build.dir}/nativelibs" />
<delete includeemptydirs="true" dir="${build.dir}/static_objects" />
<delete includeemptydirs="true" dir="${build.dir}/objects" />
<delete includeemptydirs="true" dir="${build.dir}/cpptests" />
<delete includeemptydirs="true" dir="${build.testobjects.dir}" />
</target>
<target name="clean-all" description="Remove all compiled files.">
<exec dir='.' executable='/bin/sh'>
<arg line="-c 'rm -rf obj/*'"/>
</exec>
</target>
<target name="clean-protorpc">
<delete includeemptydirs="true" dir="${build.protorpc.dir}" />
</target>
<target name="clean-preprocessor">
<delete includeemptydirs="true" dir="${build.preprocessor.dir}" />
</target>
<!--
******************************************************************************
JAR BUILDING
******************************************************************************
-->
<target name="buildinfo">
<loadfile property='dist.version' srcFile='version.txt'>
<filterchain><striplinebreaks/></filterchain>
</loadfile>
<exec dir="." executable="tools/getgitinfo.py">
<arg line='${dist.version}' />
</exec>
</target>
<target name="hstore.jar" depends="compile, buildinfo">
<jar destfile="${build.prod.dir}/hstore.jar">
<fileset dir="${build.prod.dir}" defaultexcludes="yes" >
<include name="org/**" />
<include name="edu/**" />
<exclude name="edu/brown/gui/**" />
</fileset>
<fileset dir="${build.benchmarks.dir}" defaultexcludes="yes" >
<include name="org/**" />
<include name="edu/**" />
</fileset>
<fileset dir="${build.test.dir}" defaultexcludes="no" >
<include name="org/voltdb/**" />
<include name="edu/brown/**" />
<include name="edu/mit/**" />
</fileset>
<fileset dir="${src.frontend.dir}" defaultexcludes="yes" >
<include name="org/voltdb/**" />
<include name="edu/brown/**" />
<include name="edu/mit/**" />
</fileset>
<fileset dir="${src.benchmarks.dir}" defaultexcludes="yes" >
<include name="org/voltdb/**" />
<include name="edu/brown/**" />
<include name="edu/mit/**" />
</fileset>
<fileset dir="${src.test.dir}" defaultexcludes="yes" >
<include name="org/voltdb/**" />
<include name="edu/brown/**" />
<include name="edu/mit/**" />
</fileset>
<fileset dir="."><include name="buildstring.txt"/></fileset>
<manifest>
<section name="Credits">
<attribute name="Author" value="H-Store" />
</section>
<section name="Shared">
<attribute
name="Title"
value="VoltDB compiler, server, client and test libraries"
/>
<attribute name="Date" value="${TODAY}" />
</section>
</manifest>
</jar>
</target>
<!--
******************************************************************************
JAVA COMPILATION
******************************************************************************
-->
<target name="compile" depends="getjava">
<mkdir dir='${build.prod.dir}' />
<mkdir dir='${build.benchmarks.dir}' />
<mkdir dir='${build.test.dir}' />
<exec
dir='${src.frontend.dir}/org/voltdb/utils'
executable='${src.frontend.dir}/org/voltdb/utils/generate_logkeys.py'
failonerror='true' />
<!-- <exec dir='.'
executable='${tools.dir}/preprocessor.py'
failonerror='true' >
<arg line='${src.frontend.dir} ${build.preprocessor.dir}' />
</exec>-->
<depend
srcdir="${src.hsqldb.dir}:${src.hsqldb.test.dir}:${src.frontend.dir}:${src.benchmarks.dir}:${src.test.dir}:${thirdpartysrc.dir}"
destdir="${build.prod.dir}:${build.test.dir}"
cache="${depcache}">
<classpath refid="project.classpath" />
</depend>
<!-- copy resources needed for logging messages -->
<copy todir="${build.prod.dir}">
<fileset dir="${src.hsqldb.dir}" includes="**/*.properties" />
<fileset dir="${src.frontend.dir}" includes="**/*.properties"/>
<fileset dir="${src.frontend.dir}" includes="**/*.xml" />
</copy>
<copy todir='${build.prod.dir}/org/hsqldb/resources'>
<fileset dir="${src.hsqldb.dir}/org/hsqldb/resources">
<include name="*"/>
</fileset>
</copy>
<!-- pick src//** schemas as package resources -->
<copy flatten='false' todir="${build.prod.dir}">
<fileset dir="${src.frontend.dir}">
<include name="**/*.xsd"/>
</fileset>
</copy>
<!-- the ddl files used by tests and benchmark clients are copied
relative to the client class and found with class.getResource() -->
<copy flatten='false' todir='${build.benchmarks.dir}'>
<fileset dir="${src.benchmarks.dir}">
<include name="**/*.sql"/>
<include name="**/*.mappings"/>
</fileset>
</copy>
<copy flatten='false' todir='${build.test.dir}'>
<fileset dir="${src.test.dir}">
<include name="**/*.sql"/>
<include name="**/*.mappings"/>
</fileset>
</copy>
<copy todir='${build.test.dir}/org/hsqldb'>
<fileset dir="${src.hsqldb.test.dir}/org/hsqldb">
<include name="*.sql"/>
</fileset>
</copy>
<copy
file='${src.test.dir}/org/voltdb/catalog/catalog.txt'
todir='${build.test.dir}/org/voltdb/catalog'/>
<!-- compile the individual source directories -->
<javac includeantruntime="false"
source="${global.jvm_version}"
target="${global.jvm_version}"
srcdir="${src.protorpc.dir}"
destdir='${build.prod.dir}'
debug='true'>
<compilerarg line="-encoding utf-8"/>
<classpath refid="project.classpath" />
</javac>
<javac includeantruntime="false"
source="${global.jvm_version}"
target="${global.jvm_version}"
srcdir="${src.hsqldb.dir}"
destdir='${build.prod.dir}'
debug='true'>
<compilerarg line="-encoding utf-8"/>
<classpath refid="project.classpath" />
</javac>
<javac includeantruntime="false"
source="${global.jvm_version}"
target="${global.jvm_version}"
srcdir="${thirdpartysrc.dir}"
destdir='${build.prod.dir}'
debug='true'>
<compilerarg line="-encoding utf-8"/>
<classpath refid="project.classpath" />
</javac>
<javac includeantruntime="false"
source="${global.jvm_version}"
target="${global.jvm_version}"
srcdir="${src.frontend.dir}"
destdir='${build.prod.dir}'
debug='true'>
<compilerarg line="-encoding utf-8"/>
<classpath refid="project.classpath" />
</javac>
<javac includeantruntime="false"
source="${global.jvm_version}"
target="${global.jvm_version}"
srcdir="${src.benchmarks.dir}"
destdir='${build.benchmarks.dir}'
debug='true'>
<compilerarg line="-encoding utf-8"/>
<classpath refid="project.classpath" />
</javac>
<!-- compile the individual test directories -->
<javac includeantruntime="false"
source="${global.jvm_version}"
target="${global.jvm_version}"
srcdir="${src.hsqldb.test.dir}"
destdir='${build.test.dir}'
debug='true'>
<compilerarg line="-encoding utf-8"/>
<classpath refid="project.classpath" />
</javac>
<javac includeantruntime="false"
source="${global.jvm_version}"
target="${global.jvm_version}"
srcdir="${src.test.dir}"
destdir='${build.test.dir}'
excludes="org/voltdb/benchmark/tpcc/JDBCClient.java,edu/mit/elt/ELTTester**"
debug='true'>
<compilerarg line="-encoding utf-8"/>
<classpath refid="project.classpath" />
</javac>
<!-- <javac includeantruntime="false"
target="${global.jvm_version}"
srcdir="${build.preprocessor.dir}"
destdir='${build.prod.dir}'
debug='true'>
<classpath refid="project.classpath" />
</javac>-->
<delete dir="${build.prod.dir}/META-INF/"/>
<!-- <antcall target="log4j_properties" /> -->
</target>
<!--<target name="log4j_properties.check">
<available property="log4j_properties.exists" file="${build.prod.dir}/log4j.properties" />
</target>
<target name="log4j_properties" depends="log4j_properties.check" unless="log4j_properties.exists">
<property name="log4j.properties" location="log4j.properties"/>
<symlink link="${build.prod.dir}" resource="${log4j.properties}" failonerror="false"/>
</target>-->
<!--
******************************************************************************
DOCUMENTATION
******************************************************************************
-->
<target name="doc" description="Create Java doc files.">
<javadoc
destdir="${doc.dir}/java-api"
version="true"
use="true"
Overview='${src.frontend.dir}/overview.html'>
<classpath refid='project.classpath' />
<link href="${j2se_api}"/>
<fileset dir="." defaultexcludes="yes">
<include name="src/frontend/org/voltdb/**/*.java"/>
</fileset>
</javadoc>
</target>
<taskdef
name="doxygen"
classname="org.doxygen.tools.DoxygenTask"
classpath="${thirdpartylib.dir}/ant_doxygen.jar"
/>
<target name="eedoc"
description="Generate doxygen C++ execution engine documentation.">
<doxygen configfilename="${doc.dir}/Doxyfile" />
</target>
<!--
******************************************************************************
BERKELEYDB LIBRARY
******************************************************************************
-->
<target name="clean-berkeleydb">
<delete includeemptydirs="true" dir="${build.berkeleydb.dir}" />
</target>
<target name="berkeleydb.check">
<!-- Check whether we've already built the BerkeleyDB libraries -->
<available property="berkeleydb.built"
file="${build.berkeleydb.dir}/libdb_cxx.a" />
</target>
<target name="berkeleydb.compile" description="Builds the BerkeleyDB library"
depends="berkeleydb.check, getcpus"
unless="berkeleydb.built">
<mkdir dir="${build.berkeleydb.dir}" />
<exec executable="${src.berkeleydb.dir}/dist/configure"
dir="${build.berkeleydb.dir}"
failonerror="true"
resolveexecutable="true">
<arg value="--prefix=${build.berkeleydb.dir}" />
<arg value="--enable-cxx" />
<arg value="--enable-static" />
<arg value="--enable-o_direct" />
<arg value="--with-pic" />
<!-- These are features that we don't need -->
<arg value="--disable-atomicsupport" />
<arg value="--disable-heap" />
<arg value="--disable-queue" />
<arg value="--disable-shared" />
<arg value="--disable-test" />
<arg value="--disable-cryptography" />
<arg value="--disable-replication" />
</exec>
<exec executable="make" dir="${build.berkeleydb.dir}" failonerror="true">
<arg value="-j${numcpus}" />
</exec>
</target>
<!--
******************************************************************************
NATIVE EE STUFF
******************************************************************************
-->
<target name='jnicompile'
depends='compile, jnicompile_temp, uptodate_jni_h.check'
description="Build C++ JNI library."
unless='uptodate_jni_h'>
<delete file="${src.ee.dir}/org_voltdb_jni_ExecutionEngine.h" />
<delete file="${src.ee.dir}/org_voltdb_utils_DBBPool.h" />
<delete file="${src.ee.dir}/org_voltdb_utils_ThreadUtils.h" />
<move
file='${build.dir}/org_voltdb_jni_ExecutionEngine.h'
todir='${src.ee.dir}'
/>
<move
file='${build.dir}/org_voltdb_utils_DBBPool.h'
todir='${src.ee.dir}'
/>
<move
file='${build.dir}/org_voltdb_utils_ThreadUtils.h'
todir='${src.ee.dir}'
/>
</target>
<target name='uptodate_jni_h.check' depends='jnicompile_temp'>
<condition property='uptodate_jni_h'>
<and>
<filesmatch
file1="${src.ee.dir}/org_voltdb_jni_ExecutionEngine.h"
file2="${build.dir}/org_voltdb_jni_ExecutionEngine.h"
/>
<filesmatch
file1="${src.ee.dir}/org_voltdb_utils_DBBPool.h"
file2="${build.dir}/org_voltdb_utils_DBBPool.h"
/>
<filesmatch
file1="${src.ee.dir}/org_voltdb_utils_ThreadUtils.h"
file2="${build.dir}/org_voltdb_utils_ThreadUtils.h"
/>
</and>
</condition>
</target>
<target name='jnicompile_temp'>
<delete file="${build.dir}/org_voltdb_jni_ExecutionEngine.h"/>
<delete file="${build.dir}/org_voltdb_utils_DBBPool.h" />
<javah
classpathref="project.classpath"
force="yes"
verbose="yes"
class="org.voltdb.jni.ExecutionEngine"
destdir="${build.dir}"
/>
<javah
classpathref="project.classpath"
force="yes"
verbose="yes"
class="org.voltdb.utils.DBBPool"
destdir="${build.dir}"
/>
<javah
classpathref="project.classpath"
force="yes"
verbose="yes"
class="org.voltdb.utils.ThreadUtils"
destdir="${build.dir}"
/>
</target>
<target name="eecheck" depends="ee, eecheck-build"
description="Build and execute testcases for C++ JNI library.">
</target>
<target name="eecheck-build"
description="Quickly build the testcases for C++ JNI library.">
<exec dir='.' executable='python' failonerror='true'>
<env key='M1CATALOG_PATH' value='${m1catalog}' />
<env key="TEST_DIR" value="${build.testobjects.dir}" />
<arg line="build.py ${build} test" />
</exec>
</target>
<target name='voltdbipc' depends="ee"
description="Build the IPC client.">
<exec dir='.' executable='python' failonerror='true'>
<arg line="build.py ${build} voltdbipc" />
</exec>
</target>
<target name='ee' depends="buildinfo, jnicompile, berkeleydb.compile, ee-build"
description="Build C++ JNI library and copy it to production folder.">
<!-- <exec dir='.' executable='/bin/sh'>
<arg line="-c 'rm -f ${build.dir}/nativelibs/libvoltdb.so'"/>
</exec>
<symlink link="${build.dir}/nativelibs/libvoltdb.so" resource="${build.dir}/nativelibs/libvoltdb-${dist.version}.so" overwrite="true" failonerror="false"/>-->
</target>
<target name="ee-build">
<exec dir='.' executable='python' failonerror='true'>
<arg line="build.py LOG_LEVEL=${site.exec_ee_log_level} ${build}" />
</exec>
</target>
<target name='execplanfrag' depends="ee"
description="Create test program that loads catalog and tables and executes a plan fragment.">
<exec dir='.' executable='python' failonerror='true'>
<arg line="build.py EXECPLANFRAG ${build}" />
</exec>
</target>
<!--
******************************************************************************
TEST CASES
******************************************************************************
-->
<target name="pythonfser" description="run python fastserializer tests">
<property name="build.dir.suffix" value="" /> <!-- Default -->
<property name='classpath' refid='project.classpath' />
<property name='echoserver.command' value="java
-Djava.library.path=${build.dir}${build.dir.suffix}/nativelibs -classpath
${classpath} -server -Xmx64m -XX:+AggressiveOpts -ea
org.voltdb.messaging.EchoServer" />
<exec dir='tests/scripts/' executable='python' failonerror='true'>
<arg line="Testfastserializer.py"/>
<arg line='"${echoserver.command}"'/>
</exec>
</target>
<target name='with.emma' description="enable code coverage analysis" >
<!-- set up emma -->
<path id="emma.lib" >
<pathelement location="${thirdpartylib.dir}/emma.jar" />
<pathelement location="${thirdpartylib.dir}/emma_ant.jar" />
</path>
<taskdef resource="emma_ant.properties" classpathref="emma.lib" />
<!-- enable emma -->
<property name="emma.enabled" value="true" />
<!-- instrument the code -->
<property name="emma.dir" location="${build.dir}/emma" />
<mkdir dir="${emma.dir}" />
<emma>
<!-- don't instrument build.test.dir or any non-voltdb code -->
<instr
instrpath="${build.prod.dir}/org/voltdb"
destdir="${build.instr.dir}/org/voltdb"
metadatafile="${emma.dir}/metadata.emma"
merge="true"
/>
</emma>
</target>
<!-- common junit parameters go here -->
<macrodef name='run_junit'>
<attribute name='timeout' default='240000' />
<attribute name='printsummary' default='off' />
<attribute name='showoutput' default='false' />
<element name='tests'/>
<element name='formatters'/>
<sequential>
<mkdir dir='${build.testoutput.dir}' />
<delete includeemptydirs="true" failonerror='false'>
<fileset dir="${build.testobjects.dir}" includes="*.jar" />
</delete>
<junit
fork="yes"
haltonfailure="${junit.haltonfailure}"
failureproperty="junit.failures"
printsummary="@{printsummary}"
timeout="@{timeout}"
maxmemory='2600M'
showoutput="@{showoutput}"
>
<classpath refid='project.classpath' />
<jvmarg value="-Djava.library.path=${build.dir}/nativelibs" />
<jvmarg value="-server" />
<jvmarg value="-Xcheck:jni" />
<jvmarg value="-Xmx2600m"/>
<jvmarg value="-XX:+HeapDumpOnOutOfMemoryError"/>
<env key="ENABLE_JAR_REUSE" value="${junit.reusejars}"/>
<env key="VOLTDB_BUILD_DIR" value="${build.dir}"/>
<env key="TEST_DIR" value="${build.testobjects.dir}" />
<env key="VOLT_REGRESSIONS" value="${regressions}" />
<!-- Following two env vars are used by Java code
when running ant check -Dbuild=memcheck
The voltdbipc client is used in concert with valgrind
for most tests (those that would normally run against
the single process JNI backend. -->
<env key="BUILD" value="${build}" />
<env key="VOLTDBIPC_PATH" value="${build.prod.dir}/voltdbipc" />
<!-- Brown Benchmark Parameters -->
<!-- <env key="TPCE_LOADER_FILES" value="${src.tpce.dir}" /> -->
<env key="AIRLINE_DATA_DIR" value="${src.test.dir}/edu/brown/benchmark/airline/data" />
<!-- code coverage output settings, harmless if not in use -->
<jvmarg value="-Demma.coverage.out.file=${emma.dir}/coverage.emma" />
<jvmarg value="-Demma.coverage.out.merge=true" />
<!-- -->
<formatters/>
<batchtest todir="${build.testoutput.dir}">
<tests/>
</batchtest>
<assertions><enable/></assertions>
</junit>
</sequential>
</macrodef>
<!-- A set of junit tests that only run on hudson and have an extended timeout -->
<!-- Run this before junit to pick up these tests in the reporting -->
<target name="junit-hudson">
<run_junit timeout="900000" printsummary="yes">
<formatters>
<formatter type="xml" />
</formatters>
<tests>
<fileset dir='${build.test.dir}'>
<!-- currently empty! -->
</fileset>
</tests>
</run_junit>
</target>
<target name="junit-getfiles.check">
<available property="junit-getfiles.exists" file="${files.dir}" />
</target>
<!-- Fetch the files that we need to run the full tests -->
<target name="junit-getfiles"
description="Fetch the files that we need to run junit-full"
depends="junit-getfiles.check"
unless="junit-getfiles.exists">
<exec dir="${tools.dir}" executable="./getfiles.py">
<arg line="--copy=${localcopy}" />
<arg line="--symlink=${symlink}" />
<arg line="${files.dir}" />
</exec>