-
Notifications
You must be signed in to change notification settings - Fork 467
/
build.xml
1988 lines (1813 loc) · 74.8 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" ?>
<project default="default" name="VoltDB">
<!-- 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>
<macrodef name="invoke-javac">
<attribute name="srcdir"/>
<attribute name="destdir" default="${build.prod.dir}"/>
<attribute name="excludes" default=""/>
<sequential>
<javac
target="1.6"
source="1.6"
srcdir="@{srcdir}"
destdir="@{destdir}"
excludes="@{excludes}"
encoding='UTF-8'
debug='true'>
<classpath refid="project.classpath" />
</javac>
</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" />
<!-- allow env.VOLTPRO to override "voltpro" property -->
<condition property="voltpro" value="${env.VOLTPRO}">
<isset property="env.VOLTPRO"/>
</condition>
<!-- stub the voltpro classpath fileset so a fileset with this id always exists -->
<fileset id="voltpro.classpath" file="build.xml">
<exclude name="build.xml"/>
</fileset>
<!-- import the pro build.xml if it exists and is requested -->
<import file="${voltpro}/build.xml" optional="true"/>
<property name='base.dir' location='.' />
<property name='build.dir' location='obj/${build}' />
<property name='build.prod.dir' location='${build.dir}/prod' />
<property name='build.test.dir' location='${build.dir}/test' />
<property name='raw.dist.dir' location='${build.dir}' />
<property name='dist.dir' location='${build.dir}/dist' />
<property name='dist.examples.dir' location='${dist.dir}/examples' />
<property name='doc.dir' location='doc' />
<property name='src.gpl.dir' location='src/frontend' />
<property name='src.hsqldb.dir' location='src/hsqldb19b3' />
<property name='src.test.dir' location='tests/frontend' />
<property name='src.hsqldb.test.dir' location='tests/hsqldb' />
<property name='src.studio.dir' location='src/frontend/org/voltdb/studio' />
<property name='build.testoutput.dir' location='${build.dir}/testoutput' />
<property name='build.testobjects.dir' location='${build.dir}/testobjects' />
<property name='lib.dir' location='lib' />
<property name='vendor.lib.dir' location='third_party/java/jars' />
<property name='vendor.src.dir' location='third_party/java/src' />
<property name='src.ee.parent.dir' location='src/ee' />
<property name='src.ee.dir' location='src/ee' />
<property name='src.catalog.dir' location='src/catgen' />
<property name='m1catalog' location='${src.test.dir}/org/voltdb/catalog/catalog.txt' />
<property name='depcache' value='.depcache' />
<!-- emma build instrumentation location -->
<property name='build.instr.dir' location='${build.dir}/instr' />
<!-- 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="2048">
<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://download.oracle.com/javase/6/docs/api/"/>
<path id='project.classpath'>
<pathelement location='${build.instr.dir}' />
<pathelement location='${build.prod.dir}' />
<pathelement location='${build.test.dir}' />
<fileset dir='${lib.dir}'>
<include name='*.jar' />
</fileset>
<fileset dir='${vendor.lib.dir}'>
<include name='*.jar' />
<exclude name='ant.jar' />
</fileset>
<pathelement path="${java.class.path}"/>
<fileset refid="voltpro.classpath"/>
</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>
<!-- cluster machine names -->
<macrodef name="nexthosthelper">
<attribute name="h1" />
<attribute name="h2" />
<attribute name="p1" />
<attribute name="p2" />
<sequential>
<condition property="@{p2}" value="@{h2}">
<equals arg1="${@{p1}}" arg2="@{h1}" />
</condition>
</sequential>
</macrodef>
<macrodef name="nexthostprop">
<attribute name="prop" />
<attribute name="next" />
<sequential>
<nexthosthelper h1="volt3a" h2="volt3b" p1="@{prop}" p2="@{next}" />
<nexthosthelper h1="volt3b" h2="volt3c" p1="@{prop}" p2="@{next}" />
<nexthosthelper h1="volt3c" h2="volt3d" p1="@{prop}" p2="@{next}" />
<nexthosthelper h1="volt3d" h2="volt3e" p1="@{prop}" p2="@{next}" />
<nexthosthelper h1="volt3e" h2="volt3f" p1="@{prop}" p2="@{next}" />
<nexthosthelper h1="volt3f" h2="volt3g" p1="@{prop}" p2="@{next}" />
<nexthosthelper h1="volt3g" h2="volt3h" p1="@{prop}" p2="@{next}" />
<nexthosthelper h1="volt3h" h2="volt3i" p1="@{prop}" p2="@{next}" />
<nexthosthelper h1="volt3i" h2="volt3j" p1="@{prop}" p2="@{next}" />
<nexthosthelper h1="volt3j" h2="volt3k" p1="@{prop}" p2="@{next}" />
<nexthosthelper h1="volt3k" h2="volt3l" p1="@{prop}" p2="@{next}" />
<nexthosthelper h1="volt4a" h2="volt4b" p1="@{prop}" p2="@{next}" />
<nexthosthelper h1="volt4b" h2="volt4c" p1="@{prop}" p2="@{next}" />
<nexthosthelper h1="volt4c" h2="volt2" p1="@{prop}" p2="@{next}" />
<nexthosthelper h1="volt2" h2="volt1" p1="@{prop}" p2="@{next}" />
<nexthosthelper h1="volt1" h2="volt5a" p1="@{prop}" p2="@{next}" />
<nexthosthelper h1="volt5a" h2="volt5b" p1="@{prop}" p2="@{next}" />
<nexthosthelper h1="volt5b" h2="volt5c" p1="@{prop}" p2="@{next}" />
<nexthosthelper h1="volt5c" h2="volt5d" p1="@{prop}" p2="@{next}" />
<nexthosthelper h1="volt5d" h2="volt5e" p1="@{prop}" p2="@{next}" />
</sequential>
</macrodef>
<envdefault prop="host1" var="FIRSTSERVER" default="volt3a" />
<nexthostprop prop="host1" next="host2" />
<nexthostprop prop="host2" next="host3" />
<nexthostprop prop="host3" next="host4" />
<nexthostprop prop="host4" next="host5" />
<nexthostprop prop="host5" next="host6" />
<nexthostprop prop="host6" next="host7" />
<nexthostprop prop="host7" next="host8" />
<nexthostprop prop="host8" next="host9" />
<nexthostprop prop="host9" next="host10" />
<nexthostprop prop="host10" next="host11" />
<nexthostprop prop="host11" next="host12" />
<envdefault prop="clienthost1" var="FIRSTCLIENT" default="volt4a" />
<nexthostprop prop="clienthost1" next="clienthost2" />
<nexthostprop prop="clienthost2" next="clienthost3" />
<nexthostprop prop="clienthost3" next="clienthost4" />
<nexthostprop prop="clienthost4" next="clienthost5" />
<nexthostprop prop="clienthost5" next="clienthost6" />
<nexthostprop prop="clienthost6" next="clienthost7" />
<nexthostprop prop="clienthost7" next="clienthost8" />
<nexthostprop prop="clienthost8" next="clienthost9" />
<nexthostprop prop="clienthost9" next="clienthost10" />
<target name="testnexthostprop">
<fail>
<condition>
<not>
<and>
<equals arg1="${host12}" arg2="volt3l" />
<equals arg1="${clienthost5}" arg2="volt1" />
</and>
</not>
</condition>
</fail>
</target>
<!--
***************************************
PRIMARY ENTRY POINTS
***************************************
-->
<target name="default"
depends="compile, ee, voltdb.jar"
description="Compile Java classes and C++ JNI library."
/>
<target name="check"
depends="compile, licensecheck, voltdbipc, ee"
description="Run Java and C++ JNI testcases and test plan fragments." >
<condition property="timeoutLength" value="${timeoutLength}" else='1800000'>
<isset property="timeoutLength"/>
</condition>
<exec executable="/usr/bin/ant" failonerror="true" timeout="9000000">
<arg value="eecheck" />
<arg value="junit" />
<arg value="distcheck" />
<arg value="pythonfser" />
<arg value="ant_unit_tests" />
<arg value="-Dbuild=${build}" />
<arg value="-DtimeoutLength=${timeoutLength}" />
<arg value="-DVOLT_REGRESSIONS=${VOLT_REGRESSIONS}" />
</exec>
</target>
<target name="newcheck"
depends="licensecheck,compile, voltdbipc"
description="Run Java and C++ JNI testcases and test plan fragments." >
<condition property="timeoutLength" value="${timeoutLength}" else='1800000'>
<isset property="timeoutLength"/>
</condition>
<mkdir dir='${build.dir}/testrunner/' />
<copy todir='${build.dir}/testrunner/'>
<fileset dir="tests/testrunner">
<exclude name="**/.svn" />
</fileset>
</copy>
<exec executable="/bin/sh"
failonerror="true"
timeout="1800000"
dir="${build.dir}"
newenvironment='true'>
<arg value="testrunner/test.py" />
</exec>
</target>
<target name="check_quick"
depends="compile, voltdbipc"
description="Run a subset of Java testcases and test fragments." >
<condition property="timeoutLength" value="${timeoutLength}" else='480000'>
<isset property="timeoutLength"/>
</condition>
<exec executable="/usr/bin/ant" failonerror="true" timeout="1800000">
<arg value="licensecheck" />
<arg value="junit_quick" />
<arg value="distcheck" />
<arg value="ant_unit_tests" />
<arg value="-Dbuild=${build}" />
<arg value="-DtimeoutLength=${timeoutLength}" />
<arg value="-DVOLT_REGRESSIONS=${VOLT_REGRESSIONS}" />
</exec>
</target>
<target name="quarantine"
depends="compile, ee"
description="Run quarantined tests." >
<condition property="timeoutLength" value="${timeoutLength}" else='480000'>
<isset property="timeoutLength"/>
</condition>
<exec executable="/usr/bin/ant" failonerror="true" timeout="1800000">
<arg value="junit_quarantine" />
<arg value="-Dbuild=${build}" />
<arg value="-DtimeoutLength=${timeoutLength}" />
<arg value="-DVOLT_REGRESSIONS=${VOLT_REGRESSIONS}" />
</exec>
</target>
<target name="all"
depends="compile, ee, junit, eecheck, javadoc, jars"
description="Do all tasks."
/>
<target name="jars"
depends="voltdb.jar, voltdbfat.jar, voltdbclient.jar"
description="Create production JAR files."
/>
<target name="dist"
depends="dist_client, dist_internal, dist_voltcache, dist_voltkv"
description="Create VoltDB release packages with examples and documentation."
/>
<target name="dist_voltcache" depends="dist_internal"
description="Create VoltDB release package with VoltCache reference app.">
<refapp_macro appname="voltcache" />
</target>
<target name="dist_voltkv" depends="dist_internal"
description="Create VoltDB release package with VoltKV reference app.">
<refapp_macro appname="voltkv" />
</target>
<target name="dist_refapp" depends="dist_internal"
description="Create reference application release package with app supplied in ant invocation.">
<fail unless="appname" message="must specify an app name with -Dappname=" />
<refapp_macro appname="${appname}" />
</target>
<!--
***************************************
DISTRIBUTION
***************************************
-->
<macrodef name="voltbin-macro">
<sequential>
<mkdir dir="${build.dir}/voltbin" />
<copy todir="${build.dir}/voltbin" flatten="true">
<fileset dir="${build.dir}" defaultexcludes="yes">
<include name="nativelibs/libvoltdb*" />
<include name="prod/voltdbfat.jar" />
</fileset>
</copy>
<!-- use cp to preserve permissions -->
<exec dir="tools" executable="cp" failonerror="true">
<arg line="getmac.py"/>
<arg line="killstragglers.sh"/>
<arg line="${build.dir}/voltbin"/>
</exec>
<!-- populate the logging configuration files -->
<copy tofile="${build.dir}/voltbin/log4j.properties" file="voltdb/log4j.properties"/>
<copy tofile="${build.dir}/voltbin/log4j.xml" file="voltdb/log4j.xml"/>
</sequential>
</macrodef>
<target name="voltbin" depends="compile, ee, jars">
<voltbin-macro/>
<!-- strip the voltbin shared library (~40x size reduction) -->
<exec dir='${build.dir}/voltbin' executable='/bin/sh'>
<arg line="-c '/usr/bin/strip -x libvoltdb*'"/>
</exec>
</target>
<target name="voltbin_profile" depends="compile, ee_profile, jars">
<voltbin-macro/>
</target>
<target name="voltbin_copy" depends="compile,ee,jars">
<voltbin-macro/>
<!-- copy the voltbin contents to $HOME/voltbin -->
<exec dir="${build.dir}" executable='/bin/sh'>
<arg line="-c 'cp voltbin/* $HOME/voltbin/'"/>
</exec>
</target>
<target name="javadoc">
<!-- populate selected server/compiler javadoc documentation -->
<javadoc
destdir="doc/javadoc/procedure-api"
Public="true"
version="true"
use="true"
nodeprecated="true"
Overview='${src.gpl.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="doc/javadoc/java-client-api"
access="protected"
version="true"
use="true"
nodeprecated="true"
Overview='${src.gpl.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" />
<include name="src/frontend/org/voltdb/client/StatsUploaderSettings.java" />
<include name="src/frontend/org/voltdb/client/exampleutils/*.java" />
</fileset>
</javadoc>
</target>
<target name="dist_internal" depends="compile, ee, javadoc, voltdb.jar, voltdbclient.jar">
<!-- prepare release directory for new content -->
<delete includeemptydirs="true" failonerror='false'>
<fileset dir="${dist.dir}" includes="**/*" />
</delete>
<mkdir dir="${dist.dir}" />
<!-- populate the doc dir -->
<copy todir="${dist.dir}/">
<fileset dir="." defaultexcludes="yes">
<include name="Click Here to Start.html"/>
<include name="README"/>
<include name="README.thirdparty"/>
<include name="LICENSE"/>
<include name="bin/**"/>
<include name="doc/**"/>
<include name="examples/**"/>
<include name="lib/**"/>
<include name="tools/demo/**"/>
<include name="tools/sqlcmd/**"/>
<include name="voltdb/**"/>
<exclude name=".gitignore"/>
</fileset>
</copy>
<!-- populate java and native libraries -->
<copy todir="${dist.dir}/voltdb" flatten="true" >
<fileset dir="voltdb" defaultexcludes="yes">
<include name="voltdb-${dist.version}.jar" />
<include name="voltdbclient-${dist.version}.jar" />
</fileset>
</copy>
<copy todir="${dist.dir}/voltdb" flatten="true" >
<fileset dir="${build.dir}" defaultexcludes="yes">
<include name="nativelibs/libvoltdb*" />
</fileset>
</copy>
<!-- save the symbols from the shared library -->
<exec dir='${dist.dir}/voltdb' executable='/bin/sh'>
<arg line="-c '/usr/bin/objcopy --only-keep-debug libvoltdb-${dist.version}.so ${build.dir}/voltdb-${dist.version}.sym'" />
</exec>
<!-- strip the voltbin shared library (~40x size reduction) -->
<exec dir='${dist.dir}/voltdb' executable='/bin/sh'>
<arg line="-c '/usr/bin/strip --strip-debug --strip-unneeded libvoltdb*'"/>
</exec>
<!-- embed the path to the symbol file into the ELF binary -->
<exec dir='${dist.dir}/voltdb' executable='/bin/sh'>
<arg line="-c '/usr/bin/objcopy --add-gnu-debuglink=voltdb-${dist.version}.sym libvoltdb-${dist.version}.so'" />
</exec>
<!-- copy studio.web -->
<mkdir dir="${dist.dir}/tools/studio.web" />
<copy todir="${dist.dir}/tools/studio.web">
<fileset dir="${src.gpl.dir}/org/voltdb/studio" defaultexcludes="yes">
<include name="**"/>
</fileset>
</copy>
<!-- 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" />
<!-- add the Project and Deployment file schemas to the dist -->
<copy todir="${dist.dir}/tools" file="src/frontend/org/voltdb/compiler/ProjectFileSchema.xsd"/>
<copy todir="${dist.dir}/tools" file="src/frontend/org/voltdb/compiler/DeploymentFileSchema.xsd"/>
<!-- copy license to voltdb dir -->
<copy todir="${dist.dir}/voltdb" file="LICENSE"/>
<!-- make shell scripts executable -->
<chmod perm="ugo+rx">
<fileset dir="${dist.dir}" defaultexcludes="yes">
<include name="bin/*"/>
<include name="tools/demo/launch"/>
<include name="doc/tutorials/**/run.sh"/>
<include name="examples/**/run.sh"/>
<include name="tools/generate"/>
<include name="tools/sqlcmd/sqlcmd"/>
</fileset>
</chmod>
<!-- create an archive for distribution -->
<exec executable="mv" failonerror="true">
<arg value="${raw.dist.dir}/dist"/>
<arg value="${raw.dist.dir}/voltdb-${dist.version}"/>
</exec>
<exec executable="tar" failonerror="true">
<arg value="-cz"/>
<arg value="-C"/>
<arg value="${raw.dist.dir}"/>
<arg value="-f"/>
<arg value="${raw.dist.dir}/voltdb-${dist.version}.tar.gz"/>
<arg value="voltdb-${dist.version}"/>
</exec>
<!-- move it back to dist directory for downstream dependencies -->
<exec executable="mv" failonerror="true">
<arg value="${raw.dist.dir}/voltdb-${dist.version}"/>
<arg value="${raw.dist.dir}/dist"/>
</exec>
<!-- package up studio web trivially -->
<zip destfile="${raw.dist.dir}/voltdb-studio.web-${dist.version}.zip">
<fileset dir="${src.studio.dir}" defaultexcludes="yes">
<include name="**/*" />
</fileset>
</zip>
</target>
<target name="dist_client" depends="dist_internal"
description="Hacky Java client package target">
<!-- prepare release directory for new content -->
<delete includeemptydirs="true" failonerror='false'>
<fileset dir="${dist.dir}-client-java" includes="**/*" />
</delete>
<mkdir dir="${dist.dir}-client-java" />
<!-- populate the dist-client-java dir from the superset dist -->
<copy todir="${dist.dir}-client-java/">
<fileset dir="${dist.dir}/" defaultexcludes="yes">
<include name="**/*"/>
<exclude name=".gitignore"/>
<exclude name="bin/"/>
<exclude name="voltdb/libvoltdb*"/>
<exclude name="voltdb/voltdb-*.jar"/>
</fileset>
</copy>
<!-- make shell scripts executable -->
<chmod perm="ugo+rx">
<fileset dir="${dist.dir}-client-java/" defaultexcludes="yes">
<include name="tools/demo/launch"/>
<include name="doc/tutorials/auction/run.sh"/>
<include name="doc/tutorials/helloworld/run.sh"/>
<include name="examples/voltcache/run.sh"/>
<include name="examples/voltkv/run.sh"/>
<include name="examples/voter/run.sh"/>
<include name="tools/generate"/>
<include name="tools/sqlcmd/sqlcmd"/>
</fileset>
</chmod>
<!-- create an archive for distribution -->
<exec executable="mv" failonerror="true">
<arg value="${raw.dist.dir}/dist-client-java"/>
<arg value="${raw.dist.dir}/voltdb-client-java-${dist.version}"/>
</exec>
<exec executable="tar" failonerror="true">
<arg value="-cz"/>
<arg value="-C"/>
<arg value="${raw.dist.dir}"/>
<arg value="-f"/>
<arg value="${raw.dist.dir}/voltdb-client-java-${dist.version}.tar.gz"/>
<arg value="voltdb-client-java-${dist.version}"/>
</exec>
<!-- move it back to dist directory for downstream dependencies -->
<exec executable="mv" failonerror="true">
<arg value="${raw.dist.dir}/voltdb-client-java-${dist.version}"/>
<arg value="${raw.dist.dir}/dist-client-java"/>
</exec>
</target>
<macrodef name="refapp_macro"
description="Build a kit that only includes a single reference app">
<attribute name="appname"/>
<sequential>
<!-- prepare release directory for new content -->
<delete includeemptydirs="true" failonerror='false'>
<fileset dir="${dist.dir}-@{appname}" includes="**/*" />
</delete>
<mkdir dir="${dist.dir}-@{appname}" />
<mkdir dir="${dist.dir}-@{appname}/@{appname}" />
<!-- populate the examples -->
<copy todir="${dist.dir}-@{appname}/@{appname}">
<fileset dir="${dist.dir}/examples/@{appname}" defaultexcludes="yes">
<include name="**/*"/>
<exclude name=".gitignore"/>
</fileset>
</copy>
<!-- populate the bin/lib/voltdb/etc... dirs -->
<copy todir="${dist.dir}-@{appname}" >
<fileset dir="${dist.dir}" defaultexcludes="yes">
<include name="README" />
<include name="LICENSE" />
<include name="README.thirdparty" />
<include name="voltdb/**" />
<include name="lib/**" />
<include name="bin/**" />
</fileset>
</copy>
<!-- rewrite the run.sh script's relative directories -->
<replace
file="${dist.dir}-@{appname}/@{appname}/run.sh"
token="../../"
value="../"/>
<!-- make shell scripts executable -->
<chmod perm="ugo+rx">
<fileset dir="${dist.dir}-@{appname}" defaultexcludes="yes">
<include name="bin/*"/>
<include name="@{appname}/run.sh"/>
</fileset>
</chmod>
<!-- create an archive for distribution -->
<exec executable="mv" failonerror="true">
<arg value="${raw.dist.dir}/dist-@{appname}"/>
<arg value="${raw.dist.dir}/voltdb-@{appname}-${dist.version}"/>
</exec>
<exec executable="tar" failonerror="true">
<arg value="-cz"/>
<arg value="-C"/>
<arg value="${raw.dist.dir}"/>
<arg value="-f"/>
<arg value="${raw.dist.dir}/voltdb-@{appname}-${dist.version}.tar.gz"/>
<arg value="voltdb-@{appname}-${dist.version}"/>
</exec>
<!-- move it back to dist directory for downstream dependencies -->
<exec executable="mv" failonerror="true">
<arg value="${raw.dist.dir}/voltdb-@{appname}-${dist.version}"/>
<arg value="${raw.dist.dir}/dist-@{appname}"/>
</exec>
</sequential>
</macrodef>
<!--
***************************************
CLEANING
***************************************
-->
<target name='clean' description="Remove all compiled files." depends="cleantmp">
<exec dir='examples/voter' executable='/usr/bin/env'><arg line="bash run.sh clean"/></exec>
<exec dir='examples/voltcache' executable='/usr/bin/env'><arg line="bash run.sh clean"/></exec>
<exec dir='examples/voltkv' executable='/usr/bin/env'><arg line="bash run.sh clean"/></exec>
<exec dir='doc/tutorials/auction' executable='/usr/bin/env'><arg line="bash run.sh clean"/></exec>
<exec dir='doc/tutorials/helloworld' executable='/usr/bin/env'><arg line="bash run.sh clean"/></exec> <exec dir='.' executable='/bin/sh'>
<arg line="-c 'rm -rf obj/*'"/>
</exec>
<exec dir='.' executable='/bin/sh'>
<arg line="-c 'rm -rf voltdb/*.jar'"/>
</exec>
<exec dir='.' executable='/bin/sh'>
<arg line="-c 'rm -rf voltdb/*.so'"/>
</exec>
<exec dir='.' executable='/bin/sh'>
<arg line="-c 'rm -rf src/ee/catalog/*'"/>
</exec>
<exec dir='.' executable='/bin/sh'>
<arg line="-c 'rm -rf src/frontend/org/voltdb/catalog/*.java'"/>
</exec>
<exec dir='.' executable='/bin/sh'>
<arg line="-c 'rm -rf *.jar'"/>
</exec>
<exec dir='.' executable='/bin/sh'>
<arg line="-c 'rm -rf doc/javadoc/procedure-api/* doc/javadoc/java-client-api/*'"/>
</exec>
</target>
<target name='cleantmp' description="Remove all data files Volt generated in /tmp.">
<exec dir='.' executable='/bin/sh' failonerror='false'>
<arg line="-c 'rm -rf /tmp/myApp*.tmp *.vpt *.digest'"/>
</exec>
</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="voltdb.jar" depends="compile, buildinfo">
<jar destfile="voltdb/voltdb-${dist.version}.jar">
<fileset dir="${build.prod.dir}" defaultexcludes="yes" >
<include name="org/voltdb/**" />
<include name="org/hsqldb_voltpatches/**" />
<include name="org/eclipse/jetty_voltpatches/**" />
<include name="javax/servlet_voltpatches/**" />
<include name="au/com/bytecode/opencsv_voltpatches/**" />
<include name="org/hsqldb_voltpatches/**" />
<include name="org/json_voltpatches/**" />
<include name="org/apache/jute_voltpatches/**" />
<include name="org/apache/zookeeper_voltpatches/**" />
</fileset>
<fileset dir="${build.test.dir}" defaultexcludes="yes" >
<include name="org/voltdb/ServerThread.class" />
<include name="org/voltdb/benchmark/*" />
<include name="org/voltdb/regressionsuites/Local*" />
<include name="org/voltdb/regressionsuites/MultiConfigSuiteBuilder.class" />
<include name="org/voltdb/regressionsuites/RegressionSuite.class" />
<include name="org/voltdb/regressionsuites/VoltServerConfig.class" />
</fileset>
<fileset dir="."><include name="buildstring.txt"/></fileset>
<manifest>
<section name="Credits">
<attribute name="Author" value="VoltDB Inc." />
</section>
<section name="Shared">
<attribute
name="Title"
value="VoltDB compiler, server, and client interface libraries"
/>
<attribute name="Date" value="${TODAY}" />
</section>
</manifest>
</jar>
</target>
<target name="voltdbclient.jar" depends="compile, buildinfo">
<jar destfile="voltdb/voltdbclient-${dist.version}.jar">
<fileset dir="${build.prod.dir}" defaultexcludes="yes" >
<include name="org/voltdb/**" />
<include name="org/json_voltpatches/**" />
</fileset>
<fileset dir="."><include name="buildstring.txt"/></fileset>
<manifest>
<section name="Credits">
<attribute name="Author" value="VoltDB Inc." />
</section>
<section name="Shared">
<attribute
name="Title"
value="VoltDB client interface libraries"
/>
<attribute name="Date" value="${TODAY}" />
</section>
</manifest>
</jar>
</target>
<target name="voltdbthin.jar" depends="compile"
description="used by testability-explorer">
<jar destfile="${build.prod.dir}/voltdbthin.jar">
<fileset dir="${build.prod.dir}" defaultexcludes="yes" >
<include name="org/voltdb/**" />
</fileset>
</jar>
</target>
<target name="voltdbfat.jar" depends="compile, buildinfo">
<jar destfile="${build.prod.dir}/voltdbfat.jar">
<fileset dir="${build.prod.dir}" defaultexcludes="yes" >
<include name="org/voltdb/**" />
<include name="org/hsqldb_voltpatches/**" />
<include name="org/eclipse/jetty_voltpatches/**" />
<include name="org/opencsv_voltpatches/**" />
<include name="javax/servlet_voltpatches/**" />
<include name="org/json_voltpatches/**" />
<include name="org/apache/jute_voltpatches/**" />
<include name="org/apache/zookeeper_voltpatches/**" />
</fileset>
<fileset dir="${build.test.dir}" defaultexcludes="no" >
<include name="org/voltdb/**" />
</fileset>
<fileset dir="${src.gpl.dir}" defaultexcludes="yes" >
<include name="org/voltdb/**" />
</fileset>
<fileset dir="${src.test.dir}" defaultexcludes="yes" >
<include name="org/voltdb/**" />
</fileset>
<fileset dir="."><include name="buildstring.txt"/></fileset>
<manifest>
<section name="Credits">
<attribute name="Author" value="VoltDB Inc." />
</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="catalog, compile_core, compile_pro"
description="Compile all Java source and test classes"/>
<target name="compile_core">
<mkdir dir='${build.prod.dir}' />
<mkdir dir='${build.test.dir}' />
<exec
dir='${src.gpl.dir}/org/voltdb/utils'
executable='${src.gpl.dir}/org/voltdb/utils/generate_logkeys.py'
failonerror='true' />
<depend
srcdir="${src.hsqldb.dir}:${src.hsqldb.test.dir}:${src.gpl.dir}:${src.test.dir}:${vendor.src.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.gpl.dir}" includes="**/*.properties"/>
<fileset dir="${src.gpl.dir}" includes="**/*.xml" />
<fileset dir="${src.gpl.dir}" includes="**/admintemplate.html" />
</copy>
<copy todir='${build.prod.dir}/org/hsqldb_voltpatches/resources'>
<fileset dir="${src.hsqldb.dir}/org/hsqldb_voltpatches/resources">
<include name="*"/>
</fileset>
</copy>
<copy todir='${build.prod.dir}/org/voltdb/studio'>
<fileset dir="${src.gpl.dir}/org/voltdb/studio">
<include name="**"/>
</fileset>
</copy>
<!-- README files we want to include in the jar -->
<copy flatten='false' todir='${build.prod.dir}'>
<fileset dir="${src.gpl.dir}">
<include name="**/*Readme.txt"/>
</fileset>
</copy>
<!-- pick src//** schemas as package resources -->
<copy flatten='false' todir="${build.prod.dir}">
<fileset dir="${src.gpl.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.test.dir}'>
<fileset dir="${src.test.dir}">
<include name="**/*.sql"/>
</fileset>
</copy>
<!-- Compressed resources for tests -->
<copy flatten='false' todir='${build.test.dir}'>
<fileset dir="${src.test.dir}">
<include name="**/*.tar.gz"/>
</fileset>
</copy>
<!-- copy file containing workloads for voltdbfat.jar -->
<copy flatten='false' todir='${build.test.dir}'>
<fileset dir="${src.test.dir}">
<include name="**/microbench.xml"/>
</fileset>
</copy>
<copy todir='${build.test.dir}/org/hsqldb_voltpatches'>
<fileset dir="${src.hsqldb.test.dir}/org/hsqldb_voltpatches">
<include name="*.sql"/>
</fileset>
</copy>
<!-- compile the individual source directories -->
<invoke-javac srcdir="${src.hsqldb.dir}"/>
<invoke-javac srcdir="${src.gpl.dir}:${vendor.src.dir}"/>
<!-- compile the individual test directories -->
<invoke-javac srcdir="${src.hsqldb.test.dir}" destdir='${build.test.dir}'/>
<invoke-javac srcdir="${src.test.dir}" destdir='${build.test.dir}'
excludes="org/voltdb/benchmark/tpcc/JDBCClient.java"/>
</target>
<!-- This task only executes if the voltpro.flavor property is set. -->
<target name="compile_pro" if="voltpro.flavor">
<antcall target="voltpro.compile"/>
</target>
<!--
***************************************
NATIVE EE STUFF
***************************************
-->
<target name='catalog'
description="Generate catalog source code.">
<exec dir="${src.catalog.dir}" executable='python' failonerror='true'>
<arg line="catalog.py"/>
</exec>
<exec dir="${src.catalog.dir}" executable='python' failonerror='true'>
<arg line="install.py"/>
</exec>
</target>
<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" />
<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}'
/>
</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"
/>
</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}"
/>
</target>
<target name="eecheck" depends="ee"
description="Run 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}" />
<env key="EETESTSUITE" value="${eetestsuite}"/>
<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="catalog, jnicompile, buildinfo"
description="Build C++ JNI library and copy it to production folder.">
<exec dir='.' executable='python' failonerror='true'>