-
Notifications
You must be signed in to change notification settings - Fork 450
/
build.xml
1916 lines (1711 loc) · 95.1 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"
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 -->
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="${basedir}/ivy/ant-contrib-1.0b3.jar"/>
</classpath>
</taskdef>
<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.19.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-2016" />
<!-- source properties -->
<property name="lib.dir" value="${basedir}/lib" />
<property name="spark.lib.dir" value="${basedir}/lib/spark" />
<property name="src.dir" value="${basedir}/src" />
<property name="python.src.dir" value="${src.dir}/python" />
<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" />
<property name="legacy.dir" value="${basedir}/legacy" />
<!-- 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.8" />
<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-h3.jar" value="${final.name}-h3.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.withouthadoop" value="${build.dir}/${final.name}-withouthadoop.jar" />
<property name="output.jarfile.withouthadoop-h2" value="${legacy.dir}/${final.name}-withouthadoop-h2.jar" />
<property name="output.jarfile.withouthadoop-h3" value="${legacy.dir}/${final.name}-withouthadoop-h3.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.core-h3" value="${build.dir}/${artifact.pig-h3.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-core-h2" value="${basedir}/${final.name}-core-h2.jar" />
<property name="output.jarfile.backcompat-core-h3" value="${basedir}/${final.name}-core-h3.jar" />
<!-- test properties -->
<condition property="test.exec.type" value="${exectype}" else="mr">
<!-- By default, test.exec.type is mr -->
<isset property="exectype"/>
</condition>
<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.spark.file" value="${test.src.dir}/spark-tests"/>
<property name="test.spark_local.file" value="${test.src.dir}/spark-local-tests"/>
<property name="test.exclude.file" value="${test.src.dir}/excluded-tests"/>
<property name="test.exclude.file.mr" value="${test.src.dir}/excluded-tests-mr"/>
<property name="test.exclude.file.tez" value="${test.src.dir}/excluded-tests-tez"/>
<property name="test.exclude.file.spark" value="${test.src.dir}/excluded-tests-spark"/>
<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"/>
<property name="pigtest.jarfile" value="pigtest.jar" />
<!-- test configuration, use ${user.home}/build.properties to configure values -->
<property name="ssh.gateway" value="" />
<property name="hod.server" value="" />
<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"/>
<!-- env properties -->
<property environment="env"/>
<condition property="isWindows">
<os family="windows"/>
</condition>
<target name="setTezEnv">
<propertyreset name="test.timeout" value="900000" />
<propertyreset name="src.shims.dir" value="${basedir}/shims/src/hadoop2" />
<propertyreset name="src.shims.test.dir" value="${basedir}/shims/test/hadoop2" />
<propertyreset name="test.exec.type" value="tez" />
</target>
<target name="setSparkEnv">
<propertyreset name="test.exec.type" value="spark" />
</target>
<target name="setWindowsPath" if="${isWindows}">
<property name="build.path" value="${env.Path};${hadoop.root}\bin" />
</target>
<target name="setLinuxPath" unless="${isWindows}">
<property name="build.path" value="${env.PATH};" />
</target>
<!-- 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" />
<property name="loglevel" value="quiet" />
<!--
Hadoop master version
(Value 23 is translated for backward compatibility in old build scripts)
-->
<if>
<equals arg1="${hadoopversion}" arg2="23"/>
<then>
<echo>Property setting hadoopversion=23 is deprecated. Overwriting to hadoopversion=2</echo>
<var name="hadoopversion" unset="true"/>
<property name="hadoopversion" value="2" />
</then>
</if>
<property name="hadoopversion" value="2" />
<condition property="isHadoop2">
<equals arg1="${hadoopversion}" arg2="2"/>
</condition>
<condition property="isHadoop3">
<equals arg1="${hadoopversion}" arg2="3"/>
</condition>
<!--
HBase master version
(Value 95 is translated for backward compatibility in old build scripts)
-->
<if>
<equals arg1="${hbaseversion}" arg2="95"/>
<then>
<echo>Property setting hbaseversion=95 is deprecated. Overwriting to hbaseversion=1</echo>
<var name="hbaseversion" unset="true"/>
<property name="hbaseversion" value="1" />
</then>
</if>
<property name="hbaseversion" value="1" />
<property name="sparkversion" value="2" />
<property name="hiveversion" value="1" />
<loadproperties srcfile="${ivy.dir}/libraries.properties"/>
<property name="src.shims.dir" value="${basedir}/shims/src/hadoop2" />
<property name="src.shims.test.dir" value="${basedir}/shims/test/hadoop2" />
<property name="src.hive.shims.dir" value="${basedir}/shims/src/hive${hiveversion}" />
<property name="asfrepo" value="https://repository.apache.org"/>
<property name="asfsnapshotrepo" value="${asfrepo}/content/repositories/snapshots"/>
<property name="mvnrepo" value="https://repo1.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="ivy.lib.dir.spark" location="${ivy.lib.dir}/spark" />
<property name="build.ivy.report.dir" location="${build.ivy.dir}/report" />
<property name="build.ivy.maven.dir" location="${build.ivy.dir}/maven" />
<property name="build.ivy.owasp.dir" location="${build.ivy.dir}/owasp" />
<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"/>
<property name="test.spark.spark_master" value="yarn" />
<!--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}/xercesImpl-${xerces.version}.jar"/>
<property name="jdiff.build.dir" value="${build.docs}/jdiff"/>
<property name="jdiff.xml.dir" value="${docs.dir}/jdiff"/>
<property name="jdiff.stable" value="0.17.0"/>
<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="isSpark">
<equals arg1="${test.exec.type}" arg2="spark"/>
</condition>
<condition property="isSpark3">
<and>
<equals arg1="${test.exec.type}" arg2="spark"/>
<resourcecount when="greater" count="0">
<fileset dir="${ivy.lib.dir.spark}" includes="spark*-3*.jar"/>
</resourcecount>
</and>
</condition>
<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="compile-test,ant-eclipse-download"
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="${ivy.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="${test.e2e.dir}/udfs/java"/>
<source path="${src.shims.dir}"/>
<source path="${src.shims.test.dir}"/>
<source path="${src.hive.shims.dir}"/>
<source path="tutorial/src"/>
<source path="${test.src.dir}" excluding="e2e/pig/udfs/java/|resources/|perf/"/>
<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="compileclasspath">
<fileset file="${ivy.lib.dir}/${zookeeper.jarfile}"/>
<fileset dir="${ivy.lib.dir}" includes="*.jar"/>
<fileset dir="${ivy.lib.dir.spark}" includes="*.jar"/>
</path>
<path id="runtimeclasspath">
<fileset file="${ivy.lib.dir}/${zookeeper.jarfile}"/>
<fileset dir="${ivy.lib.dir}">
<include name="*.jar"/>
<exclude name="reload4j*.jar" if="isSpark3"/>
<exclude name="orc-core*.jar" if="isSpark3"/>
<exclude name="orc-shim*.jar" if="isSpark3"/>
<exclude name="threeten*.jar" if="isSpark3"/>
</fileset>
<fileset dir="${ivy.lib.dir.spark}">
<include name="*.jar" if="isSpark"/>
</fileset>
</path>
<!-- javadoc-classpath -->
<path id="javadoc-classpath">
<path refid="javadoc.classpath"/>
</path>
<path id="test.compileclasspath">
<!-- need to put this first, otherwise junit-3 testcases can break -->
<pathelement location="${ivy.lib.dir}/junit-3.8.1.jar"/>
<pathelement location="${build.classes}"/>
<pathelement location="${test.src.dir}"/>
<pathelement location="${piggybank.jarfile}"/>
<path refid="compileclasspath"/>
</path>
<path id="test.runtimeclasspath">
<!-- need to put this first, otherwise junit-3 testcases can break -->
<pathelement location="${ivy.lib.dir}/junit-3.8.1.jar"/>
<pathelement location="${build.classes}"/>
<pathelement location="${test.src.dir}"/>
<pathelement location="${piggybank.jarfile}"/>
<path refid="runtimeclasspath"/>
</path>
<fileset dir="${ivy.lib.dir}" id="core.dependencies.jar">
<exclude name="**.*jar"/>
<exclude name="spark/**.*jar"/>
</fileset>
<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="joda-time-${joda-time.version}.jar"/>
<include name="automaton-${automaton.version}.jar"/>
<include name="jansi-${jansi.version}.jar"/>
<include name="RoaringBitmap-shaded-${roaring-bitmap-shaded.version}.jar"/>
</patternset>
</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}" />
<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>
<fileset dir="${basedir}" includes="pig*.jar" />
</delete>
<delete dir="${lib.dir}" />
<delete dir="${legacy.dir}" />
<ant dir="${test.e2e.dir}" target="clean"/>
</target>
<target name="clean-deps" description="Cleanup dependencies">
<delete dir="${lib.dir}" />
<delete dir="${ivy.lib.dir}" />
</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-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">
<move file="${ivy.lib.dir}/javacc-${javacc.version}.jar" tofile="${javacc.home}/javacc.jar"/>
<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}" />
<move file="${javacc.home}/javacc.jar" tofile="${ivy.lib.dir}/javacc-${javacc.version}.jar"/>
</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="compileclasspath" 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="compileclasspath" 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="compileclasspath" 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>
<echo>*** Hadoop version used: ${hadoopversion} ; HBase version used: ${hbaseversion} ; Spark version used: ${sparkversion} ; Hive version used: ${hiveversion} ***</echo>
<compileSources sources="${src.dir};${src.gen.dir};${src.lib.dir}/bzip2;${src.shims.dir};${src.hive.shims.dir}"
excludes="${src.exclude.dir}" dist="${build.classes}" cp="compileclasspath" warnings="${javac.args.warnings}" />
<copy todir="${build.classes}/META-INF">
<fileset dir="${src.dir}/META-INF" includes="**"/>
</copy>
</target>
<target name="compile-test" depends="jar, 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/** ${src.exclude.dir}"
dist="${test.build.classes}" cp="test.compileclasspath" 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"/>
<copy todir="${build.classes}/python">
<fileset dir="${python.src.dir}"/>
</copy>
</sequential>
</macrodef>
<!-- ================================================================== -->
<!-- Documentation -->
<!-- ================================================================== -->
<target name="javadoc" depends="jar, 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, piggybank, ivy-javadoc" description="Create documentation including all contrib projects">
<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}" />
<packageset dir="contrib/piggybank/java/src/main/java"/>
<link href="${javadoc.link.java}" />
<classpath>
<path refid="javadoc-classpath" />
<pathelement path="${output.jarfile.core}" />
<pathelement path="${piggybank.jarfile}"/>
</classpath>
<group title="pig" packages="org.apache.pig*" />
<group title="contrib: Piggybank" packages="org.apache.pig.piggybank*" />
</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}/bzip2"/>
<fileset dir="${python.src.dir}"/>
</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>
<!-- ================================================================== -->
<!-- Make pig.jar -->
<!-- ================================================================== -->
<target name="jar" depends="compile,ivy-buildJar" description="Create pig core 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"/>
<antcall target="copyCommonDependencies"/>
<antcall target="copySparkDependencies"/>
<antcall target="copyh2Dependencies"/>
<antcall target="copyHadoop2LocalRuntimeDependencies" />
<antcall target="copyh3Dependencies"/>
<antcall target="copyHadoop3LocalRuntimeDependencies" />
</target>
<target name="copyCommonDependencies">
<mkdir dir="${lib.dir}" />
<copy todir="${lib.dir}">
<fileset dir="${ivy.lib.dir}" includes="antlr-runtime-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="ST4-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="jline-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="jackson-mapper-asl-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="jackson-core-asl-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="jackson-xc-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="joda-time-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="guava-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="automaton-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="jansi-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="avro-*.jar" excludes="avro-*tests.jar,avro-mapred-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="trevni-core-*.jar" excludes="trevni-core-*tests.jar"/>
<fileset dir="${ivy.lib.dir}" includes="trevni-avro-*.jar" excludes="trevni-avro-*tests.jar"/>
<fileset dir="${ivy.lib.dir}" includes="snappy-java-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="asm*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="jython-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="jruby-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="groovy-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="js-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="htrace-core*incubating.jar"/>
<fileset dir="${ivy.lib.dir}" includes="metrics-core-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="hbase-*.jar" excludes="hbase-*tests.jar,hbase-*hadoop2*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="hive-*.jar" excludes="hive-shims-0.*.jar, hive-contrib*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="minlog-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="protobuf-java-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="zookeeper-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="accumulo-*.jar" excludes="accumulo-minicluster*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="json-simple-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="kryo-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="httpdlog-*-${basjes-httpdlog-pigloader.version}.jar"/>
<fileset dir="${ivy.lib.dir}" includes="parser-core-${basjes-httpdlog-pigloader.version}.jar"/>
<fileset dir="${ivy.lib.dir}" includes="ivy-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="commons-logging-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="RoaringBitmap-shaded-${roaring-bitmap-shaded.version}.jar"/>
</copy>
</target>
<target name="copySparkDependencies">
<mkdir dir="${spark.lib.dir}" />
<copy todir="${spark.lib.dir}">
<fileset dir="${ivy.lib.dir.spark}" includes="*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="jackson-*.jar"/>
</copy>
</target>
<target name="copyh2Dependencies" unless="isHadoop3">
<mkdir dir="${lib.dir}/h2" />
<copy todir="${lib.dir}/h2">
<fileset dir="${ivy.lib.dir}" includes="avro-mapred-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="hive-shims-0.*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="hbase-hadoop2*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="tez-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="commons-collections4-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="commons-lang3-*.jar"/>
</copy>
<copy file="${output.jarfile.core}" tofile="${output.jarfile.backcompat-core-h2}"/>
<mkdir dir="${legacy.dir}" />
<move file="${output.jarfile.withouthadoop}" tofile="${output.jarfile.withouthadoop-h2}"/>
</target>
<target name="copyHadoop2LocalRuntimeDependencies" unless="isHadoop3">
<mkdir dir="${lib.dir}/hadoop2-runtime" />
<copy todir="${lib.dir}/hadoop2-runtime">
<fileset dir="${ivy.lib.dir}" includes="hadoop-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="commons-cli-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="commons-configuration-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="commons-collections-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="commons-lang*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="commons-codec-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="commons-io-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="commons-logging-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="httpcore-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="reload4j-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="slf4j-*.jar"/>
</copy>
</target>
<target name="copyh3Dependencies" if="isHadoop3">
<mkdir dir="${lib.dir}/h3" />
<copy todir="${lib.dir}/h3">
<fileset dir="${ivy.lib.dir}" includes="avro-mapred-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="hive-shims-0.*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="hbase-hadoop2*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="tez-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="commons-collections4-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="orc-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="threeten-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="aircompressor-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="junit-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="hamcrest-*.jar"/>
</copy>
<copy file="${output.jarfile.core}" tofile="${output.jarfile.backcompat-core-h3}"/>
<mkdir dir="${legacy.dir}" />
<move file="${output.jarfile.withouthadoop}" tofile="${output.jarfile.withouthadoop-h3}"/>
</target>
<target name="copyHadoop3LocalRuntimeDependencies" if="isHadoop3">
<mkdir dir="${lib.dir}/hadoop3-runtime" />
<copy todir="${lib.dir}/hadoop3-runtime">
<fileset dir="${ivy.lib.dir}" includes="hadoop-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="commons-cli-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="commons-configuration-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="commons-collections-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="commons-lang-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="commons-codec-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="commons-io-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="commons-logging-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="httpclient-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="httpcore-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="reload4j-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="slf4j-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="re2j-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="woodstox-core-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="stax2-api-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="commons-configuration2-*.jar"/>
<fileset dir="${ivy.lib.dir}" includes="jackson-*.jar"/>
</copy>
</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>
<macrodef name="propertycopy">
<attribute name="name"/>
<attribute name="from"/>
<sequential>
<propertyreset name="@{name}" value="${@{from}}"/>
</sequential>
</macrodef>
<target name="jar-core" depends="compile,ivy-buildJar" description="Create only pig core jar">
<buildJar svnString="${svn.revision}" outputFile="${output.jarfile.core}" includedJars="core.dependencies.jar"/>
</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}" duplicate="preserve">
<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" />
<fileset file="${basedir}/conf/ivysettings.xml" />
<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="test/perf/pigmix/lib/sdsuLibJKD12.jar" />
</jar>
</target>
<!-- ================================================================== -->
<!-- Run unit tests -->
<!-- ================================================================== -->
<target name="test-core" depends="setWindowsPath,setLinuxPath,compile-test,pigtest-jar,debugger.check,jackson-pig-3039-test-download" description="Run full set of unit tests">
<macro-test-runner test.file="${test.all.file}" tests.failed="test-core.failed" />
<fail if="test-core.failed">Tests failed!</fail>
</target>
<target name="test-commit" depends="setWindowsPath,setLinuxPath,compile-test,pigtest-jar,debugger.check" description="Run approximate 10-minute set of unit tests prior to commiting">
<macro-test-runner test.file="${test.commit.file}" tests.failed="test-commit.failed"/>
<fail if="test-commit.failed">Tests failed!</fail>
</target>
<target name="test-unit" depends="setWindowsPath,setLinuxPath,compile-test,pigtest-jar,debugger.check" description="Run all true unit tests">
<macro-test-runner test.file="${test.unit.file}" tests.failed="test-unit.failed"/>
<fail if="test-unit.failed">Tests failed!</fail>
</target>
<target name="test-smoke" depends="setWindowsPath,setLinuxPath,compile-test,pigtest-jar,debugger.check" description="Run 30 min smoke tests">
<macro-test-runner test.file="${test.smoke.file}" tests.failed="test-smoke.failed"/>
<fail if="test-smoke.failed">Tests failed!</fail>
</target>
<target name="test-tez" depends="setTezEnv,setWindowsPath,setLinuxPath,compile-test,debugger.check,jackson-pig-3039-test-download" description="Run tez unit tests">
<macro-test-runner test.file="${test.all.file}" tests.failed="test-tez.failed"/>
<fail if="test-tez.failed">Tests failed!</fail>
</target>
<target name="test-spark" depends="setSparkEnv,setWindowsPath,setLinuxPath,compile-test,pigtest-jar,debugger.check,jackson-pig-3039-test-download" description="Run Spark unit tests in Spark cluster-local mode">
<macro-test-runner test.file="${test.all.file}" tests.failed="test-spark.failed"/>
<fail if="test-spark.failed">Tests failed!</fail>
</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">