-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
1033 lines (912 loc) · 50.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: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="version" value="0.7.1-dev" />
<property name="final.name" value="${name}-${version}" />
<condition property="isWindows">
<os family="windows"/>
</condition>
<!-- 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="dist.dir" value="${build.dir}/${final.name}" />
<!-- property name="build.encoding" value="ISO-8859-1" / -->
<property name="build.encoding" value="UTF8" />
<!-- TODO with only one version of hadoop in the lib folder we do not need that anymore -->
<!--property name="hadoop.jarfile" value="hadoop20.jar" /-->
<property name="hbase.jarfile" value="hbase-0.20.0.jar" />
<property name="hbase.test.jarfile" value="hbase-0.20.0-test.jar" />
<property name="zookeeper.jarfile" value="zookeeper-hbase-1329.jar" />
<!-- 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="" />
<!-- default warnings option -->
<property name="javac.args.warnings" value="-Xmaxwarns 1000000" />
<!-- warnings option if all.warnings property is set on cmdline -->
<property name="javac.args.all.warnings" value="-Xmaxwarns 1000000 -Xlint -Xlint:-deprecation" />
<!-- 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" value="${build.dir}/${final.name}.jar" />
<property name="output.jarfile.withouthadoop" value="${build.dir}/${final.name}-withouthadoop.jar" />
<property name="output.jarfile.core" value="${build.dir}/${final.name}-core.jar" />
<property name="output.jarfile.sources" value="${build.dir}/${final.name}-sources.jar" />
<!-- Maintain old pig.jar in top level directory. -->
<property name="output.jarfile.backcompat.withouthadoop" value="${basedir}/${name}-withouthadoop.jar" />
<property name="output.jarfile.backcompat" value="${basedir}/${name}.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="2700000" />
<property name="test.junit.output.format" value="plain" />
<property name="test.commit.file" value="${test.src.dir}/commit-tests"/>
<property name="test.all.file" value="${test.src.dir}/all-tests"/>
<!-- test configuration, use ${user.home}/build.properties to configure values -->
<property name="ssh.gateway" value="" />
<property name="hod.server" value="" />
<property name="junit.hadoop.conf" value="" />
<property name="test.log.dir" value="${basedir}/test/logs"/>
<property name="junit.hadoop.conf" value="${user.home}/pigtest/conf/"/>
<property name="test.output" value="no"/>
<!-- javacc 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" />
<!-- rats properties -->
<property name="rat.reporting.classname" value="rat.Report"/>
<!-- javadoc properties -->
<property name="javadoc.link.java" value="http://java.sun.com/j2se/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.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>
<!-- IVY properteis set here -->
<property name="ivy.dir" location="ivy" />
<loadproperties srcfile="${ivy.dir}/libraries.properties"/>
<property name="ivy.jar" location="${ivy.dir}/ivy-${ivy.version}.jar"/>
<property name="ivy_repo_url" value="http://repo2.maven.org/maven2/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="dist.dir" value="${build.dir}/${final.name}"/>
<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="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}.jar" />
<property name="javacc.home" location="${ivy.lib.dir}" />
<!--this is the naming policy for artifacts we want pulled down-->
<property name="ivy.artifact.retrieve.pattern" value="${ant.project.name}/[artifact]-[revision].[ext]"/>
<!--this is how artifacts that get built are named-->
<property name="ivy.publish.pattern" value="pig-[revision].[ext]"/>
<property name="pig.jar" value="${output.jarfile.core}"/>
<!-- 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.3.1"/>
<property name="jdiff.stable.javadoc" value="http://hadoop.apache.org/${name}/docs/r${jdiff.stable}/api/"/>
<!-- ====================================================== -->
<!-- Stuff needed by all targets -->
<!-- ====================================================== -->
<!-- setup the classpath -->
<path id="classpath">
<path refid="compile.classpath"/>
<fileset file="${lib.dir}/*" />
<fileset file="${lib.dir}/${hbase.jarfile}" />
<fileset file="${lib.dir}/${hbase.test.jarfile}" />
<fileset file="${lib.dir}/${zookeeper.jarfile}"/>
<fileset file="${ivy.lib.dir}/jackson-mapper-asl-${jackson.version}.jar"/>
<fileset file="${ivy.lib.dir}/jackson-core-asl-${jackson.version}.jar"/>
<fileset file="${ivy.lib.dir}/joda-time-${joda-time.version}.jar" />
<!-- <fileset file="${lib.dir}/commons-collections-3.2.jar" /> -->
</path>
<!-- javadoc-classpath -->
<path id="javadoc-classpath">
<fileset file="${lib.dir}/${hbase.jarfile}" />
<fileset file="${lib.dir}/${hbase.test.jarfile}" />
<path refid="javadoc.classpath"/>
</path>
<path id="test.classpath">
<pathelement location="${build.classes}"/>
<pathelement location="${test.src.dir}"/>
<path refid="classpath"/>
<path refid="test-classpath"/>
</path>
<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="${dist.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"/>
</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}" />
</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"/>
<jjtree target="${src.dir}/org/apache/pig/impl/logicalLayer/parser/QueryParser.jjt" outputdirectory="${src.gen.query.parser.dir}" javacchome="${javacc.home}" />
<javacc target="${src.gen.query.parser.dir}/QueryParser.jj" outputdirectory="${src.gen.query.parser.dir}" javacchome="${javacc.home}" />
<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>
<!-- ================================================================== -->
<!-- Build sources -->
<!-- ================================================================== -->
<target name="compile" depends="cc-compile" 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>*** If all.warnings property is supplied, compile-sources-all-warnings target will be executed ***</echo>
<echo>*** Else, compile-sources (which only warns about deprecations) target will be executed ***</echo>
<antcall target="compile-sources" inheritRefs="true" inheritall="true">
<param name="sources" value="${src.dir};${src.gen.dir};${src.lib.dir}/shock;${src.lib.dir}/bzip2" />
<param name="dist" value="${build.classes}" />
<param name="cp" value="classpath" />
</antcall>
<antcall target="compile-sources-all-warnings" inheritRefs="true" inheritall="true">
<param name="sources" value="${src.dir};${src.gen.dir};${src.lib.dir}/shock;${src.lib.dir}/bzip2" />
<param name="dist" value="${build.classes}" />
<param name="cp" value="classpath" />
</antcall>
</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>*** If all.warnings property is supplied, compile-sources-all-warnings target will be executed ***</echo>
<echo>*** Else, compile-sources (which only warns about deprecations) target will be executed ***</echo>
<antcall target="compile-sources" inheritRefs="true" inheritall="true">
<param name="sources" value="${test.src.dir}" />
<param name="dist" value="${test.build.classes}" />
<param name="cp" value="test.classpath" />
</antcall>
<antcall target="compile-sources-all-warnings" inheritRefs="true" inheritall="true">
<param name="sources" value="${test.src.dir}" />
<param name="dist" value="${test.build.classes}" />
<param name="cp" value="test.classpath" />
</antcall>
<copy file="${basedir}/test/hbase-site.xml" tofile="${test.build.classes}/hbase-site.xml"/>
</target>
<!-- This target is for default compilation -->
<target name="compile-sources" unless="all.warnings">
<javac encoding="${build.encoding}" srcdir="${sources}"
includes="**/*.java" destdir="${dist}" debug="${javac.debug}"
optimize="${javac.optimize}" target="${javac.version}"
source="${javac.version}" deprecation="${javac.deprecation}">
<compilerarg line="${javac.args} ${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"/>
</target>
<!-- this target is for compilation with all warnings enabled -->
<target name="compile-sources-all-warnings" if="all.warnings">
<javac encoding="${build.encoding}" srcdir="${sources}"
includes="**/*.java" destdir="${dist}" debug="${javac.debug}"
optimize="${javac.optimize}" target="${javac.version}"
source="${javac.version}" deprecation="${javac.deprecation}">
<compilerarg line="${javac.args} ${javac.args.all.warnings} "/>
<classpath refid="${cp}" />
</javac>
</target>
<!-- ================================================================== -->
<!-- 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}" />
</classpath>
<group title="pig" packages="org.apache.*" />
</javadoc>
</target>
<target name="javadoc-all" depends="jar, 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}" />
<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>
<!-- ================================================================== -->
<!-- @depricated, 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">
<env key="JAVA_HOME" value="${java5.home}"/>
</exec>
<copy todir="${build.docs}">
<fileset dir="${docs.dir}/build/site/" />
</copy>
</target>
<target name="forrest.check" unless="forrest.home" depends="java5.check">
<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="java5.check" unless="java5.home">
<fail message="'java5.home' is not defined. Forrest requires Java 5.
Please pass -Djava5.home=<base of Java 5 distribution> to Ant on the command-line." />
</target>
<target name="source-jar" depends="cc-compile">
<jar duplicate="preserve" jarfile="${output.jarfile.sources}" basedir="${src.dir}">
<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.gen.dir}"/>
<fileset dir="${src.lib.dir}/shock"/>
<fileset dir="${src.lib.dir}/bzip2"/>
</jar>
</target>
<!-- ================================================================== -->
<!-- Make pig.jar -->
<!-- ================================================================== -->
<!-- TODO we should also exculte test here... -->
<!-- ================================================================== -->
<target name="jar" depends="compile" description="Create pig jar">
<antcall target="jarWithSvn" inheritRefs="true" inheritall="true"/>
<antcall target="jarWithOutSvn" inheritRefs="true" inheritall="true"/>
</target>
<target name="jarWithSvn" if="svn.revision">
<antcall target="buildJar" inheritRefs="true" inheritall="true">
<param name="svnString" value="${svn.revision}" />
</antcall>
</target>
<target name="jarWithOutSvn" unless="svn.revision">
<antcall target="buildJar" inheritRefs="true" inheritall="true">
<param name="svnString" value=": unknown" />
</antcall>
</target>
<target name="buildJar" depends="ivy-buildJar">
<echo>svnString ${svnString}</echo>
<jar jarfile="${output.jarfile.core}" 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>
</jar>
<!-- @depricated -->
<jar jarfile="${output.jarfile}" 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>
<!--zipfileset src="${lib.dir}/*" /-->
<zipfileset src="${ivy.lib.dir}/junit-${junit.version}.jar" />
<zipfileset src="${ivy.lib.dir}/jsch-${jsch.version}.jar" />
<zipfileset src="${ivy.lib.dir}/jline-${jline.version}.jar" />
<zipfileset src="${ivy.lib.dir}/jackson-mapper-asl-${jackson.version}.jar" />
<zipfileset src="${ivy.lib.dir}/jackson-core-asl-${jackson.version}.jar" />
<zipfileset src="${ivy.lib.dir}/joda-time-${joda-time.version}.jar" />
</jar>
<copy file="${output.jarfile}" tofile="${output.jarfile.backcompat}"/>
</target>
<!-- ================================================================== -->
<!-- Make pig-withouthadoop.jar -->
<!-- ================================================================== -->
<target name="jar-withouthadoop" depends="compile" description="Create pig jar withouthadoop">
<antcall target="jar-withouthadoopWithSvn" inheritRefs="true" inheritall="true"/>
<antcall target="jar-withouthadoopWithOutSvn" inheritRefs="true" inheritall="true"/>
</target>
<target name="jar-withouthadoopWithSvn" if="svn.revision">
<antcall target="buildJar-withouthadoop" inheritRefs="true" inheritall="true">
<param name="svnString" value="${svn.revision}" />
</antcall>
</target>
<target name="jar-withouthadoopWithOutSvn" unless="svn.revision">
<antcall target="buildJar-withouthadoop" inheritRefs="true" inheritall="true">
<param name="svnString" value=": unknown" />
</antcall>
</target>
<target name="buildJar-withouthadoop" depends="ivy-buildJar">
<echo>svnString ${svnString}</echo>
<jar jarfile="${output.jarfile.core}" 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>
</jar>
<!-- @depricated -->
<jar jarfile="${output.jarfile.withouthadoop}" 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>
<zipfileset src="${ivy.lib.dir}/junit-${junit.version}.jar" />
<zipfileset src="${ivy.lib.dir}/jsch-${jsch.version}.jar" />
<zipfileset src="${ivy.lib.dir}/jline-${jline.version}.jar" />
<zipfileset src="${ivy.lib.dir}/jackson-mapper-asl-${jackson.version}.jar" />
<zipfileset src="${ivy.lib.dir}/jackson-core-asl-${jackson.version}.jar" />
<zipfileset src="${ivy.lib.dir}/joda-time-${joda-time.version}.jar" />
</jar>
<copy file="${output.jarfile.withouthadoop}" tofile="${output.jarfile.backcompat.withouthadoop}"/>
</target>
<!-- ================================================================== -->
<!-- Run unit tests -->
<!-- ================================================================== -->
<target name="test-core" depends="compile-test,jar-withouthadoop" 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" description="Run approximate 10-minute set of unit tests prior to commiting">
<macro-test-runner test.file="${test.commit.file}" />
</target>
<macrodef name="macro-test-runner">
<attribute name="test.file" />
<sequential>
<delete dir="${test.log.dir}"/>
<mkdir dir="${test.log.dir}"/>
<junit showoutput="${test.output}" printsummary="yes" haltonfailure="no" fork="yes" maxmemory="256m" 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="hod.command" value="${hod.command}"/>
<sysproperty key="hod.param" value="${hod.param}"/> -->
<sysproperty key="hadoop.log.dir" value="${test.log.dir}"/>
<classpath>
<pathelement location="${output.jarfile.withouthadoop}" />
<pathelement location="${test.build.classes}" />
<pathelement location="${junit.hadoop.conf}" />
<pathelement path="${clover.jar}"/>
<path refid="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}"/>
</patternset>
<!--include name="**/*Test*.java" /-->
<!-- Excluced because they are end-to-end, don't work yet. -->
<!--
<exclude name="**/TestFilterOpNumeric.java" />
<exclude name="**/TestPigFile.java" />
<exclude name="**/TestStoreOld.java" />
-->
<!-- Excluded under Windows.-->
<exclude name="**/TestHBaseStorage.java" if="isWindows" />
<!-- Excluced because we don't want to run them -->
<exclude name="**/PigExecTestCase.java" />
<exclude name="**/TypeCheckingTestUtil.java" />
<exclude name="**/TypeGraphPrinter.java" />
<exclude name="**/LogicalPlanTester.java" />
<exclude name="**/TestHelper.java" />
<exclude name="**/TestLargeFile.java" />
<exclude name="**/TestOrderBy.java" />
<exclude name="**/TestOrderBy2.java" />
<exclude name="**/TestPi.java" />
<exclude name="**/nightly/**" />
<exclude name="**/${exclude.testcase}.java" if="exclude.testcase" />
</fileset>
</batchtest>
<batchtest fork="yes" todir="${test.log.dir}" if="testcase">
<fileset dir="test" includes="**/${testcase}.java"/>
</batchtest>
</junit>
<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"/>
<antcall target="test-contrib" inheritRefs="true" inheritall="true"/>
</target>
<target name="test-contrib" description="to call contrib tests">
<!--#### test-contrib is yet to be implemented #### -->
</target>
<!-- ================================================================== -->
<!-- D I S T R I B U T I O N -->
<!-- ================================================================== -->
<target name="package" depends="docs, api-report" description="Create a Pig release">
<mkdir dir="${dist.dir}" />
<mkdir dir="${dist.dir}/lib" />
<mkdir dir="${dist.dir}/conf" />
<mkdir dir="${dist.dir}/scripts" />
<mkdir dir="${dist.dir}/docs" />
<mkdir dir="${dist.dir}/docs/api" />
<mkdir dir="${dist.dir}/docs/jdiff"/>
<mkdir dir="${dist.dir}/license" />
<copy todir="${dist.dir}/lib" includeEmptyDirs="false">
<!--fileset dir="${ivy.lib.dir}"/-->
<fileset dir="${lib.dir}"/>
</copy>
<copy file="${output.jarfile.backcompat}" tofile="${dist.dir}/${final.name}-core.jar" />
<copy todir="${dist.dir}/" file="ivy.xml" />
<copy todir="${dist.dir}/ivy">
<fileset dir="ivy" />
</copy>
<copy todir="${dist.dir}/bin">
<fileset dir="bin" />
</copy>
<copy todir="${dist.dir}/docs">
<fileset dir="${build.docs}" />
</copy>
<copy todir="${dist.dir}/conf" file="conf/pig.properties"/>
<copy todir="${dist.dir}/src" includeEmptyDirs="true">
<fileset dir="${src.dir}" />
</copy>
<copy todir="${dist.dir}/lib-src" includeEmptyDirs="true">
<fileset dir="${src.lib.dir}" />
</copy>
<copy todir="${dist.dir}/test" includeEmptyDirs="true">
<fileset dir="${test.src.dir}" />
</copy>
<copy todir="${dist.dir}/tutorial" includeEmptyDirs="true">
<fileset dir="tutorial" />
</copy>
<copy todir="${dist.dir}/contrib" includeEmptyDirs="true">
<fileset dir="contrib" />
</copy>
<copy todir="${dist.dir}/" file="build.xml" />
<copy todir="${dist.dir}">
<fileset dir=".">
<include name="*.txt" />
</fileset>
</copy>
<copy todir="${dist.dir}/license">
<fileset dir="license" />
</copy>
<chmod perm="ugo+x" type="file">
<fileset dir="${dist.dir}/bin" />
</chmod>
</target>
<!-- ================================================================== -->
<!-- Make release tarball -->
<!-- ================================================================== -->
<target name="tar" depends="package" description="Create release tarball">
<tar compression="gzip" longfile="gnu" destfile="${build.dir}/${final.name}.tar.gz">
<tarfileset dir="${build.dir}" mode="664">
<exclude name="${final.name}/bin/*" />
<include name="${final.name}/**" />
</tarfileset>
<tarfileset dir="${build.dir}" mode="755">
<include name="${final.name}/bin/*" />
</tarfileset>
</tar>
</target>
<!-- ================================================================== -->
<!-- Findbugs -->
<!-- ================================================================== -->
<property name="findbugs.home" value=""/>
<target name="findbugs" depends="check-for-findbugs, jar" if="findbugs.present" description="Run findbugs if present">
<property name="findbugs.out.dir" value="${test.build.dir}/findbugs"/>
<property name="findbugs.exclude.file" value="${test.src.dir}/findbugsExcludeFile.xml"/>
<property name="findbugs.report.htmlfile" value="${findbugs.out.dir}/pig-findbugs-report.html"/>
<property name="findbugs.report.xmlfile" value="${findbugs.out.dir}/pig-findbugs-report.xml"/>
<taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask"
classpath="${findbugs.home}/lib/findbugs-ant.jar" />
<mkdir dir="${findbugs.out.dir}"/>
<findbugs home="${findbugs.home}" output="xml:withMessages"
outputFile="${findbugs.report.xmlfile}" effort="max"
excludeFilter="${findbugs.exclude.file}" jvmargs="-Xmx512M">
<auxClasspath>
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
</auxClasspath>
<sourcePath path="${src.dir}"/>
<class location="${output.jarfile.core}" />
</findbugs>
<xslt style="${findbugs.home}/src/xsl/default.xsl" in="${findbugs.report.xmlfile}"
out="${findbugs.report.htmlfile}"/>
</target>
<target name="check-for-findbugs">
<available property="findbugs.present" file="${findbugs.home}/lib/findbugs.jar" />
</target>
<!-- ================================================================== -->
<!-- Perform audit activities for the release -->
<!-- ================================================================== -->
<target name="releaseaudit" depends="ivy-releaseaudit, package" description="Release Audit activities">
<java classname="${rat.reporting.classname}" fork="true">
<classpath refid="releaseaudit.classpath"/>
<arg value="${build.dir}/${final.name}"/>
</java>
</target>
<!--target name="checkstyle" depends="checkstyle.check, set-checkstyle-classpath" if="checkstyle.home" -->
<target name="checkstyle" depends="ivy-checkstyle" description="Run optional third-party tool targets">
<taskdef resource="checkstyletask.properties">
<classpath refid="checkstyle.classpath"/>
<!-- <classpath refid="checkstyle-classpath"/> -->
</taskdef>
<mkdir dir="${test.build.dir}"/>
<checkstyle config="${test.src.dir}/checkstyle.xml" failOnViolation="false">
<fileset dir="${src.dir}" includes="**/*.java" excludes="**/generated/**"/>
<formatter type="xml" toFile="${test.build.dir}/checkstyle-errors.xml"/>
</checkstyle>
<xslt style="${test.src.dir}/checkstyle-noframes-sorted.xsl" in="${test.build.dir}/checkstyle-errors.xml"
out="${test.build.dir}/checkstyle-errors.html"/>
</target>
<target name="checkstyle.check" unless="checkstyle.home">
<fail message="'checkstyle.home' is not defined. Please pass -Dcheckstyle.home=<base of checkstyle installation>
to Ant on the command-line." />
</target>
<target name="set-checkstyle-classpath">
<path id="checkstyle-classpath">
<fileset dir="${checkstyle.home}">
<include name="**/*.jar"/>
</fileset>
</path>
</target>
<target name="findbugs.check" depends="check-for-findbugs" unless="findbugs.present">
<fail message="'findbugs.home' is not defined. Please pass -Dfindbugs.home=<base of Findbugs installation>
to Ant on the command-line." />
</target>
<target name="patch.check" unless="patch.file">
<fail message="'patch.file' is not defined. Please pass -Dpatch.file=<location of patch file>
to Ant on the command-line." />
</target>
<target name="test-patch" depends="patch.check,findbugs.check,forrest.check">
<exec executable="bash" failonerror="true">
<arg value="${test_patch_sh}"/>
<arg value="DEVELOPER"/>
<arg value="${patch.file}"/>
<arg value="${scratch.dir}"/>
<arg value="${svn.cmd}"/>
<arg value="${grep.cmd}"/>
<arg value="${patch.cmd}"/>
<arg value="${findbugs.home}"/>
<arg value="${forrest.home}"/>
<arg value="${basedir}"/>
<arg value="${java5.home}"/>
<arg value="${ant.project.name}"/>
</exec>
</target>
<target name="hudson-test-patch" depends="findbugs.check,forrest.check">
<exec executable="bash" failonerror="true">
<arg value="${test_patch_sh}"/>
<arg value="HUDSON"/>
<arg value="${scratch.dir}"/>
<arg value="${support.dir}"/>
<arg value="${ps.cmd}"/>
<arg value="${wget.cmd}"/>
<arg value="${jiracli.cmd}"/>
<arg value="${svn.cmd}"/>
<arg value="${grep.cmd}"/>
<arg value="${patch.cmd}"/>
<arg value="${findbugs.home}"/>
<arg value="${forrest.home}"/>
<arg value="${eclipse.home}"/>
<arg value="${python.home}"/>
<arg value="${basedir}"/>
<arg value="${trigger.url}"/>
<arg value="${jira.passwd}"/>
<arg value="${java5.home}"/>
<arg value="${curl.cmd}"/>
<arg value="${defect}"/>
<arg value="${ant.project.name}"/>
</exec>
</target>
<target name="clover" depends="clover.setup, clover.info" description="Instrument the Unit tests using Clover.
To use, specify -Dclover.home=<base of clover installation> -Drun.clover=true on the command line."/>
<target name="clover.setup" if="clover.enabled">
<taskdef resource="cloverlib.xml" classpath="${clover.jar}"/>
<mkdir dir="${clover.db.dir}"/>
<clover-setup initString="${clover.db.dir}/pig_coverage.db">
<fileset dir="src" includes="**/*.java"/>
</clover-setup>
</target>
<target name="clover.info" unless="clover.present">
<echo>
Clover not found. Code coverage reports disabled.
</echo>
</target>
<target name="clover.check">
<fail unless="clover.present">
##################################################################
Clover not found.
Please specify -Dclover.home=<base of clover installation>
on the command line.
##################################################################
</fail>
</target>
<target name="generate-clover-reports" depends="clover.check, clover">
<mkdir dir="${clover.report.dir}"/>
<clover-report>
<current outfile="${clover.report.dir}" title="${final.name}">
<format type="html"/>
</current>
</clover-report>
<clover-report>
<current outfile="${clover.report.dir}/clover.xml" title="${final.name}">
<format type="xml"/>
</current>
</clover-report>
</target>
<target name="api-xml" depends="ivy-jdiff, javadoc-all, write-null">
<javadoc>
<doclet name="jdiff.JDiff"
path="${jdiff.jar}:${xerces.jar}">
<param name="-apidir" value="${jdiff.xml.dir}"/>
<param name="-apiname" value="${name} ${version}"/>
</doclet>
<packageset dir="${src.dir}"/>
<classpath>
<path refid="javadoc-classpath" />
<pathelement path="${output.jarfile}" />
</classpath>
</javadoc>
</target>
<target name="write-null">
<exec executable="touch">
<arg value="${build.dir}/Null.java"/>
</exec>
</target>
<target name="api-report" depends="api-xml">
<mkdir dir="${jdiff.build.dir}"/>
<javadoc sourcepath="${src.dir}"
destdir="${jdiff.build.dir}"
sourceFiles="${build.dir}/Null.java">
<doclet name="jdiff.JDiff" path="${jdiff.jar}:${xerces.jar}">
<param name="-oldapi" value="${name} ${jdiff.stable}"/>
<param name="-newapi" value="${name} ${version}"/>
<param name="-oldapidir" value="${jdiff.xml.dir}"/>
<param name="-newapidir" value="${jdiff.xml.dir}"/>
<param name="-javadocold" value="${jdiff.stable.javadoc}"/>
<param name="-javadocnew" value="../../api/"/>
<param name="-stats"/>
</doclet>
<classpath>
<path refid="javadoc-classpath" />
<pathelement path="${output.jarfile}" />
</classpath>
</javadoc>
</target>
<target name="ivy-init-dirs">
<mkdir dir="${build.ivy.dir}" />
<mkdir dir="${build.ivy.lib.dir}" />
<mkdir dir="${build.ivy.report.dir}" />
<mkdir dir="${build.ivy.maven.dir}" />
</target>
<target name="ivy-probe-antlib" >
<condition property="ivy.found">
<typefound uri="antlib:org.apache.ivy.ant" name="cleancache"/>
</condition>
</target>
<target name="ivy-download" description="To download ivy" unless="offline">
<get src="${ivy_repo_url}" dest="${ivy.jar}" usetimestamp="true"/>
</target>
<!--
To avoid Ivy leaking things across big projects, always load Ivy in the same classloader.
Also note how we skip loading Ivy if it is already there, just to make sure all is well.
-->
<target name="ivy-init-antlib" depends="ivy-download,ivy-init-dirs,ivy-probe-antlib" unless="ivy.found">
<typedef uri="antlib:org.apache.ivy.ant" onerror="fail" loaderRef="ivyLoader">
<classpath>
<pathelement location="${ivy.jar}"/>
</classpath>
</typedef>
<fail>
<condition >
<not>
<typefound uri="antlib:org.apache.ivy.ant" name="cleancache"/>
</not>
</condition>
You need Apache Ivy 2.0 or later from http://ant.apache.org/
It could not be loaded from ${ivy_repo_url}
</fail>
</target>
<target name="ivy-init" depends="ivy-init-antlib" >
<!--Configure Ivy by reading in the settings file
If anyone has already read in a settings file into this settings ID, it gets priority
-->
<ivy:configure settingsid="${ant.project.name}.ivy.settings" file="${ivysettings.xml}" override='false'/>
</target>
<target name="ivy-compile" depends="ivy-init" description="Resolve, Retrieve Ivy-managed artifacts for compile configuration">
<ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="compile"/>
<ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}" conf="compile"/>
<ivy:cachepath pathid="compile.classpath" conf="compile"/>
</target>
<target name="ivy-test" depends="ivy-init" description="Resolve, Retrieve Ivy-managed artifacts for test configuration">
<ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="test"/>
<ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}" conf="test"/>
<ivy:cachepath pathid="test-classpath" conf="test"/>
</target>
<target name="ivy-javadoc" depends="ivy-init" description="Resolve, Retrieve Ivy-managed artifacts for javadoc configuration">
<ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="javadoc"/>
<ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}" conf="javadoc"/>
<ivy:cachepath pathid="javadoc.classpath" conf="javadoc"/>
</target>
<target name="ivy-releaseaudit" depends="ivy-init" description="Resolve, Retrieve Ivy-managed artifacts for releaseaudit configuration">
<ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="releaseaudit"/>
<ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}" conf="releaseaudit"/>
<ivy:cachepath pathid="releaseaudit.classpath" conf="releaseaudit"/>
</target>
<target name="ivy-checkstyle" depends="ivy-init" description="Resolve, Retrieve Ivy-managed artifacts for checkstyle configuration">
<ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="checkstyle"/>
<ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}" conf="checkstyle"/>
<ivy:cachepath pathid="checkstyle.classpath" conf="checkstyle"/>
</target>
<target name="ivy-buildJar" depends="ivy-init" description="Resolve, Retrieve Ivy-managed artifacts for buildJar configuration">
<ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="buildJar"/>
<ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}" conf="buildJar"/>
<ivy:cachepath pathid="buildJar.classpath" conf="buildJar"/>
</target>
<target name="ivy-jdiff" depends="ivy-init" description="Resolve, Retrieve Ivy-managed artifacts for jdiff configuration">
<ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="jdiff"/>
<ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}" conf="jdiff"/>
<ivy:cachepath pathid="jdiff.classpath" conf="jdiff"/>
</target>
<target name="ivy-resolve" depends="ivy-init">
<ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="runtime"/>
</target>
<target name="assert-pig-jar-exists" depends="ivy-init">
<fail>
<condition >
<not>
<available file="${pig.jar}" />
</not>
</condition>
Not found: ${pig.jar}
Please run the target "jar" in the main build file
</fail>
</target>
<target name="ready-to-publish" depends="jar, assert-pig-jar-exists, ivy-resolve"/>
<target name="ivy-publish-local" depends="ready-to-publish,ivy-resolve">
<ivy:publish settingsRef="${ant.project.name}.ivy.settings"
resolver="local" pubrevision="${version}" overwrite="true"
artifactspattern="${build.dir}/${ivy.publish.pattern}"/>
</target>
<!-- this is here for curiosity, to see how well the makepom task works
Answer: it depends whether you want transitive dependencies excluded or not