forked from apache/pig
-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.xml
1687 lines (1500 loc) · 83.3 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
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project name="Pig" default="jar-all"
xmlns:artifact="urn:maven-artifact-ant"
xmlns:ivy="antlib:org.apache.ivy.ant">
<!-- Load all the default properties, and any the user wants -->
<!-- to contribute (without having to type -D or edit this file -->
<property file="${user.home}/build.properties" />
<property file="${basedir}/build.properties" />
<!-- name and version properties -->
<property name="name" value="pig" />
<property name="Name" value="Pig" />
<property name="ant-task.version" value="2.0.10" />
<property name="pig.pom" value="${basedir}/ivy/pig.pom" />
<property name="pigsmoke.pom" value="${basedir}/ivy/pigsmoke.pom" />
<property name="pigunit.pom" value="${basedir}/ivy/pigunit.pom" />
<property name="piggybank.pom" value="${basedir}/ivy/piggybank.pom" />
<property name="pig.version" value="0.12.0" />
<property name="pig.version.suffix" value="-SNAPSHOT" />
<property name="version" value="${pig.version}${pig.version.suffix}" />
<property name="final.name" value="${name}-${version}" />
<property name="year" value="2007-2012" />
<!-- source properties -->
<property name="lib.dir" value="${basedir}/lib" />
<property name="src.dir" value="${basedir}/src" />
<property name="src.lib.dir" value="${basedir}/lib-src" />
<property name="src.gen.dir" value="${basedir}/src-gen" />
<property name="docs.dir" value="${basedir}/src/docs" />
<!-- build properties -->
<property name="build.dir" value="${basedir}/build" />
<property name="build.classes" value="${build.dir}/classes" />
<property name="build.docs" value="${build.dir}/docs" />
<property name="build.javadoc" value="${build.docs}/api" />
<property name="tar.dist.dir" value="${build.dir}/tar/${final.name}" />
<!-- property name="build.encoding" value="ISO-8859-1" / -->
<property name="build.encoding" value="UTF8" />
<!-- javac properties -->
<property name="javac.debug" value="on" />
<property name="javac.optimize" value="on" />
<property name="javac.deprecation" value="off" />
<property name="javac.version" value="1.5" />
<property name="javac.args" value="" />
<condition property="javac.args.warnings" value="-Xmaxwarns 1000000 -Xlint -Xlint:-deprecation" else="-Xmaxwarns 1000000">
<isset property="all.warnings" />
</condition>
<!-- artifact jar file names -->
<property name="artifact.pig.jar" value="${final.name}.jar"/>
<property name="artifact.pig-h2.jar" value="${final.name}-h2.jar"/>
<property name="artifact.pig-withouthadoop.jar" value="${final.name}-withouthadoop.jar"/>
<property name="artifact.pig-withouthadoop-h2.jar" value="${final.name}-withouthadoop-h2.jar"/>
<property name="artifact.pig-withdependencies.jar" value="${final.name}-withdependencies.jar"/>
<property name="artifact.pig-sources.jar" value="${final.name}-sources.jar"/>
<property name="artifact.pig-javadoc.jar" value="${final.name}-javadoc.jar"/>
<property name="artifact.pig.tar" value="${final.name}.tar.gz"/>
<!-- jar names. TODO we might want to use the svn reversion name in the name in case it is a dev version -->
<property name="output.jarfile.withdependencies" value="${build.dir}/${artifact.pig-withdependencies.jar}" />
<property name="output.stage.jarfile.withdependencies" value="${build.dir}/${final.name}-withdependencies.stage.jar" />
<property name="output.jarfile.withouthadoop" value="${build.dir}/${artifact.pig-withouthadoop.jar}" />
<property name="output.jarfile.withouthadoop-h2" value="${build.dir}/${artifact.pig-withouthadoop-h2.jar}" />
<property name="output.jarfile.core" value="${build.dir}/${artifact.pig.jar}" />
<property name="output.jarfile.core-h2" value="${build.dir}/${artifact.pig-h2.jar}" />
<property name="output.jarfile.sources" value="${build.dir}/${artifact.pig-sources.jar}" />
<property name="output.jarfile.javadoc" value="${build.dir}/${artifact.pig-javadoc.jar}" />
<!-- Maintain old pig.jar in top level directory. -->
<property name="output.jarfile.backcompat" value="${basedir}/${name}.jar" />
<property name="output.jarfile.backcompat.withouthadoop" value="${basedir}/${name}-withouthadoop.jar" />
<!-- test properties -->
<property name="test.src.dir" value="${basedir}/test" />
<property name="test.build.dir" value="${build.dir}/test" />
<property name="test.build.classes" value="${test.build.dir}/classes" />
<property name="test.log.dir" value="${test.build.dir}/logs" />
<property name="test.timeout" value="7200000" />
<property name="test.junit.output.format" value="plain" />
<property name="test.commit.file" value="${test.src.dir}/commit-tests"/>
<property name="test.unit.file" value="${test.src.dir}/unit-tests"/>
<property name="test.smoke.file" value="${test.src.dir}/smoke-tests"/>
<property name="test.all.file" value="${test.src.dir}/all-tests"/>
<property name="test.exclude.file" value="${test.src.dir}/excluded-tests"/>
<property name="test.exclude.file.23" value="${test.src.dir}/excluded-tests-23"/>
<property name="pigunit.jarfile" value="pigunit.jar" />
<property name="piggybank.jarfile" value="${basedir}/contrib/piggybank/java/piggybank.jar" />
<property name="smoke.tests.jarfile" value="${build.dir}/${final.name}-smoketests.jar" />
<property name="test.pigunit.src.dir" value="${test.src.dir}/org/apache/pig/test/pigunit" />
<property name="test.pigunit.file" value="${test.src.dir}/pigunit-tests"/>
<!-- test configuration, use ${user.home}/build.properties to configure values -->
<property name="ssh.gateway" value="" />
<property name="hod.server" value="" />
<property name="test.log.dir" value="${basedir}/test/logs"/>
<property name="test.output" value="no"/>
<!-- e2e test properties -->
<property name="test.e2e.dir" value="${basedir}/test/e2e/pig"/>
<!-- pigmix properties -->
<property name="pigmix.dir" value="${basedir}/test/perf/pigmix"/>
<!-- parser properties -->
<property name="src.gen.query.parser.dir" value="${src.gen.dir}/org/apache/pig/impl/logicalLayer/parser" />
<property name="src.gen.script.parser.dir" value="${src.gen.dir}/org/apache/pig/tools/pigscript/parser" />
<property name="src.gen.param.parser.dir" value="${src.gen.dir}/org/apache/pig/tools/parameters" />
<property name="src.gen.dot.parser.dir" value="${test.src.dir}/org/apache/pig/test/utils/dotGraph/parser" />
<property name="src.gen.textdata.parser.dir" value="${src.gen.dir}/org/apache/pig/data/parser" />
<!-- Antlr properties -->
<property name="grammar.name" value="Query"/>
<property name="grammar.name.lower" value="query"/>
<property name="grammar.package" value="org.apache.pig.parser"/>
<property name="grammar.package.dir" value="org/apache/pig/parser"/>
<property name="grammar.src.dir" value="${src.dir}/${grammar.package.dir}"/>
<!-- rats properties -->
<property name="rat.reporting.classname" value="rat.Report"/>
<!-- javadoc properties -->
<property name="javadoc.link.java" value="http://download.oracle.com/javase/1.5.0/docs/api/" />
<!-- test patch properties -->
<property name="scratch.dir" value="${user.home}/tmp"/>
<property name="svn.cmd" value="svn"/>
<property name="grep.cmd" value="grep"/>
<property name="patch.cmd" value="patch"/>
<property name="make.cmd" value="make"/>
<property name="test_patch_sh" value="${test.src.dir}/bin/test-patch.sh"/>
<property name="clover.db.dir" location="${build.dir}/test/clover/db"/>
<property name="clover.report.dir" location="${build.dir}/test/clover/reports"/>
<property name="clover.pdf.report.dir" location="${build.dir}/test/clover/pdf/reports"/>
<property name="clover.jar" location="${clover.home}/lib/clover.jar"/>
<available property="clover.present" file="${clover.jar}" />
<!-- check if clover reports should be generated -->
<condition property="clover.enabled">
<and>
<isset property="run.clover"/>
<isset property="clover.present"/>
</and>
</condition>
<condition property="staging">
<equals arg1="${repo}" arg2="staging"/>
</condition>
<!-- IVY properteis set here -->
<property name="ivy.repo.dir" value="${user.home}/ivyrepo" />
<property name="ivy.dir" location="ivy" />
<loadproperties srcfile="${ivy.dir}/libraries.properties"/>
<!--propertyregex property="hadoopversion"
input="${hadoop-core.version}"
regexp="\d+\.(\d+)\.\d+"
select="\1" /-->
<property name="hadoopversion" value="20" />
<condition property="isHadoop23">
<equals arg1="${hadoopversion}" arg2="23"/>
</condition>
<property name="src.shims.dir" value="${basedir}/shims/src/hadoop${hadoopversion}" />
<property name="src.shims.test.dir" value="${basedir}/shims/test/hadoop${hadoopversion}" />
<property name="hadoop.jar" value="hadoop-core-${hadoop-core.version}.jar" />
<property name="asfrepo" value="https://repository.apache.org"/>
<property name="asfsnapshotrepo" value="${asfrepo}/content/repositories/snapshots"/>
<property name="mvnrepo" value="http://repo2.maven.org/maven2"/>
<property name="asfstagingrepo" value="${asfrepo}/service/local/staging/deploy/maven2"/>
<property name="staging_repo_id" value="apache.staging.https"/>
<property name="snapshots_repo_id" value="apache.snapshots.https"/>
<property name="ivy.jar" location="${ivy.dir}/ivy-${ivy.version}.jar"/>
<property name="ant_task.jar" location="${ivy.dir}/maven-ant-tasks-${ant-task.version}.jar"/>
<property name="ant_task_repo_url" value="${mvnrepo}/org/apache/maven/maven-ant-tasks/${ant-task.version}/maven-ant-tasks-${ant-task.version}.jar"/>
<property name="ivy_repo_url" value="${mvnrepo}/org/apache/ivy/ivy/${ivy.version}/ivy-${ivy.version}.jar"/>
<property name="ivysettings.xml" location="${ivy.dir}/ivysettings.xml" />
<property name="ivy.org" value="org.apache.pig"/>
<property name="build.dir" location="build" />
<property name="build.ivy.dir" location="${build.dir}/ivy" />
<property name="build.ivy.lib.dir" location="${build.ivy.dir}/lib" />
<property name="ivy.lib.dir" location="${build.ivy.lib.dir}/${ant.project.name}"/>
<property name="build.ivy.report.dir" location="${build.ivy.dir}/report" />
<property name="build.ivy.maven.dir" location="${build.ivy.dir}/maven" />
<property name="pom.xml" location="${build.ivy.maven.dir}/pom.xml"/>
<property name="build.ivy.maven.pom" location="${build.ivy.maven.dir}/pig-${version}.pom" />
<property name="build.ivy.maven.jar" location="${build.ivy.maven.dir}/pig-${version}-core.jar" />
<property name="javacc.home" location="${ivy.lib.dir}" />
<property name="jackson_core.jar" location="${test.src.dir}/resources/jackson-core-asl-${jackson-pig-3039-test.version}.jar"/>
<property name="jackson_mapper.jar" location="${test.src.dir}/resources/jackson-mapper-asl-${jackson-pig-3039-test.version}.jar"/>
<property name="jackson_core_repo_url"
value="${mvnrepo}/org/codehaus/jackson/jackson-core-asl/${jackson-pig-3039-test.version}/jackson-core-asl-${jackson-pig-3039-test.version}.jar"/>
<property name="jackson_mapper_repo_url"
value="${mvnrepo}/org/codehaus/jackson/jackson-mapper-asl/${jackson-pig-3039-test.version}/jackson-mapper-asl-${jackson-pig-3039-test.version}.jar"/>
<!--this is the naming policy for artifacts we want pulled down-->
<property name="ivy.artifact.retrieve.pattern" value="${ant.project.name}/[artifact]-[revision](-[classifier]).[ext]"/>
<!--this is how artifacts that get built are named-->
<property name="ivy.publish.pattern" value="[artifact]-[revision].[ext]"/>
<!-- jdiff properties -->
<property name="jdiff.jar" value="${ivy.lib.dir}/jdiff-${jdiff.version}.jar"/>
<property name="xerces.jar" value="${ivy.lib.dir}/xerces-${xerces.version}.jar"/>
<property name="jdiff.build.dir" value="${build.docs}/jdiff"/>
<property name="jdiff.xml.dir" value="${lib.dir}/jdiff"/>
<property name="jdiff.stable" value="0.11.1"/>
<property name="jdiff.stable.javadoc" value="http://hadoop.apache.org/${name}/docs/r${jdiff.stable}/api/"/>
<!-- Packaging properties -->
<property name="package.release" value="1"/>
<property name="package.prefix" value="/usr"/>
<property name="package.conf.dir" value="/etc/pig"/>
<property name="package.log.dir" value="/var/log/pig"/>
<property name="package.buildroot" value="/tmp/pig_package_build_${user.name}"/>
<property name="package.build.dir" value="/tmp/pig_package_build_${user.name}/BUILD"/>
<!-- Eclipse properties -->
<property name="build.dir.eclipse" value="${build.dir}"/>
<property name="build.dir.eclipse-main-classes" value="${build.classes}"/>
<property name="build.dir.eclipse-test-classes" value="${test.build.classes}"/>
<!--property name="build.dir.eclipse-test-generated-classes" value="${build.dir.eclipse}/classes-test-generated"/-->
<condition property="ant-eclipse.jar.exists">
<available file="${build.dir}/lib/ant-eclipse-1.0-jvm1.2.jar"/>
</condition>
<target name="ant-eclipse-download" unless="ant-eclipse.jar.exists"
description="Downloads the ant-eclipse binary.">
<get src="http://downloads.sourceforge.net/project/ant-eclipse/ant-eclipse/1.0/ant-eclipse-1.0.bin.tar.bz2"
dest="${build.dir}/ant-eclipse-1.0.bin.tar.bz2" usetimestamp="false" />
<untar src="${build.dir}/ant-eclipse-1.0.bin.tar.bz2"
dest="${build.dir}" compression="bzip2">
<patternset>
<include name="lib/ant-eclipse-1.0-jvm1.2.jar"/>
</patternset>
</untar>
<delete file="${build.dir}/ant-eclipse-1.0.bin.tar.bz2" />
</target>
<target name="eclipse-files"
depends="init,ant-eclipse-download,ivy-compile,ivy-test"
description="Create eclipse project files">
<pathconvert property="eclipse.project">
<path path="${basedir}"/>
<regexpmapper from="^.*/([^/]+)$$" to="\1" handledirsep="yes"/>
</pathconvert>
<path id="eclipse.classpath">
<fileset dir="${ivy.lib.dir}">
<include name="**.*jar"/>
</fileset>
<fileset dir="${lib.dir}">
<include name="**.*jar"/>
</fileset>
<!-- SPORK -->
<fileset dir="${lib.dir}/spark">
<include name="**.*jar"/>
</fileset>
</path>
<taskdef name="eclipse"
classname="prantl.ant.eclipse.EclipseTask"
classpath="${build.dir}/lib/ant-eclipse-1.0-jvm1.2.jar" />
<eclipse updatealways="true" mode="java">
<project name="${eclipse.project}" />
<classpath>
<source path="${src.dir}"/>
<source path="${src.gen.dir}"/>
<source path="${src.lib.dir}/bzip2"/>
<source path="${src.lib.dir}/shock"/>
<source path="${test.e2e.dir}/udfs/java"/>
<source path="${src.shims.dir}"/>
<source path="${src.shims.test.dir}"/>
<source path="tutorial/src"/>
<source path="${test.src.dir}" excluding="e2e/pig/udfs/java/|resources/"/>
<output path="${build.dir.eclipse-main-classes}" />
<library pathref="eclipse.classpath" exported="true" />
<!--library pathref="classpath" exported="false"/-->
</classpath>
</eclipse>
</target>
<!-- ====================================================== -->
<!-- Stuff needed by all targets -->
<!-- ====================================================== -->
<!-- setup the classpath -->
<path id="classpath">
<path refid="compile.classpath"/>
<fileset dir="${lib.dir}/spark">
<include name="**.*jar"/>
</fileset>
<fileset dir="${lib.dir}" includes="*.jar"/>
<fileset file="${ivy.lib.dir}/${zookeeper.jarfile}"/>
<fileset dir="${ivy.lib.dir}" includes="*.jar"/>
</path>
<!-- javadoc-classpath -->
<path id="javadoc-classpath">
<path refid="javadoc.classpath"/>
</path>
<path id="test.classpath">
<!-- need to put this first, otherwise junit-3 testcases can break -->
<pathelement location="${ivy.lib.dir}/junit-3.8.1.jar"/>
<pathelement location="${lib.dir}/spark/mesos-*.jar"/>
<pathelement location="${build.classes}"/>
<pathelement location="${test.src.dir}"/>
<pathelement location="${piggybank.jarfile}"/>
<path refid="classpath"/>
</path>
<fileset dir="${ivy.lib.dir}" id="runtime.dependencies-withouthadoop.jar">
<patternset id="pattern.runtime.dependencies-withouthadoop.jar">
<include name="antlr-runtime-${antlr.version}.jar"/>
<include name="ST4-${stringtemplate.version}.jar"/>
<include name="jline-${jline.version}.jar"/>
<include name="jackson-mapper-asl-${jackson.version}.jar"/>
<include name="jackson-core-asl-${jackson.version}.jar"/>
<include name="joda-time-${joda-time.version}.jar"/>
<include name="guava-${guava.version}.jar"/>
<include name="automaton-${automaton.version}.jar"/>
<include name="jansi-${jansi.version}.jar"/>
<include name="avro-${avro.version}.jar"/>
<include name="avro-mapred-${avro.version}.jar"/>
<include name="trevni-core-${avro.version}.jar"/>
<include name="trevni-avro-${avro.version}.jar"/>
<include name="snappy-java-${snappy.version}.jar"/>
<include name="asm*.jar"/>
<!-- SPORK -->
<include name="spark-core*.jar" />
<include name="scala-library*.jar" />
<include name="jetty*7.5.3*.jar" />
<include name="fastutil*.jar" />
<include name="protobuf*.jar" />
<include name="asm*.jar" />
<include name="slf4j*.jar" />
<include name="servlet-api*.jar" />
<include name="compress-lzf*.jar" />
<include name="mesos*.jar"/>
<!-- /SPORK -->
</patternset>
</fileset>
<fileset dir="${ivy.lib.dir}" id="runtime.dependencies.jar">
<patternset id="pattern.runtime.dependencies.jar">
<patternset refid="pattern.runtime.dependencies-withouthadoop.jar"/>
<include name="hadoop-core-${hadoop-core.version}.jar"/>
<include name="hadoop-*-${hadoop-common.version}.jar"/>
<exclude name="hadoop-hdfs-${hadoop-hdfs.version}.jar"/>
<include name="junit-${junit.version}.jar"/>
<include name="jsch-${jsch.version}.jar"/>
<include name="protobuf-java-${protobuf-java.version}.jar"/>
<include name="commons*.jar"/>
<include name="log4j*.jar"/>
<include name="slf4j*.jar"/>
<include name="jsp-api*.jar"/>
<!-- SPORK -->
<include name="spark-core*.jar" />
<include name="scala-library*.jar" />
<include name="jetty*7.5.3*.jar" />
<include name="fastutil*.jar" />
<include name="protobuf*.jar" />
<include name="asm*.jar" />
<include name="slf4j*.jar" />
<include name="servlet-api*.jar" />
<include name="compress-lzf*.jar" />
<include name="mesos-*.jar"/>
<!-- /SPORK -->
<include name="avro-${avro.version}.jar"/>
<include name="avro-mapred-${avro.version}.jar"/>
<include name="trevni-core-${avro.version}.jar"/>
<include name="trevni-avro-${avro.version}.jar"/>
<include name="snappy-java-${snappy.version}.jar"/>
<include name="asm*.jar"/>
</patternset>
</fileset>
<fileset dir="${ivy.lib.dir}" id="core.dependencies.jar">
<exclude name="**.*jar"/>
</fileset>
<target name="init" depends="ivy-compile" >
<mkdir dir="${src.gen.query.parser.dir}" />
<mkdir dir="${src.gen.script.parser.dir}" />
<mkdir dir="${src.gen.param.parser.dir}" />
<mkdir dir="${build.classes}" />
<mkdir dir="${test.build.classes}" />
<mkdir dir="${src.gen.dot.parser.dir}" />
<mkdir dir="${src.gen.textdata.parser.dir}" />
<move file="${ivy.lib.dir}/javacc-${javacc.version}.jar" tofile="${javacc.home}/javacc.jar"/>
<tstamp>
<format property="timestamp" pattern="MMM dd yyyy, HH:mm:ss" />
</tstamp>
<svnversion outputproperty="svn.revision"/>
<!-- properties are immutable in Ant, so this gets set only if we get nothing out of svnversion -->
<property name="svn.revision" value=": unknown"/>
</target>
<macrodef name="svnversion">
<!-- the path needs to be small content otherwise it will take AGES ! -->
<attribute name="wcpath" default="${basedir}" />
<attribute name="outputproperty" />
<sequential>
<exec executable="svnversion" outputproperty="@{outputproperty}" failonerror="false" failifexecutionfails="false" >
<arg value="@{wcpath}" />
<redirector>
<outputfilterchain>
<tokenfilter>
<!-- version can be xxxx, xxxx:yyyy, xxxxM, xxxxS or xxxx:yyyyMS , ... just get the working copy one -->
<replaceregex pattern="((\d+).*)" replace="\2" />
</tokenfilter>
</outputfilterchain>
</redirector>
</exec>
</sequential>
</macrodef>
<!-- ================================================================== -->
<!-- Clean. Delete the build files, and their directories -->
<!-- ================================================================== -->
<target name="clean" description="Cleanup build artifacts">
<delete dir="${src.gen.dir}" />
<delete dir="${docs.dir}/build" />
<delete file="${jdiff.xml.dir}\${name}_${version}.xml" />
<delete dir="${build.dir}" />
<delete dir="${src.gen.dot.parser.dir}" />
<delete file="${output.jarfile.backcompat}" />
<delete file="${output.jarfile.backcompat.withouthadoop}" />
<ant dir="${test.e2e.dir}" target="clean"/>
</target>
<target name="very-clean" unless="offline" depends="ivy-clean-cache,jackson-pig-3039-test-clean,clean"
description="Clean build artifacts and flush Ivy cache" />
<target name="clean-piggybank" description="Cleanup piggybank">
<ant target="clean" dir="contrib/piggybank/java" inheritAll="false"/>
</target>
<target name="clean-zebra" description="Cleanup Zebra">
<ant target="clean" dir="contrib/zebra" inheritAll="false"/>
</target>
<target name="clean-tutorial" description="Cleanup Tutorial">
<ant target="clean" dir="tutorial" inheritAll="false"/>
</target>
<target name="clean-test-e2e" description="Cleanup e2e tests">
<ant target="clean" dir="test/e2e/harness" inheritAll="false"/>
<ant target="clean" dir="test/e2e/pig" inheritAll="false"/>
<ant target="clean" dir="test/e2e/pig/udfs/java" inheritAll="false"/>
</target>
<!--target name="eclipse-files" depends="compile, ivy-buildJar"
description="Generate files for Eclipse">
<pathconvert property="eclipse.project">
<path path="${basedir}"/>
<regexpmapper from="^.*/([^/]+)$$" to="\1" handledirsep="yes"/>
</pathconvert>
<copy todir="." overwrite="true">
<fileset dir=".eclipse.templates">
<exclude name="**/README.txt"/>
</fileset>
<filterset>
<filter token="PROJECT" value="${eclipse.project}"/>
</filterset>
</copy>
</target-->
<!-- ================================================================== -->
<!-- Java Compiler Compiler, generate Parsers -->
<!-- ================================================================== -->
<target name="cc-compile" depends="init, ivy-compile" description="Create and Compile Parser">
<javacc target="${src.dir}/org/apache/pig/tools/pigscript/parser/PigScriptParser.jj" outputdirectory="${src.gen.script.parser.dir}" javacchome="${javacc.home}" />
<javacc target="${src.dir}/org/apache/pig/tools/parameters/PigFileParser.jj" outputdirectory="${src.gen.param.parser.dir}" javacchome="${javacc.home}" />
<javacc target="${src.dir}/org/apache/pig/tools/parameters/ParamLoader.jj" outputdirectory="${src.gen.param.parser.dir}" javacchome="${javacc.home}" />
<jjtree target="${test.src.dir}/org/apache/pig/test/utils/dotGraph/DOTParser.jjt" outputdirectory="${src.gen.dot.parser.dir}" javacchome="${javacc.home}" />
<javacc target="${src.gen.dot.parser.dir}/DOTParser.jj" outputdirectory="${src.gen.dot.parser.dir}" javacchome="${javacc.home}" />
</target>
<target name="gen" depends="genTreeParser"
description="generates lexer and parser code from an ANTLR grammar">
<!-- Move generated Java code to the correct package directory. -->
<move todir="${src.gen.dir}${grammar.package.dir}">
<fileset dir="${src.gen.dir}" includes="*.java"/>
</move>
<!-- Copy generated .token files to current directory. -->
<copy todir=".">
<fileset dir="${src.gen.dir}" includes="*.tokens"/>
</copy>
</target>
<target name="genLexer" depends="prepare, init, ivy-compile"
unless="lexerGrammarProcessed"
description="generates lexer class from an ANTLR grammar">
<java classname="org.antlr.Tool"
classpathref="classpath" fork="true" failonerror="true">
<arg line="-o ${src.gen.dir}/${grammar.package.dir} ${src.dir}/${grammar.package.dir}/${grammar.name}Lexer.g"/>
</java>
</target>
<target name="genParser" depends="genLexer"
unless="parserGrammarProcessed"
description="generates token parser class from an ANTLR grammar">
<java classname="org.antlr.Tool"
classpathref="classpath" fork="true" failonerror="true">
<arg line="-o ${src.gen.dir}/${grammar.package.dir} ${src.dir}/${grammar.package.dir}/${grammar.name}Parser.g"/>
</java>
</target>
<target name="genTreeParser" depends="genParser"
unless="treeGrammarProcessed"
description="generates tree parser class from an ANTLR grammar">
<java classname="org.antlr.Tool"
classpathref="classpath" fork="true" failonerror="true">
<arg line="-o ${src.gen.dir}/${grammar.package.dir} ${src.dir}/${grammar.package.dir}/AstPrinter.g ${src.dir}/${grammar.package.dir}/AliasMasker.g ${src.dir}/${grammar.package.dir}/AstValidator.g ${src.dir}/${grammar.package.dir}/LogicalPlanGenerator.g"/>
</java>
</target>
<target name="prepare">
<uptodate property="lexerGrammarProcessed" srcfile="${grammar.src.dir}/${grammar.name}Lexer.g">
<mapper type="merge" to="${src.gen.dir}/${grammar.package.dir}/${grammar.name}Lexer.java"/>
</uptodate><!--
<uptodate property="parserGrammarProcessed" srcfile="${grammar.src.dir}/${grammar.name}Parser.g">
<mapper type="merge" to="${src.gen.dir}/${grammar.package.dir}/${grammar.name}Parser.java"/>
</uptodate>
<uptodate property="treeGrammarProcessed" srcfile="${grammar.src.dir}/${grammar.name}Tree.g">
<mapper type="merge" to="${src.gen.dir}/${gramar.package.dir}/${grammar.name}Tree.java"/>
</uptodate>-->
<!--mkdir dir="build/classes"/-->
<mkdir dir="${src.gen.dir}/${grammar.package.dir}"/>
</target>
<!-- ================================================================== -->
<!-- Build sources -->
<!-- ================================================================== -->
<target name="compile" depends="cc-compile, gen" description="Compile all artifacts">
<echo>*** Building Main Sources ***</echo>
<echo>*** To compile with all warnings enabled, supply -Dall.warnings=1 on command line ***</echo>
<echo>*** Else, you will only be warned about deprecations ***</echo>
<compileSources sources="${src.dir};${src.gen.dir};${src.lib.dir}/shock;${src.lib.dir}/bzip2;${src.shims.dir}"
excludes="" dist="${build.classes}" cp="classpath" warnings="${javac.args.warnings}" />
</target>
<target name="compile-test" depends="compile, ivy-test">
<echo>*** Building Test Sources ***</echo>
<echo>*** To compile with all warnings enabled, supply -Dall.warnings=1 on command line ***</echo>
<echo>*** Else, you will only be warned about deprecations ***</echo>
<compileSources sources="${test.src.dir};${src.shims.test.dir}"
excludes="**/PigTestLoader.java **/resources/** perf/**" dist="${test.build.classes}" cp="test.classpath" warnings="${javac.args.warnings}" />
<copy file="${basedir}/test/hbase-site.xml" tofile="${test.build.classes}/hbase-site.xml"/>
<ivy:cachepath pathid="mr-apps-test-ivy.classpath" conf="test" />
<path id="mr-apps-test.classpath">
<fileset dir="${clover.home}" erroronmissingdir="false">
<include name="lib/clover.jar"/>
</fileset>
<path refid="mr-apps-test-ivy.classpath"/>
</path>
<property name="mr-apps-classpath" refid="mr-apps-test.classpath" />
<!-- Remove jython jar from mrapp-generated-classpath -->
<script language="javascript">
project.setProperty('mr-apps-classpath', project.getProperty('mr-apps-classpath').
replace(":" + project.getProperty('ivy.default.ivy.user.dir') + "/cache/org.python/jython-standalone/jars/jython-standalone-" + project.getProperty('jython.version') + ".jar", ""));
</script>
<echo file="${test.build.classes}/mrapp-generated-classpath" message="${mr-apps-classpath}" />
</target>
<macrodef name="compileSources">
<attribute name="sources"/>
<attribute name="excludes"/>
<attribute name="dist"/>
<attribute name="cp"/>
<attribute name="warnings"/>
<sequential>
<javac encoding="${build.encoding}" srcdir="@{sources}" excludes="@{excludes}"
includes="**/*.java" destdir="@{dist}" debug="${javac.debug}"
optimize="${javac.optimize}" target="${javac.version}"
source="${javac.version}" deprecation="${javac.deprecation}"
includeantruntime="false">
<compilerarg line="${javac.args} @{warnings}"/>
<classpath refid="@{cp}" />
</javac>
<copy file="${src.dir}/org/apache/pig/tools/grunt/autocomplete" todir="${build.classes}/org/apache/pig/tools/grunt"/>
<copy file="${src.dir}/org/apache/pig/tools/grunt/autocomplete_aliases" todir="${build.classes}/org/apache/pig/tools/grunt"/>
</sequential>
</macrodef>
<!-- ================================================================== -->
<!-- Documentation -->
<!-- ================================================================== -->
<target name="javadoc" depends="jar-withouthadoop, ivy-javadoc" description="Create documentation">
<mkdir dir="${build.javadoc}" />
<javadoc overview="${src.dir}/overview.html" packagenames="org.apache.pig.*" destdir="${build.javadoc}" author="true" version="true" use="true" windowtitle="${Name} ${version} API" doctitle="${Name} ${version} API" bottom="Copyright &copy; ${year} The Apache Software Foundation">
<packageset dir="${src.dir}" />
<link href="${javadoc.link.java}" />
<classpath>
<path refid="javadoc-classpath" />
<pathelement path="${output.jarfile.core}" />
</classpath>
<group title="pig" packages="org.apache.*" />
</javadoc>
</target>
<target name="javadoc-all" depends="jar-withouthadoop, piggybank, zebra, ivy-javadoc" description="Create documentation including all contrib projects">
<mkdir dir="${build.javadoc}" />
<javadoc overview="${src.dir}/overview.html" packagenames="org.apache.pig*,org.apache.hadoop.zebra*" destdir="${build.javadoc}" author="true" version="true" use="true" windowtitle="${Name} ${version} API" doctitle="${Name} ${version} API" bottom="Copyright &copy; ${year} The Apache Software Foundation">
<packageset dir="${src.dir}" />
<packageset dir="contrib/piggybank/java/src/main/java"/>
<packageset dir="contrib/zebra/src/java"/>
<link href="${javadoc.link.java}" />
<classpath>
<path refid="javadoc-classpath" />
<pathelement path="${output.jarfile.withdependencies}" />
<pathelement path="${piggybank.jarfile}"/>
<fileset dir="build">
<include name="**/zebra-*-dev.jar"/>
</fileset>
</classpath>
<group title="pig" packages="org.apache.pig*" />
<group title="contrib: Piggybank" packages="org.apache.pig.piggybank*" />
<group title="contrib: Zebra" packages="org.apache.hadoop.zebra*"/>
</javadoc>
</target>
<!-- ================================================================== -->
<!-- @deprecated, Documentation -->
<!-- ================================================================== -->
<target name="docs" depends="forrest.check, javadoc-all" description="Generate forrest-based documentation.
To use, specify -Dforrest.home=<base of Apache Forrest installation> on the command line." if="forrest.home">
<exec dir="${docs.dir}" executable="${forrest.home}/bin/forrest" failonerror="true">
</exec>
<copy todir="${build.docs}">
<fileset dir="${docs.dir}/build/site/" />
</copy>
</target>
<target name="forrest.check" unless="forrest.home">
<fail message="'forrest.home' is not defined.
Please pass -Dforrest.home=<base of Apache Forrest installation> to Ant on the command-line." />
</target>
<target name="source-jar" depends="cc-compile">
<jar duplicate="preserve" jarfile="${output.jarfile.sources}" basedir="${src.dir}/" excludes="docs/**, overview.html">
<manifest>
<section name="org/apache/pig">
<attribute name="Implementation-Vendor" value="Apache" />
<attribute name="Implementation-Title" value="Pig" />
<attribute name="Implementation-Version" value="${version}" />
</section>
</manifest>
<fileset dir="${src.lib.dir}/shock"/>
<fileset dir="${src.lib.dir}/bzip2"/>
</jar>
</target>
<target name="javadoc-jar" depends="cc-compile, javadoc">
<jar duplicate="preserve" jarfile="${output.jarfile.javadoc}" basedir="${build.javadoc}/">
<manifest>
<section name="org/apache/pig">
<attribute name="Implementation-Vendor" value="Apache" />
<attribute name="Implementation-Title" value="Pig" />
<attribute name="Implementation-Version" value="${version}" />
</section>
</manifest>
</jar>
</target>
<!-- ================================================================== -->
<!-- Facede to build pig.jar and pig-withouthadoop.jar -->
<!-- ================================================================== -->
<target name="jar-all" depends="jar,jar-withouthadoop" description="Create pig, pig withdependencies and pig withouthadoop jar" />
<!-- ================================================================== -->
<!-- Make pig.jar -->
<!-- ================================================================== -->
<!-- TODO we should also exclude test here... -->
<!-- ================================================================== -->
<target name="jar" depends="compile,ivy-buildJar" description="Create pig withdependecies jar">
<buildJar svnString="${svn.revision}" outputFile="${output.jarfile.core}" includedJars="core.dependencies.jar"/>
<buildJar svnString="${svn.revision}" outputFile="${output.jarfile.withdependencies}" includedJars="runtime.dependencies.jar"/>
<copy file="${output.jarfile.withdependencies}" tofile="${output.jarfile.backcompat}"/>
<antcall target="include-meta" inheritRefs="true" inheritall="true"/>
</target>
<target name="include-meta" if="isHadoop23">
<copy todir="${build.classes}/META-INF">
<fileset dir="${src.dir}/META-INF" includes="**"/>
</copy>
<move file="${output.jarfile.withdependencies}" tofile="${output.stage.jarfile.withdependencies}"/>
<sleep seconds="1"/>
<jar jarfile="${output.jarfile.withdependencies}">
<manifest>
<attribute name="Main-Class" value="org.apache.pig.Main" />
<section name="org/apache/pig">
<attribute name="Implementation-Vendor" value="Apache" />
<attribute name="Implementation-Title" value="Pig" />
<attribute name="Implementation-Version" value="${version}" />
<attribute name="Build-TimeStamp" value="${timestamp}" />
<attribute name="Svn-Revision" value="${svnString}" />
</section>
</manifest>
<zipfileset src="${output.stage.jarfile.withdependencies}"/>
<fileset dir="${build.classes}" includes="META-INF/**" />
</jar>
</target>
<!-- ================================================================== -->
<!-- Make pig-withouthadoop.jar -->
<!-- ================================================================== -->
<target name="jar-withouthadoop" depends="compile,ivy-buildJar" description="Create pig withouthadoop jar">
<buildJar svnString="${svn.revision}" outputFile="${output.jarfile.core}" includedJars="core.dependencies.jar"/>
<buildJar svnString="${svn.revision}" outputFile="${output.jarfile.withouthadoop}" includedJars="runtime.dependencies-withouthadoop.jar"/>
<copy file="${output.jarfile.withouthadoop}" tofile="${output.jarfile.backcompat.withouthadoop}"/>
</target>
<scriptdef name="propertyreset" language="javascript"
description="Allows to assign @{property} new value">
<attribute name="name"/>
<attribute name="value"/>
project.setProperty(attributes.get("name"), attributes.get("value"));
</scriptdef>
<target name="mvn-jar" description="Create pig.jar for maven deploy for Hadoop2/23 and Hadoop1/20">
<propertyreset name="hadoopversion" value="23" />
<propertyreset name="isHadoop" value="true" />
<propertyreset name="src.shims.dir" value="${basedir}/shims/src/hadoop${hadoopversion}" />
<antcall target="clean" inheritRefs="true" inheritall="true"/>
<antcall target="jar" inheritRefs="true" inheritall="true"/>
<antcall target="jar-withouthadoop" inheritRefs="true" inheritall="true"/>
<!-- Move and rename pig jar for Hadoop2/23 to a different location before compiling for Hadoop1/20 -->
<move file="${output.jarfile.core}" tofile="${basedir}/${artifact.pig-h2.jar}"/>
<move file="${output.jarfile.withouthadoop}" tofile="${basedir}/${artifact.pig-withouthadoop-h2.jar}"/>
<antcall target="clean" inheritRefs="true" inheritall="true"/>
<propertyreset name="hadoopversion" value="20" />
<propertyreset name="isHadoop" value="" />
<propertyreset name="src.shims.dir" value="${basedir}/shims/src/hadoop${hadoopversion}" />
<antcall target="jar" inheritRefs="true" inheritall="true"/>
<antcall target="jar-withouthadoop" inheritRefs="true" inheritall="true"/>
<move file="${basedir}/${artifact.pig-h2.jar}" tofile="${output.jarfile.core-h2}"/>
<move file="${basedir}/${artifact.pig-withouthadoop-h2.jar}" tofile="${output.jarfile.withouthadoop-h2}"/>
</target>
<!-- ================================================================== -->
<!-- macrodef: buildJar -->
<!-- ================================================================== -->
<macrodef name="buildJar">
<attribute name="svnString"/>
<attribute name="outputFile"/>
<attribute name="includedJars"/>
<sequential>
<echo>svnString @{svnString}</echo>
<jar jarfile="@{outputFile}" basedir="${build.classes}">
<manifest>
<attribute name="Main-Class" value="org.apache.pig.Main" />
<section name="org/apache/pig">
<attribute name="Implementation-Vendor" value="Apache" />
<attribute name="Implementation-Title" value="Pig" />
<attribute name="Implementation-Version" value="${version}" />
<attribute name="Build-TimeStamp" value="${timestamp}" />
<attribute name="Svn-Revision" value="@{svnString}" />
</section>
</manifest>
<zipgroupfileset refid="@{includedJars}" />
<fileset file="${basedir}/src/pig-default.properties" />
<fileset file="${basedir}/src/main/jruby/pigudf.rb" />
<exclude name="hadoop-site.xml" />
</jar>
</sequential>
</macrodef>
<!-- ================================================================== -->
<!-- Smoke tests -->
<!-- ================================================================== -->
<target name="smoketests-jar" depends="pigunit-jar"
description="Creating jar file for smoke tests">
<echo> *** Creating smoke tests jar for pigunit ***</echo>
<jar jarfile="${smoke.tests.jarfile}" basedir="${test.build.classes}"
includes="org/apache/pig/test/pigunit/**/*">
<fileset dir="${basedir}" includes="test/data/pigunit/**/*"/>
<manifest>
<section name="org/apache/pig/test/pigunit">
<attribute name="Implementation-Vendor" value="Apache" />
<attribute name="Implementation-Title" value="Pig" />
<attribute name="Implementation-Version" value="${version}" />
<attribute name="Build-TimeStamp" value="${timestamp}" />
<attribute name="Svn-Revision" value="${svnString}" />
</section>
</manifest>
</jar>
</target>
<!-- ================================================================== -->
<!-- Make pigperf.jar -->
<!-- ================================================================== -->
<target name="pigperf" depends="compile-test" description="Create pigperf.jar">
<jar jarfile="pigperf.jar">
<fileset dir="${test.build.dir}/classes">
<include name="org/apache/pig/test/pigmix/**"/>
<include name="org/apache/pig/test/utils/datagen/*"/>
<include name="org/apache/pig/test/udf/storefunc/*"/>
</fileset>
<zipfileset src="${lib.dir}/sdsuLibJKD12.jar" />
</jar>
</target>
<!-- ================================================================== -->
<!-- Run unit tests -->
<!-- ================================================================== -->
<target name="test-core" depends="compile-test,jar-withouthadoop,debugger.check,jackson-pig-3039-test-download" description="Run full set of unit tests">
<macro-test-runner test.file="${test.all.file}" />
</target>
<target name="test-commit" depends="compile-test,jar-withouthadoop,debugger.check" description="Run approximate 10-minute set of unit tests prior to commiting">
<macro-test-runner test.file="${test.commit.file}" />
</target>
<target name="test-unit" depends="compile-test,jar-withouthadoop,debugger.check" description="Run all true unit tests">
<macro-test-runner test.file="${test.unit.file}" />
</target>
<target name="test-smoke" depends="compile-test,jar-withouthadoop,debugger.check" description="Run 30 min smoke tests">
<macro-test-runner test.file="${test.smoke.file}" />
</target>
<target name="debugger.check" depends="debugger.set,debugger.unset"/>
<target name="debugger.set" if="debugPort">
<property name="debugArgs" value="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=${debugPort}"/>
<echo>debugArgs: ${debugArgs}</echo>
</target>
<target name="debugger.unset" unless="debugPort">
<property name="debugArgs" value=""/>
</target>
<macrodef name="macro-test-runner">
<attribute name="test.file" />
<sequential>
<delete dir="${test.log.dir}"/>
<mkdir dir="${test.log.dir}"/>
<tempfile property="junit.tmp.dir" prefix="pig_junit_tmp" destDir="${java.io.tmpdir}" />
<mkdir dir="${junit.tmp.dir}/"/>
<junit showoutput="${test.output}" printsummary="yes" haltonfailure="no" fork="yes" maxmemory="1024m" dir="${basedir}" timeout="${test.timeout}" errorProperty="tests.failed" failureProperty="tests.failed">
<sysproperty key="ssh.gateway" value="${ssh.gateway}" />
<sysproperty key="hod.server" value="${hod.server}" />
<sysproperty key="java.io.tmpdir" value="${junit.tmp.dir}" />
<sysproperty key="hadoop.log.dir" value="${test.log.dir}"/>
<jvmarg line="${debugArgs}"/>
<sysproperty key="java.security.krb5.realm" value="" />
<sysproperty key="java.security.krb5.kdc" value="" />
<sysproperty key="log4j.configuration" value="file:${basedir}/conf/test-log4j.properties"/>
<env key="MALLOC_ARENA_MAX" value="4"/>
<classpath>
<pathelement location="${output.jarfile.withouthadoop}" />
<pathelement location="${test.build.classes}" />
<pathelement location="." />
<pathelement path="${clover.jar}"/>
<path refid="test.classpath"/>
</classpath>
<formatter type="${test.junit.output.format}" />
<batchtest fork="yes" todir="${test.log.dir}" unless="testcase">
<fileset dir="test">
<patternset>
<includesfile name="@{test.file}"/>
<excludesfile name="${test.exclude.file}" if="test.exclude.file"/>
<excludesfile name="${test.exclude.file.23}" if="isHadoop23" />
</patternset>
<exclude name="**/${exclude.testcase}.java" if="exclude.testcase" />
<exclude name="**/TestRegisteredJarVisibility.java" if="offline"/>
<exclude name="**/TestInvokerSpeed.java" if="clover.enabled"/>
</fileset>
</batchtest>
<batchtest fork="yes" todir="${test.log.dir}" if="testcase">
<fileset dir="test" includes="**/${testcase}.java"/>
</batchtest>
<assertions>
<enable />
</assertions>
</junit>
<delete dir="${junit.tmp.dir}/"/>
<fail if="tests.failed">Tests failed!</fail>
</sequential>
</macrodef>
<target name="test" description="to call the test-core and test-contrib target">
<antcall target="test-core" inheritRefs="true" inheritall="true"/>
</target>
<target name="test-contrib-internal" unless="testcase">
<antcall target="test-contrib" inheritRefs="true" inheritall="true"/>
</target>
<target name="test-contrib" depends="compile-test" description="to call contrib tests">
<subant target="pigtest" buildpath="contrib/zebra" antfile="build.xml"/>
</target>
<!-- ================================================================== -->
<!-- End to end tests -->
<!-- ================================================================== -->
<target name="test-e2e" depends="jar, jar-withouthadoop, piggybank" description="run end-to-end tests">
<ant dir="${test.e2e.dir}"/>
</target>
<target name="test-e2e-deploy" depends="jar, jar-withouthadoop" description="deploy end-to-end tests to existing cluster">
<ant dir="${test.e2e.dir}" target="deploy"/>
</target>
<target name="test-e2e-undeploy" depends="jar, jar-withouthadoop" description="undeploy end-to-end tests from existing cluster">
<ant dir="${test.e2e.dir}" target="undeploy"/>
</target>
<target name="test-e2e-local" depends="jar, jar-withouthadoop, piggybank" description="run end-to-end tests in local mode">
<ant dir="${test.e2e.dir}" target="test-local"/>
</target>
<target name="test-e2e-deploy-local" depends="jar, jar-withouthadoop" description="create files needed by local mode end-to-end tests">
<ant dir="${test.e2e.dir}" target="deploy-local"/>
</target>
<target name="pigmix-deploy" depends="jar, jar-withouthadoop" description="deploy end-to-end tests to existing cluster">
<ant dir="${pigmix.dir}" target="deploy"/>
</target>
<target name="pigmix" depends="jar, jar-withouthadoop, piggybank" description="run end-to-end tests">
<ant dir="${pigmix.dir}" target="test"/>
</target>
<!-- ================================================================== -->
<!-- Pigunit -->
<!-- ================================================================== -->
<target name="pigunit-jar" depends="compile-test, ivy-test" description="create the pigunit jar file">
<echo> *** Creating pigunit.jar ***</echo>
<jar destfile="${pigunit.jarfile}">
<fileset dir="${test.build.classes}">
<include name="**/org/apache/pig/pigunit/**"/>
<include name="**/org/apache/pig/test/Util.**"/>
</fileset>
<zipfileset src="${ivy.lib.dir}/commons-lang-${commons-lang.version}.jar" />
</jar>
</target>
<target name="test-pigunit" depends="compile-test,jar-withouthadoop, pigunit-jar" description="Run tests that test PigUnit">
<macro-test-runner test.file="${test.pigunit.file}" />
</target>
<!-- ================================================================== -->
<!-- Distribution -->
<!-- ================================================================== -->
<target name="package" depends="docs, api-report, jar, piggybank" description="Create a Pig tar release">
<mkdir dir="${tar.dist.dir}" />
<mkdir dir="${tar.dist.dir}/lib" />
<mkdir dir="${tar.dist.dir}/conf" />
<mkdir dir="${tar.dist.dir}/scripts" />
<mkdir dir="${tar.dist.dir}/docs" />
<mkdir dir="${tar.dist.dir}/docs/api" />
<mkdir dir="${tar.dist.dir}/docs/jdiff"/>
<mkdir dir="${tar.dist.dir}/license" />
<copy todir="${tar.dist.dir}/lib" includeEmptyDirs="false">
<fileset dir="${lib.dir}"/>
</copy>
<copy todir="${tar.dist.dir}/lib">
<fileset dir="${ivy.lib.dir}" includes="jython*.jar"/>
</copy>
<copy file="${output.jarfile.backcompat.withouthadoop}" tofile="${tar.dist.dir}/${final.name}-withouthadoop.jar" />
<copy file="${output.jarfile.backcompat}" tofile="${tar.dist.dir}/${final.name}.jar" />