forked from pettermahlen/voltdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
2321 lines (2094 loc) · 87.2 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=""/>
<attribute name="includes" default=""/>
<sequential>
<javac
target="1.7"
source="1.7"
srcdir="@{srcdir}"
destdir="@{destdir}"
excludes="@{excludes}"
includes="@{includes}"
encoding='UTF-8'
debug='true'
includeAntRuntime='false'>
<classpath refid="project.classpath" />
</javac>
</sequential>
</macrodef>
<!-- PATHS AND PROPERTIES -->
<tstamp/>
<!-- 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" />
<envdefault prop="jmemcheck" var="JMEMCHECK" default="memcheck" />
<!-- allow env.VOLTPRO to override "voltpro" property -->
<condition property="voltpro" value="${env.VOLTPRO}">
<isset property="env.VOLTPRO"/>
</condition>
<!-- stub the voltpro classpath and src.dir fileset so a fileset with this id always exists -->
<fileset id="voltpro.classpath" file="." excludes="**"/>
<fileset id="voltpro.src.dir" file="." excludes="**"/>
<!-- 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='build.testproc.dir' location='${build.dir}/testprocs' />
<property name='build.client.dir' location='${build.dir}/clientobj' />
<property name='build.admin.dir' location='${build.dir}/admin' />
<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.testproc.dir' location='tests/testprocs' />
<property name='src.hsqldb.test.dir' location='tests/hsqldb' />
<property name='src.ee.test.dir' location='tests/ee' />
<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='vendor.cpp.dir' location='third_party/cpp' />
<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='depcache' value='.depcache' />
<property name='project.parsergen.dir' location='${src.gpl.dir}/org/voltdb/compiler/projectfile' />
<property name='project.parsergen.pkg' value='org.voltdb.compiler.projectfile' />
<property name='project.parsergen.xsd' value='org/voltdb/compiler/ProjectFileSchema.xsd' />
<property name='deployment.parsergen.dir' location='${src.gpl.dir}/org/voltdb/compiler/deploymentfile' />
<property name='deployment.parsergen.pkg' value='org.voltdb.compiler.deploymentfile' />
<property name='deployment.parsergen.xsd' value='org/voltdb/compiler/DeploymentFileSchema.xsd' />
<property name='debian.package.dir' value='obj/debian' />
<property name='rpm.package.dir' value='obj/rpms' />
<!-- os.mac is set when build is running on Mac OSX -->
<condition property="os.mac">
<os family="mac"/>
</condition>
<!-- 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>
<!-- Default always round trip DDL in junit. Jenkins will turn this off on master -->
<condition property="verifycatalogdebug" value="true">
<not><isset property="verifycatalogdebug"/></not>
</condition>
<!-- Overridden in the Hudson test script. -->
<property name='junit.haltonfailure' value='false' />
<property name="j2se_api" value="http://docs.oracle.com/javase/7/docs/api/"/>
<path id='project.classpath'>
<pathelement location='${build.instr.dir}' />
<pathelement location='${build.client.dir}' />
<pathelement location='${build.prod.dir}' />
<pathelement location='${build.testproc.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>
<patternset id='junit.exclusions'>
<!--Global exclude list for junit -->
<!-- Exclude nested classes -->
<exclude name="**/*$*.class"/>
<!-- Exclude quarantine -->
<exclude name="org/voltdb/quarantine/**/*.class"/>
<!-- Specifig exclude community tests -->
<exclude name="org/voltdb/regressionsuites/TestMaliciousClientSuite.class" /> <!-- fails legacy -->
<exclude name="org/voltdb/regressionsuites/TestIV2BlacklistSaveRestoreSysprocSuite.class" />
<!-- Recorded as ENG-4423 -->
<exclude name="**/TestRejoinFuzz.class" />
<exclude name="**/TestRejoinFuzz2.class" />
<!-- Specific Excluded pro tests -->
<exclude name="**/TestCommandLogServer.class" />
<exclude name="**/TestCommandLog.class"/>
<exclude name="**/TestPauselessRejoinFuzz.class" /> <!-- fails legacy -->
<exclude name="**/TestExportBase.class"/>
<exclude name="org/voltdb/regressionsuites/TestIV2BlacklistSaveRestoreSysprocSuite.class" /> <!-- fails legacy -->
</patternset>
<patternset id='junit.regression.h1.path'>
<!-- Standard junit fileset -->
<include name='org/voltdb/regressionsuites/TestA*.class' />
<include name='org/voltdb/regressionsuites/TestB*.class' />
<include name='org/voltdb/regressionsuites/TestC*.class' />
<include name='org/voltdb/regressionsuites/TestD*.class' />
<include name='org/voltdb/regressionsuites/TestE*.class' />
<include name='org/voltdb/regressionsuites/TestF*.class' />
<include name='org/voltdb/regressionsuites/TestG*.class' />
<include name='org/voltdb/regressionsuites/TestH*.class' />
<include name='org/voltdb/regressionsuites/TestI*.class' />
<include name='org/voltdb/regressionsuites/TestJ*.class' />
<include name='org/voltdb/regressionsuites/TestK*.class' />
<include name='org/voltdb/regressionsuites/TestL*.class' />
<include name='org/voltdb/regressionsuites/TestM*.class' />
<include name='org/voltdb/regressionsuites/TestN*.class' />
<include name='org/voltdb/regressionsuites/TestO*.class' />
<include name='org/voltdb/regressionsuites/TestP*.class' />
<!-- Exclude tests -->
<patternset refid='junit.exclusions'/>
</patternset>
<patternset id='junit.regression.h2.path'>
<!-- Standard junit fileset -->
<include name='org/voltdb/regressionsuites/TestQ*.class' />
<include name='org/voltdb/regressionsuites/TestR*.class' />
<include name='org/voltdb/regressionsuites/TestS*.class' />
<include name='org/voltdb/regressionsuites/TestT*.class' />
<include name='org/voltdb/regressionsuites/TestU*.class' />
<include name='org/voltdb/regressionsuites/TestV*.class' />
<include name='org/voltdb/regressionsuites/TestW*.class' />
<include name='org/voltdb/regressionsuites/TestX*.class' />
<include name='org/voltdb/regressionsuites/TestY*.class' />
<include name='org/voltdb/regressionsuites/TestZ*.class' />
<!-- Exclude tests -->
<patternset refid='junit.exclusions'/>
</patternset>
<patternset id='junit.all.path'>
<!-- Standard junit fileset -->
<include name='org/hsqldb_voltpatches/**/Test*.class'/>
<include name='org/voltcore/**/Test*.class' />
<include name='org/voltdb/**/Test*.class'/>
<!-- Exclude tests -->
<patternset refid="junit.exclusions"/>
</patternset>
<patternset id='junit.exclude.regression.path'>
<exclude name="org/voltdb/regressionsuites/*.class"/>
</patternset>
<!-- 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="default"
depends="compile, ee, voltdb.jar, voltdbclient.jar"
description="Compile Java classes and C++ JNI library."
/>
<target name="check"
depends="licensecheck, compile, voltdbipc"
description="Run Java and C++ JNI testcases." >
<condition property="timeoutLength" value="${timeoutLength}" else='1800000'>
<isset property="timeoutLength"/>
</condition>
<exec executable="ant" failonerror="true" timeout="9000000">
<arg value="eecheck" />
<arg value="junit" />
<arg value="distcheck" />
<arg value="pythonfser" />
<arg value="-Dbuild=${build}" />
<arg value="-DtimeoutLength=${timeoutLength}" />
<arg value="-DVOLT_REGRESSIONS=${VOLT_REGRESSIONS}" />
<arg value="-DVOLT_ENABLEIV2=${VOLT_ENABLEIV2}" />
</exec>
</target>
<target name="check_noclustering"
depends="licensecheck, compile, voltdbipc"
description="Run Java and C++ JNI testcases that apply to a single node." >
<condition property="timeoutLength" value="${timeoutLength}" else='1800000'>
<isset property="timeoutLength"/>
</condition>
<exec executable="ant" failonerror="true" timeout="9000000">
<arg value="eecheck" />
<arg value="junit_noclustering" />
<arg value="distcheck" />
<arg value="pythonfser" />
<arg value="-Dbuild=${build}" />
<arg value="-DtimeoutLength=${timeoutLength}" />
<arg value="-DVOLT_REGRESSIONS=localhsql" />
<arg value="-DVOLT_ENABLEIV2=${VOLT_ENABLEIV2}" />
</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="ant" failonerror="true" timeout="1800000">
<arg value="licensecheck" />
<arg value="junit_quick" />
<arg value="distcheck" />
<arg value="-Dbuild=${build}" />
<arg value="-DtimeoutLength=${timeoutLength}" />
<arg value="-DVOLT_REGRESSIONS=${VOLT_REGRESSIONS}" />
<arg value="-DVOLT_ENABLEIV2=${VOLT_ENABLEIV2}" />
</exec>
</target>
<target name="check_sql"
depends="licensecheck, compile, voltdbipc"
description="Run Java and C++ JNI testcases stressing sql functionality over process architecture." >
<condition property="timeoutLength" value="${timeoutLength}" else='1800000'>
<isset property="timeoutLength"/>
</condition>
<exec executable="ant" failonerror="true" timeout="9000000">
<arg value="eecheck" />
<arg value="junit_sql" />
<arg value="distcheck" />
<arg value="pythonfser" />
<arg value="-Dbuild=${build}" />
<arg value="-DtimeoutLength=${timeoutLength}" />
<arg value="-DVOLT_REGRESSIONS=${VOLT_REGRESSIONS}" />
<arg value="-DVOLT_ENABLEIV2=${VOLT_ENABLEIV2}" />
</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="ant" failonerror="true" timeout="1800000">
<arg value="junit_quarantine" />
<arg value="-Dbuild=${build}" />
<arg value="-DtimeoutLength=${timeoutLength}" />
<arg value="-DVOLT_REGRESSIONS=${VOLT_REGRESSIONS}" />
<arg value="-DVOLT_ENABLEIV2=${VOLT_ENABLEIV2}" />
</exec>
</target>
<target name="killstragglers"
description="Run the killstragglers script">
<exec executable="tools/killstragglers.sh"
failonerror="true" timeout="1800000">
</exec>
</target>
<target name="all"
depends="compile, ee, junit, eecheck, javadoc, jars, bindoc"
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_tools"
description="Create VoltDB release packages with examples and documentation."
/>
<target name="bindoc" depends="buildinfo"
description="Generate README for certain bin programs.">
<exec executable="/bin/sh">
<arg value="-c" />
<arg value="${base.dir}/bin/voltadmin help > ${base.dir}/README.voltadmin" />
</exec>
</target>
<target name="dist_tools" depends="buildinfo, bindoc"
description="Create VoltDB tools release package.">
<!-- add tools and support files -->
<dist_tools_macro distlabel="-tools" />
<!-- add README.voltadmin -->
<copy todir="${dist.dir}-tools" file="${base.dir}/README.voltadmin"/>
<!-- LICENSE isn't handled by dist_tools_macro -->
<copy todir="${dist.dir}-tools" file="${dist.dir}/LICENSE"/>
<!-- tools/volt is unwanted for now in the tools distribution -->
<delete dir="${dist.dir}-tools/tools" failonerror="false" />
<!-- copy recursively to the tarball staging directory -->
<copy todir="${raw.dist.dir}/voltdb-tools-${dist.version}">
<fileset dir="${dist.dir}-tools" defaultexcludes="yes">
<include name="**" />
</fileset>
</copy>
<!-- make bin and tools contents executable -->
<chmod perm="ugo+rx">
<fileset dir="${raw.dist.dir}/voltdb-tools-${dist.version}">
<include name="bin/*"/>
<include name="tools/*"/>
</fileset>
</chmod>
<!-- create the tools distribution tarball -->
<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-tools-${dist.version}.tar.gz"/>
<arg value="voltdb-tools-${dist.version}"/>
</exec>
<!-- remove the tarball staging directory -->
<exec dir='.' executable='/bin/sh'>
<arg line="-c 'rm -rfv ${raw.dist.dir}/voltdb-tools-${dist.version}'"/>
</exec>
</target>
<!--
***************************************
DISTRIBUTION
***************************************
-->
<target name="javadoc">
<echo message="Building Stored Procedure JavaDoc"/>
<!-- populate selected server/compiler javadoc documentation -->
<javadoc
destdir="doc/javadoc/procedure-api"
Public="true"
version="true"
use="true"
failonerror="true"
additionalparam="-quiet"
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" />
<include name="src/frontend/org/voltdb/types/TimestampType.java" />
</fileset>
</javadoc>
<!-- populate selected client javadoc documentation -->
<ant antfile="build-client.xml" target="javadoc" inheritAll="false">
<property name="build" value="${build}"/>
</ant>
</target>
<!-- dist_internal_core populates the core distribution components needed by all
distributions except tools. -->
<target name="dist_internal_core" depends="compile, ee, javadoc, voltdb.jar, voltdbclient.jar, bindoc">
<!-- prepare release directory for new content -->
<delete includeemptydirs="true" failonerror='false'>
<fileset dir="${dist.dir}" includes="**/*" />
</delete>
<mkdir dir="${dist.dir}" />
<!-- populate the docs and other core files -->
<copy todir="${dist.dir}/">
<fileset dir="." defaultexcludes="yes">
<include name="README"/>
<include name="README.thirdparty"/>
<include name="LICENSE"/>
<include name="doc/**"/>
<include name="lib/*"/>
<include name="voltdb/**"/>
<exclude name=".gitignore"/>
<exclude name="lib/python" />
<exclude name="doc/tutorials/**" />
</fileset>
</copy>
<!-- create, and leave empty extension directory for user supplied jars -->
<mkdir dir="${dist.dir}/lib/extension"/>
<!-- populate java client and native libraries -->
<copy todir="${dist.dir}/voltdb" flatten="true" >
<fileset dir="voltdb" defaultexcludes="yes">
<include name="voltdbclient-${dist.version}.jar" />
<include name="voltdbclient-${dist.version}-javadoc.jar" />
</fileset>
</copy>
<copy todir="${dist.dir}/voltdb" flatten="true" >
<fileset dir="${build.dir}" defaultexcludes="yes">
<include name="nativelibs/libvoltdb*" />
</fileset>
</copy>
<copy todir="${dist.dir}/voltdb" flatten="true" >
<fileset dir="." defaultexcludes="yes">
<include name="third_party/cpp/jnilib/libjzmq*" />
</fileset>
</copy>
<!-- 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"/>
<!-- add misc. other tools in the tools directory -->
<copy todir="${dist.dir}/tools" >
<fileset dir="tools" defaultexcludes="yes">
<include name="toolrunner.py" />
<include name="voltify" />
<include name="voltify-README.md" />
<include name="voltify.d/**" />
<include name="lib/**" />
</fileset>
</copy>
<!-- 3rd party libraries copied to the same location in the dist -->
<copy todir="${dist.dir}/third_party" >
<fileset dir="third_party" defaultexcludes="yes">
<include name="python/**" />
</fileset>
</copy>
<!-- OS-specific preparation of libvoltdb* -->
<antcall target="dist_libvoltdb" />
<!-- copy license to voltdb dir -->
<copy todir="${dist.dir}/voltdb" file="LICENSE"/>
</target>
<!-- internal target for building a full distribution. dist_internal_core
populates the core components used by the client distribution. -->
<target name="dist_internal" depends="dist_internal_core">
<!-- populate the stuff not handled by dist_internal_core -->
<copy todir="${dist.dir}/">
<fileset dir="." defaultexcludes="yes">
<include name="Click Here to Start.html"/>
<include name="bin/**"/>
<include name="doc/tutorials/**" />
<include name="examples/**"/>
<include name="lib/python/**"/>
<exclude name="**/*.pyc" />
</fileset>
</copy>
<!-- populate the voltdb java libraries -->
<copy todir="${dist.dir}/voltdb" flatten="true" >
<fileset dir="voltdb" defaultexcludes="yes">
<include name="voltdb-${dist.version}.jar" />
<include name="voltdb-${dist.version}-javadoc.jar" />
</fileset>
</copy>
<!-- add tools and support files -->
<dist_tools_macro distlabel="" />
<antcall target="copy_pro_bin"/>
<!-- 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>
<!-- make shell scripts executable -->
<chmod perm="ugo+rx">
<fileset dir="${dist.dir}" defaultexcludes="yes">
<include name="bin/*"/>
<include name="tools/volt"/>
<include name="examples/**/run.sh"/>
<include name="doc/tutorials/**/run.sh"/>
</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_core"
description="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"/>
<include name="bin/sqlcmd"/>
<exclude name="voltdb/libvoltdb*"/>
<exclude name="voltdb/voltdb-*.jar"/>
<exclude name="voltdb/libjzmq*"/>
</fileset>
</copy>
<!-- make shell scripts executable -->
<chmod perm="ugo+rx">
<fileset dir="${dist.dir}-client-java/" defaultexcludes="yes">
<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="bin/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>
<!-- Prepare libvoltdb* for distribution. -->
<target name="dist_libvoltdb" depends="dist_libvoltdb_linux, dist_libvoltdb_mac" />
<!-- Linux prepare libvoltdb* for distribution. -->
<target name="dist_libvoltdb_linux" unless="os.mac">
<!-- 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>
</target>
<!-- Mac prepare libvoltdb* for distribution. -->
<target name="dist_libvoltdb_mac" if="os.mac">
<!-- objcopy is unavailable by default on Mac -->
<!-- Just use strip -S since strip-unneeded option is unavailable. -->
<exec dir='${dist.dir}/voltdb' executable='/bin/sh'>
<arg line="-c '/usr/bin/strip -S libvoltdb*'"/>
</exec>
</target>
<macrodef name="dist_tools_macro"
description="Copy tools and supporting files to a distribution staging directory">
<attribute name="distlabel"/>
<sequential>
<mkdir dir="${dist.dir}@{distlabel}/bin" />
<mkdir dir="${dist.dir}@{distlabel}/lib" />
<mkdir dir="${dist.dir}@{distlabel}/tools" />
<mkdir dir="${raw.dist.dir}/voltdb-@{distlabel}-${dist.version}" />
<copy todir="${dist.dir}@{distlabel}">
<fileset dir="${base.dir}">
<include name="version.txt" />
</fileset>
</copy>
<copy todir="${dist.dir}@{distlabel}/bin">
<fileset dir="${base.dir}/bin">
<include name="voltadmin" />
</fileset>
</copy>
<copy todir="${dist.dir}@{distlabel}/lib">
<fileset dir="${base.dir}/lib">
<include name="python/**" />
<exclude name="**/*.pyc" />
</fileset>
</copy>
<chmod perm="ugo+rx">
<fileset dir="${dist.dir}@{distlabel}/bin">
<include name="voltadmin" />
</fileset>
</chmod>
<chmod perm="ugo+rx">
<fileset dir="${dist.dir}@{distlabel}/tools">
</fileset>
</chmod>
</sequential>
</macrodef>
<!--
***************************************
CLEANING
***************************************
-->
<target name='clean'
description="Remove all compiled and generated files."
depends="cleantmp, clean_client, clean_project_gen, clean_deployment_gen,
clean_debian_package, clean_rpm_package, clean_bindoc, clean_other_gen">
<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 voltdb/*.jnilib'"/>
</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/catgen/out/*'"/>
</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 src/frontend/org/voltcore/utils/DBBPool.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="clean_client">
<ant antfile="build-client.xml" target="clean" inheritAll="false">
<property name="build" value="${build}"/>
</ant>
</target>
<target name='cleanugh' description="Remove stack traces and crash dumps dropped by tests">
<exec dir='.' executable='/bin/sh'>
<arg line="-c 'rm -f voltdb_crash*.txt'"/>
</exec>
<exec dir='.' executable='/bin/sh'>
<arg line="-c 'rm -f host*-*-*.txt'"/>
</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>
<target name="clean_bindoc" description="Remove generated READMEs.">
<delete file="${base.dir}/README.voltadmin" failonerror="false" />
</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" duplicate="preserve">
<fileset dir="${build.client.dir}" defaultexcludes="yes">
<include name="**"/>
</fileset>
<fileset dir="${build.prod.dir}" defaultexcludes="yes">
<include name="org/voltdb/**"/>
<include name="org/voltcore/**"/>
<include name="org/hsqldb_voltpatches/**" />
<include name="org/apache/**" />
<include name="javax/annotation_voltpatches/**" />
<include name="com/google_voltpatches/**" />
<include name="vanilla/**" />
<include name="jsr166y/**"/>
<include name="org/eclipse/jetty_voltpatches/**" />
<include name="javax/servlet_voltpatches/**" />
<include name="au/com/bytecode/opencsv_voltpatches/**" />
<include name="org/cliffc_voltpatches/**" />
<include name="groovy_voltpatches/**"/>
<include name="org/supercsv_voltpatches/tokenizer/*" />
<include name="org/hsqldb_voltpatches/**" />
<include name="org/json_voltpatches/**" />
<include name="org/HdrHistogram_voltpatches/**" />
<include name="org/mindrot/**" />
<include name="org/spearce_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>
<!--jar destfile="voltdb/voltdb-${dist.version}-javadoc.jar">
<fileset dir="${doc.dir}/javadoc/procedure-api" defaultexcludes="no" >
<include name="**"/>
</fileset>
<manifest>
<section name="Credits">
<attribute name="Author" value="VoltDB Inc." />
</section>
<section name="Shared">
<attribute
name="Title"
value="VoltDB Database JavaDoc"
/>
<attribute name="Date" value="${TODAY}" />
</section>
</manifest>
</jar>
<jar destfile="voltdb/voltdbclient-${dist.version}-javadoc.jar">
<fileset dir="${doc.dir}/javadoc/java-client-api" defaultexcludes="no" >
<include name="**"/>
</fileset>
<manifest>
<section name="Credits">
<attribute name="Author" value="VoltDB Inc." />
</section>
<section name="Shared">
<attribute
name="Title"
value="VoltDB Client JavaDoc"
/>
<attribute name="Date" value="${TODAY}" />
</section>
</manifest>
</jar-->
</target>
<target name="voltdbclient.jar" depends="compile, buildinfo">
<ant antfile="build-client.xml" target="voltdbclient.jar" inheritAll="false">
<property name="build" value="${build}"/>
</ant>
</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/HdrHistogram_voltpatches/**" />
<include name="org/json_voltpatches/**" />
<include name="org/apache/**" />
<include name="vanilla/**" />
<include name="javax/annotation_voltpatches/**" />
<include name="com/google_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, dbbpool_gen, project_gen, deployment_gen, compile_core, compile_pro"
description="Compile all Java source and test classes"/>
<target name="compile_client">
<ant antfile="build-client.xml" target="compile" inheritAll="false">
<property name="build" value="${build}"/>
</ant>
</target>
<target name="compile_core" depends="compile_client">
<mkdir dir='${build.prod.dir}' />
<mkdir dir='${build.test.dir}' />
<mkdir dir='${build.testproc.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}:${src.testproc.dir}:${vendor.src.dir}"
destdir="${build.prod.dir}:${build.test.dir}:${build.testproc.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="**/*template.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}">