forked from Cascading/cascading
/
build.xml
304 lines (239 loc) · 9.54 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
<?xml version="1.0"?>
<!--
~ Copyright (c) 2007-2008 Concurrent, Inc. All Rights Reserved.
~
~ Project and contact information: http://www.cascading.org/
~
~ This file is part of the Cascading project.
~
~ Cascading is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Cascading is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with Cascading. If not, see <http://www.gnu.org/licenses/>.
-->
<project name="cascading" default="build" basedir=".">
<dirname property="cascading.basedir" file="${ant.file.cascading}"/>
<property file="${user.home}/build.properties"/>
<property file="${cascading.basedir}/version.properties"/>
<property name="cascading.release.version" value="x.y.z"/>
<property name="javac.debug" value="true"/>
<property name="src" location="${cascading.basedir}/src"/>
<property name="src.java" location="${src}/java"/>
<property name="src.test" location="${src}/test"/>
<property name="src.examples" location="${src}/examples"/>
<property name="build" location="${cascading.basedir}/build/"/>
<property name="build.classes" location="${build}"/>
<property name="build.java" location="${build.classes}/java"/>
<property name="build.test" location="${build.classes}/test"/>
<property name="build.examples" location="${build.classes}/examples"/>
<property name="test.results" location="${build}/testresults"/>
<property name="test.showoutput" value="yes"/>
<property name="lib" location="${cascading.basedir}/lib"/>
<property name="lib.build" location="${lib}/build"/>
<property name="dist" location="${cascading.basedir}/dist"/>
<property name="javadoc" location="${cascading.basedir}/javadoc"/>
<property name="log" location="${cascading.basedir}/log"/>
<property name="hadoop.home" location="${cascading.basedir}/../hadoop"/>
<property name="jar.cascading" value="cascading-${cascading.release.version}.jar"/>
<property name="jar.cascading-lib" value="cascading-lib-${cascading.release.version}.jar"/>
<property name="jar.cascading-examples" value="cascading-examples-${cascading.release.version}.jar"/>
<property name="jar.cascading-test" value="cascading-test-${cascading.release.version}.jar"/>
<property name="tar.cascading" value="cascading-${cascading.release.version}.tgz"/>
<path id="project.class.path">
<pathelement location="${build.java}"/>
<pathelement location="${build.examples}"/>
<pathelement location="${build.test}"/>
<fileset dir="${lib}">
<include name="*.jar"/>
</fileset>
<fileset dir="${lib.build}">
<include name="*.jar"/>
</fileset>
<fileset dir="${hadoop.home}">
<include name="hadoop-*-core.jar"/>
<include name="hadoop-*-test.jar"/>
</fileset>
<fileset dir="${hadoop.home}/build">
<include name="hadoop-*-core.jar"/>
<include name="hadoop-*-test.jar"/>
</fileset>
<fileset dir="${hadoop.home}/lib">
<include name="*.jar"/>
<exclude name="**/junit*"/>
</fileset>
<fileset dir="${hadoop.home}/lib/jetty-ext">
<include name="*.jar"/>
</fileset>
</path>
<path id="project.src.path">
<pathelement location="${src.java}"/>
<pathelement location="${src.examples}"/>
<pathelement location="${src.test}"/>
</path>
<path id="javadoc.src.path">
<pathelement location="${src.java}"/>
<pathelement location="${src.examples}"/>
</path>
<!-- sets up environment -->
<target name="init">
<echo message="initializing cascading environment..."/>
<mkdir dir="${build.java}"/>
<mkdir dir="${build.examples}"/>
<mkdir dir="${build.test}"/>
<mkdir dir="${test.results}"/>
<property name="CLASSPATH" refid="project.class.path"/>
<echo message="${CLASSPATH}"/>
</target>
<target name="build" depends="init">
<echo message="building cascade..."/>
<javac srcdir="${src.java}" destdir="${build.java}" verbose="off" debug="${javac.debug}">
<classpath refid="project.class.path"/>
</javac>
<copy todir="${build.java}">
<fileset dir="${src.java}">
<exclude name="**/*.java"/>
</fileset>
</copy>
<javac srcdir="${src.examples}" destdir="${build.examples}" verbose="off" debug="${javac.debug}">
<classpath refid="project.class.path"/>
</javac>
<copy todir="${build.examples}">
<fileset dir="${src.examples}">
<exclude name="**/*.java"/>
</fileset>
</copy>
<javac srcdir="${src.test}" destdir="${build.test}" verbose="off" debug="${javac.debug}">
<classpath refid="project.class.path"/>
</javac>
<copy todir="${build.test}">
<fileset dir="${src.test}">
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="javadoc" depends="init">
<echo message="creating cascading javadoc..."/>
<delete dir="${javadoc}"/>
<mkdir dir="${javadoc}"/>
<javadoc sourcepathref="javadoc.src.path"
destdir="${javadoc}"
packagenames="cascading.*"
windowtitle="Cascading">
<link href="http://java.sun.com/j2se/1.5.0/docs/api"/>
<link href="http://www.janino.net/javadoc/"/>
<bottom><![CDATA[<i>Copyright © 2007-2008 Concurrent, Inc. All Rights Reserved.</i>]]></bottom>
</javadoc>
</target>
<!-- runs JUnit tests -->
<target name="test" depends="init, build">
<echo message="running all cascading tests..."/>
<junit printsummary="true" showoutput="${test.showoutput}" fork="yes" haltonerror="no" haltonfailure="no" dir="."
maxmemory="512m">
<sysproperty key="test.build.data" value="data"/>
<sysproperty key="hadoop.log.dir" value="build/test/log"/>
<classpath>
<path refid="project.class.path"/>
<pathelement path="${java.class.path}"/>
</classpath>
<formatter type="plain" usefile="true"/>
<test name="${testcase}" todir="${test.results}" if="testcase"/>
<batchtest todir="${test.results}" haltonfailure="true" unless="testcase">
<fileset dir="${src.test}">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
</junit>
</target>
<!-- cleans up build artifacts -->
<target name="clean">
<echo message="cleaning cascading..."/>
<delete dir="${build}"/>
<delete dir="${javadoc}"/>
</target>
<!-- removes build -->
<target name="nuke">
<echo message="nuking cascade..."/>
<delete dir="${build}"/>
<delete dir="${javadoc}"/>
<delete dir="${dist}"/>
<delete dir="${log}"/>
<delete>
<fileset dir="." includes="${ant.project.name}*.tgz"/>
<fileset dir="." includes="TEST-*"/>
<fileset dir="." includes="junit*.properties"/>
<fileset dir="." includes="**/.DS_Store"/>
</delete>
</target>
<!-- jar build -->
<target name="jar" depends="build">
<echo message="jarring cascading..."/>
<delete file="${build}/${jar.cascading}"/>
<delete file="${build}/${jar.cascading-lib}"/>
<delete file="${build}/${jar.cascading-examples}"/>
<delete file="${build}/${jar.cascading-test}"/>
<delete dir="${build.java}/lib"/>
<manifest file="${build}/MANIFEST.MF">
<attribute name="Built-By" value="${user.name}"/>
<!--<attribute name="Main-Class" value="cascade.Main"/>-->
</manifest>
<jar jarfile="${build}/${jar.cascading-lib}" manifest="${build}/MANIFEST.MF" compress="yes">
<fileset dir="${build.java}"/>
</jar>
<jar jarfile="${build}/${jar.cascading-examples}" manifest="${build}/MANIFEST.MF" compress="yes">
<fileset dir="${build.examples}"/>
</jar>
<jar jarfile="${build}/${jar.cascading-test}" manifest="${build}/MANIFEST.MF" compress="yes">
<fileset dir="${build.test}">
<include name="cascading/**"/>
<include name="log4j.properties"/>
<include name="hadoop-site.xml"/>
</fileset>
</jar>
<!-- hadoop supports jars in a lib directory -->
<mkdir dir="${build.java}/lib"/>
<copy todir="${build.java}/lib">
<fileset dir="./lib">
<include name="*.jar"/>
</fileset>
</copy>
<delete dir="${build.java}/META-INF"/>
<jar jarfile="${build}/${jar.cascading}" manifest="${build}/MANIFEST.MF" compress="yes">
<fileset dir="${build.java}"/>
</jar>
</target>
<target name="dist" depends="jar,javadoc">
<mkdir dir="${dist}"/>
<copy todir="${dist}">
<fileset dir=".">
<exclude name="build.properties"/>
<exclude name="build/**"/>
<exclude name="dist/**"/>
<exclude name="www/**"/>
<exclude name="log/**"/>
<exclude name="**/CVS/**"/>
<exclude name="**/*.tgz"/>
<exclude name="TEST-*"/>
<exclude name="**/.DS_Store"/>
</fileset>
</copy>
<copy file="${build}/${jar.cascading}" todir="${dist}"/>
<copy file="${build}/${jar.cascading-lib}" todir="${dist}"/>
<copy file="${build}/${jar.cascading-examples}" todir="${dist}"/>
</target>
<target name="package" depends="nuke,dist">
<tar destfile="${tar.cascading}"
compression="gzip">
<tarfileset dir="dist/" prefix="cascading-${cascading.release.version}">
<include name="**/**"/>
</tarfileset>
</tar>
</target>
</project>