Skip to content
Newer
Older
100755 137 lines (119 sloc) 5.95 KB
a27e925 @klbostee initial commit
authored Feb 2, 2010
1 <!--
2 Licensed to the Apache Software Foundation (ASF) under one or more
3 contributor license agreements. See the NOTICE file distributed with
4 this work for additional information regarding copyright ownership.
5 The ASF licenses this file to You under the Apache License, Version 2.0
6 (the "License"); you may not use this file except in compliance with
7 the License. You may obtain a copy of the License at
8
9 http://www.apache.org/licenses/LICENSE-2.0
10
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16 -->
17
18 <project basedir="." default="jar" name="pigudf">
19 <!-- javac properties -->
20 <property name="javac.debug" value="on" />
21 <property name="javac.level" value="source,lines,vars"/>
22 <property name="javac.optimize" value="on" />
23 <property name="javac.deprecation" value="off" />
24 <property name="javac.version" value="1.5" />
25 <property name="javac.args" value="" />
26 <!-- TODO we should use warning... <property name="javac.args.warnings" value="-Xlint:unchecked" /> -->
27 <property name="javac.args.warnings" value="" />
28
29 <!-- build properties -->
30 <property name="build.dir" value="${basedir}/build" />
31 <property name="build.classes" value="${build.dir}/classes" />
32 <property name="build.docs" value="${build.dir}/docs" />
33 <property name="build.javadoc" value="${build.docs}/api" />
34 <property name="pigjar" value="${basedir}/lib/pig.jar" />
35 <property name="streamingjar" value="${basedir}/lib/hadoop-streaming.jar" />
36
37 <property name="udfjar" value="pigtail.jar" />
38 <property name="src.dir" value="src/main/java/fm/last/pigtail" />
39
40 <!-- jar properties -->
41 <property name=".javadoc" value="${build.docs}/api" />
42
43 <!-- test properties -->
44 <property name="test.build.dir" value="${build.dir}/test" />
45 <property name="test.classes" value="${test.build.dir}/classes" />
46 <property name="test.logs" value="${test.build.dir}/logs" />
47 <property name="test.timeout" value="900000" />
48 <property name="test.junit.output.format" value="plain" />
49 <property name="test.src.dir" value="src/test/java" />
50 <property name="junit.hadoop.conf" value="${user.home}/pigtest/conf/"/>
51
52 <path id="pigudf.classpath">
53 <pathelement location="${build.classes}"/>
54 <pathelement location="${pigjar}"/>
55 <pathelement location="${streamingjar}"/>
56 </path>
57
58 <path id="test.classpath">
59 <pathelement location="${build.classes}"/>
60 <pathelement location="${test.classes}"/>
61 <pathelement location="${test.src.dir}"/>
62 <pathelement location="${junit.hadoop.conf}" />
63 <path refid="pigudf.classpath"/>
64 </path>
65
66 <target name="init">
67 <mkdir dir="${build.dir}"/>
68 <mkdir dir="${build.classes}"/>
69 <mkdir dir="${test.build.dir}"/>
70 <mkdir dir="${test.classes}"/>
71 <mkdir dir="${build.javadoc}"/>
72 </target>
73
74 <target name="clean">
75 <delete dir="build"/>
76 </target>
77
78 <target depends="init" name="compile" description="compile all of the class files">
79 <echo> *** Compiling Pig UDFs ***</echo>
80 <javac srcdir="${src.dir}" debug="${javac.debug}" debuglevel="${javac.level}" destdir="${build.classes}" source="${javac.version}"
81 target="${javac.version}" optimize="${javac.optimize}" deprecation="${javac.deprecation}">
82 <compilerarg line="${javac.args} ${javac.args.warnings}" />
83 <classpath refid="pigudf.classpath"/>
84 </javac>
85 </target>
86
87 <target depends="init,compile" name="jar" description="create the jar files">
88 <echo> *** Creating pigudf.jar ***</echo>
89 <jar destfile="${udfjar}">
90 <fileset dir="build/classes"/>
91 <zipfileset src="${streamingjar}" />
92 </jar>
93 </target>
94
95 <target depends="compile" name="compile-test">
96 <echo> *** Compiling UDF tests ***</echo>
97 <javac srcdir="${test.src.dir}" debug="true" debuglevel="${debuglevel}" destdir="${test.classes}" source="${javac.version}" target="${javac.version}">
98 <classpath refid="pigudf.classpath"/>
99 </javac>
100 </target>
101
102 <target depends="compile-test,jar" name="test">
103 <echo> *** Running UDF tests ***</echo>
104 <delete dir="${test.logs}"/>
105 <mkdir dir="${test.logs}"/>
106 <junit printsummary="yes" haltonfailure="no" fork="yes" maxmemory="256m" dir="${basedir}" timeout="${test.timeout}" errorProperty="tests.failed" failureProperty="tests.failed">
107 <sysproperty key="hadoop.log.dir" value="${test.logs}"/>
108 <classpath refid="test.classpath"/>
109 <formatter type="${test.junit.output.format}" />
110 <batchtest fork="yes" todir="${test.logs}" unless="testcase">
111 <fileset dir="${test.src.dir}">
112 <include name="**/*Test*.java" />
113 </fileset>
114 </batchtest>
115 <batchtest fork="yes" todir="${test.logs}" if="testcase">
116 <fileset dir="${test.src.dir}" includes="**/${testcase}.java"/>
117 </batchtest>
118 </junit>
119 <fail if="tests.failed">Tests failed!</fail>
120 </target>
121
122 <target depends="init" name="javadoc"
123 description="build javadoc for all of the packages">
124 <echo> *** Creating Javadocs ***</echo>
125 <javadoc destdir="build/javadoc"
126 author="true">
127 <fileset dir="${src.dir}/evaluation" includes="**/*.java"/>
128 <fileset dir="${src.dir}/storage" includes="**/*.java"/>
129 <fileset dir="${src.dir}/filtering" includes="**/*.java"/>
130 <fileset dir="${src.dir}/grouping" includes="**/*.java"/>
131 <fileset dir="${src.dir}/comparison" includes="**/*.java"/>
132 <classpath refid="pigudf.classpath"/>
133 </javadoc>
134 </target>
135
136 </project>
Something went wrong with that request. Please try again.