public
Description: A creepy crawler
Homepage:
Clone URL: git://github.com/emi/bixo.git
Ken Krugler (author)
Fri Oct 30 05:33:27 -0700 2009
commit  fc770135e3d01e7982ee25da5c79028f1f5ce19f
tree    0128dc5bd4830d1b858a4c1a719a23b265bf65ac
parent  d5b5323463061b49ba3f9eae21d18685f20fdbda
bixo / build.xml
100644 501 lines (423 sloc) 18.048 kb
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
<!--
Copyright (c) 1997-2009 101tec Inc.
 
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
 
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
 
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-->
<project name="bixo-core" default="compile">
 
<property name="root.dir" value="${basedir}" />
<property file="${root.dir}/src/build/ant/build.properties" />
 
 
<!-- ================================================================== -->
<!-- General cleaning sources -->
<!-- ================================================================== -->
 
<target name="clean" description="--> clean the project">
<echo>cleaning ${ant.project.name}</echo>
<delete includeemptydirs="true" failonerror="false">
<fileset dir="${build.dir}" excludes="classes-*-eclipse/" />
</delete>
</target>
 
 
<!-- ================================================================== -->
<!-- Maven -->
<!-- ================================================================== -->
 
<target name="mvn-init" unless="compile.classpath" xmlns:artifact="urn:maven-artifact-ant">
<path id="maven.ant.tasks.classpath" path="${lib.dir}/maven-ant-tasks-2.0.10.jar" />
     <typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant"
         classpathref="maven.ant.tasks.classpath"/>
        
     <condition property="maven.repo.local" value="${maven.repo.local}" else="${user.home}/.m2/repository">
         <isset property="maven.repo.local"/>
     </condition>
    
     <echo>maven.repo.local=${maven.repo.local}</echo>
     <artifact:localRepository id="local.repository" path="${maven.repo.local}"/>
     <artifact:pom file="pom.xml" id="maven.project"/>
    
     <artifact:dependencies pathId="compile.classpath" filesetId="compile.fileset" useScope="compile">
         <pom refid="maven.project"/>
         <localRepository refid="local.repository"/>
     </artifact:dependencies>
    
     <artifact:dependencies pathId="test.classpath" filesetId="test.fileset" useScope="test">
         <pom refid="maven.project"/>
         <localRepository refid="local.repository"/>
     </artifact:dependencies>
    
     <artifact:dependencies pathId="runtime.classpath" filesetId="runtime.fileset" useScope="runtime">
<pom refid="maven.project"/>
<localRepository refid="local.repository"/>
</artifact:dependencies>
</target>
 
<target name="mvn-install" xmlns:artifact="urn:maven-artifact-ant" depends="mvn-init">
        <artifact:install file="${build.dir}/${jar.name}">
     <pom refid="maven.project"/>
   </artifact:install>
</target>
 
<target name="mvn-deploy" xmlns:artifact="urn:maven-artifact-ant" depends="mvn-init">
<fail unless="repoUrl">
You must specify the repoUrl (-DrepoUrl=xxx) when deploying!
</fail>
 
        <artifact:deploy file="${build.dir}/${jar.name}">
     <remoteRepository url="${repoUrl}"/>
     <pom refid="maven.project"/>
   </artifact:deploy>
</target>
 
<!-- ================================================================== -->
<!-- Build sources -->
<!-- ================================================================== -->
 
<target name="compile"
depends="mvn-init"
description="--> compile main classes">
<mkdir dir="${build.dir.main-classes}" />
<javac encoding="${build.encoding}"
srcdir="${main.src.dir}"
includes="**/*.java"
destdir="${build.dir.main-classes}"
debug="${javac.debug}"
optimize="${javac.optimize}"
target="${javac.version}"
source="${javac.version}"
deprecation="${javac.deprecation}">
<compilerarg line="${javac.args} ${javac.args.warnings}" />
<classpath refid="compile.classpath" />
</javac>
</target>
 
 
<!-- ================================================================== -->
<!-- Unit Tests -->
<!-- ================================================================== -->
 
<target name="compile-test" depends="compile">
<echo>*** Building Unit Tests Sources ***</echo>
<mkdir dir="${build.dir.test-classes}" />
<path id="test.path">
<pathelement location="${build.dir.main-classes}" />
</path>
 
<javac encoding="${build.encoding}"
srcdir="${test.src.dir}"
includes="**/*.java"
destdir="${build.dir.test-classes}"
debug="${javac.debug}"
optimize="${javac.optimize}"
target="${javac.version}"
source="${javac.version}"
deprecation="${javac.deprecation}">
<compilerarg line="${javac.args} ${javac.args.warnings}" />
<classpath refid="test.classpath" />
<classpath refid="test.path" />
</javac>
</target>
 
<target name="test"
depends="compile-test"
description="--> run unit tests">
<delete dir="${build.dir.test-reports}" />
<mkdir dir="${build.dir.test-reports}" />
 
<junit showoutput="false"
printsummary="yes"
haltonfailure="no"
fork="yes"
maxmemory="256m"
dir="${basedir}"
errorProperty="tests.failed"
failureProperty="tests.failed">
<sysproperty key="net.sourceforge.cobertura.datafile"
file="${reports.dir}/bixo_coverage.ser" />
<classpath>
<pathelement location="${instrumented.dir}" />
<pathelement location="${build.dir.main-classes}" />
<pathelement location="${build.dir.test-classes}" />
<pathelement location="${test.res.dir}" />
<path refid="test.classpath" />
</classpath>
<formatter type="plain" />
<batchtest fork="yes"
todir="${build.dir.test-reports}"
unless="longrunning">
<fileset dir="${test.src.dir}">
<include name="**/*Test.java" />
<exclude name="**/Abstract*.java" />
<exclude name="**/*LRTest.java" />
</fileset>
</batchtest>
<batchtest fork="yes"
todir="${build.dir.test-reports}"
if="longrunning">
<fileset dir="${test.src.dir}">
<include name="**/*LRTest.java" />
<exclude name="**/Abstract*.java" />
</fileset>
</batchtest>
</junit>
<fail if="tests.failed">Tests failed!</fail>
</target>
 
<target name="test-lr"
description="--> run unit tests that take a long time">
<antcall target="test">
<param name="longrunning" value="true" />
</antcall>
</target>
 
<!-- ================================================================== -->
<!-- Integration Tests -->
<!-- ================================================================== -->
 
<target name="compile-integration-test" depends="compile">
<echo>*** Building Integration Tests Sources ***</echo>
<mkdir dir="${build.dir.it-classes}" />
<path id="test.path">
<pathelement location="${build.dir.main-classes}" />
<pathelement location="${build.dir.test-classes}" />
<pathelement location="${build.dir.it-classes}" />
</path>
 
<javac encoding="${build.encoding}"
srcdir="${it.src.dir}"
includes="**/*.java"
destdir="${build.dir.it-classes}"
debug="${javac.debug}"
optimize="${javac.optimize}"
target="${javac.version}"
source="${javac.version}"
deprecation="${javac.deprecation}">
<compilerarg line="${javac.args} ${javac.args.warnings}" />
<classpath refid="test.classpath" />
<classpath refid="test.path" />
</javac>
</target>
 
<target name="test-it"
depends="jar, compile-integration-test"
description="--> run integration tests">
<delete dir="${build.dir.it-reports}" />
<mkdir dir="${build.dir.it-reports}" />
 
<junit showoutput="no"
printsummary="yes"
haltonfailure="no"
fork="yes"
maxmemory="256m"
dir="${basedir}"
errorProperty="tests.failed"
failureProperty="tests.failed">
<classpath>
<pathelement location="${build.dir.main-classes}" />
<pathelement location="${build.dir.test-classes}" />
<pathelement location="${build.dir.it-classes}" />
<pathelement location="${main.res.dir}" />
<pathelement location="${it.res.dir}" />
<path refid="test.classpath" />
<fileset file="${build.dir}/${ant.project.name}.jar" />
</classpath>
<formatter type="plain" />
 
<batchtest fork="yes" todir="${build.dir.it-reports}">
<fileset dir="${it.src.dir}">
<include name="**/*Test*.java" unless="testcase" />
</fileset>
</batchtest>
</junit>
<fail if="tests.failed">Tests failed!</fail>
</target>
 
 
<!-- ================================================================== -->
<!-- Build jar of sources -->
<!-- ================================================================== -->
 
<target name="jar" depends="compile">
 
<tstamp>
<format property="timestamp" pattern="MMM dd yyyy, HH:mm:ss" />
</tstamp>
 
<jar jarfile="${build.dir}/${jar.name}"
basedir="${build.dir.main-classes}">
<manifest>
<section name="bixo">
<attribute name="Implementation-Vendor"
value="101tec inc" />
<attribute name="Implementation-Title"
value="${ant.project.name}" />
<attribute name="Implementation-Version"
value="${version}" />
<attribute name="Compile-Time" value="${timestamp}" />
<attribute name="Compiled-By" value="${user.name}" />
<!-- TODO as soon we can extract the version from git we need to add this
-->
</section>
</manifest>
</jar>
</target>
 
 
<!-- ================================================================== -->
<!-- Java Doc -->
<!-- ================================================================== -->
 
<target name="doc" depends="compile" description="--> create javadoc">
<mkdir dir="${build.javadoc}" />
<javadoc packagenames="${javadoc.package}"
destdir="${build.javadoc}"
author="true"
version="true"
use="true"
windowtitle="${name} ${version} API"
doctitle="${name} ${version} API"
bottom="Copyright &amp;copy; ${javadoc.year} 101tec Inc.">
<packageset dir="${main.src.dir}" />
<link href="${javadoc.link.java}" />
<classpath>
<path refid="compile.classpath" />
</classpath>
<group title="${javadoc.title}" packages="${javadoc.package}*" />
</javadoc>
</target>
 
 
<!-- ================================================================== -->
<!-- Hadoop job jar -->
<!-- ================================================================== -->
 
<target name="job"
depends="compile"
description="--> create a Hadoop ready jar with all dependencies">
 
<copy todir="${build.dir}/runtime-libs" flatten="true">
<path refid="runtime.classpath" />
</copy>
 
<jar destfile="${build.dir}/${job.name}" compress="true">
<fileset dir="${build.dir.main-classes}" />
<fileset dir="${build.dir}" includes="runtime-libs/" />
 
<manifest>
<attribute name="Main-Class" value="${job.main.class}" />
</manifest>
</jar>
</target>
 
 
<!-- ================================================================== -->
<!-- Deploy to Maven repo -->
<!-- ================================================================== -->
 
<target name="deploy"
depends="test-all, mvn-deploy"
description="--> deploy SNAPSHOT jar to 101tec Nexus repository">
</target>
 
<!-- ================================================================== -->
<!-- Install in local Maven repository -->
<!-- ================================================================== -->
 
<target name="install"
depends="test-all, mvn-install"
description="--> install SNAPSHOT jar to local repository">
</target>
 
<!-- ================================================================== -->
<!-- Generate a distribution -->
<!-- ================================================================== -->
 
<target name="dist"
depends="test-all, jar, doc"
description="--> create a tarball distribution">
 
<delete dir="${build.dir.dist}" />
 
<!-- create target directory -->
<mkdir dir="${build.dir.dist}" />
<mkdir dir="${build.dir.dist}/bin" />
<mkdir dir="${build.dir.dist}/docs" />
<mkdir dir="${build.dir.dist}/docs/licenses" />
<mkdir dir="${build.dir.dist}/docs/javadoc" />
<mkdir dir="${build.dir.dist}/docs/reports" />
<mkdir dir="${build.dir.dist}/lib" />
<mkdir dir="${build.dir.dist}/src" />
 
<!-- copy launch script to target -->
<copy todir="${build.dir.dist}/bin">
<fileset dir="${basedir}/bin" />
</copy>
 
<!-- copy javadoc to target dir -->
<copy todir="${build.dir.dist}/docs/javadoc">
<fileset dir="${build.javadoc}" />
</copy>
 
<!-- copy any raw libs -->
<copy todir="${build.dir.dist}/lib" flatten="true">
<fileset dir="${lib.dir}" />
<path refId="compile.classpath" />
<path refId="runtime.classpath" />
</copy>
 
<!-- copy src -->
<copy todir="${build.dir.dist}/src">
<fileset dir="${basedir}/src" />
</copy>
 
<!-- copy project jar to dist dir -->
<copy todir="${build.dir.dist}">
<fileset file="${build.dir}/${jar.name}" />
</copy>
 
<!-- copy documents -->
<copy todir="${build.dir.dist}">
<fileset file="${basedir}/README" />
</copy>
<copy todir="${build.dir.dist}/docs">
<fileset file="${basedir}/doc/eclipse-formatter.xml" />
</copy>
<copy todir="${build.dir.dist}/docs/licenses">
<fileset dir="${basedir}/doc/licenses" />
</copy>
 
<tar longfile="gnu" compression="gzip" destfile="${build.release.file}">
<tarfileset dir="${build.dir.dist}" />
</tar>
</target>
 
 
<!-- ================================================================== -->
<!-- Generating eclipse file -->
<!-- ================================================================== -->
 
<target name="eclipse"
depends="mvn-init, clean-eclipse"
description="--> create the Eclipse project files">
 
<taskdef name="eclipse"
classname="prantl.ant.eclipse.EclipseTask"
classpathref="compile.classpath" />
<mkdir dir="${build.dir.main-classes-eclipse}" />
<mkdir dir="${build.dir.test-classes-eclipse}" />
<mkdir dir="${build.dir.it-classes-eclipse}" />
<eclipse>
<settings>
<jdtcore compilercompliance="6.0" />
<resources encoding="UTF-8" />
</settings>
<project name="${ant.project.name}" />
<classpath>
<container path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6" />
 
<source path="${basedir}/src/main/java"
output="${build.dir.main-classes-eclipse}" />
<source path="${basedir}/src/main/resources"
output="${build.dir.main-classes-eclipse}" />
<source path="${basedir}/src/test/java"
output="${build.dir.test-classes-eclipse}" />
<source path="${basedir}/src/test/resources"
output="${build.dir.test-classes-eclipse}" />
<source path="${basedir}/src/it/java"
output="${build.dir.it-classes-eclipse}" />
<source path="${basedir}/src/it/resources"
output="${build.dir.it-classes-eclipse}" />
 
<!-- extras -->
<!-- we do not yet have extra modules, but it is just a question of time :) -->
 
<output path="${build.dir.main-classes-eclipse}" />
<library pathref="test.classpath" exported="false" />
</classpath>
</eclipse>
<concat destfile="${root.dir}/.settings/org.eclipse.jdt.core.prefs"
append="true">
<filelist dir="${root.dir}/doc/" files="eclipse-formatter.xml" />
</concat>
<replace file="${root.dir}/.settings/org.eclipse.jdt.core.prefs"
token="org.eclipse.jdt.core.compiler.compliance=6.0"
value="org.eclipse.jdt.core.compiler.compliance=1.6" />
</target>
 
<target name="clean-eclipse"
description="--> clean the Eclipse project files">
<delete file=".classpath" />
<delete file=".eclipse" />
<delete file=".project" />
<delete dir=".settings" />
</target>
 
 
<!-- ================================================================== -->
<!-- Multi project build -->
<!-- ================================================================== -->
 
<macrodef name="iterate">
<attribute name="target" />
<sequential>
<subant target="@{target}">
<property name="root.dir" value="${basedir}" />
<!-- extras should go into a sub folder extras
<fileset dir="extras" includes="*/build.xml" />
-->
</subant>
</sequential>
</macrodef>
 
<target name="clean-all">
<antcall target="clean" />
<iterate target="clean" />
</target>
 
<target name="test-all"
depends="test, test-lr, test-it"
description="--> run all tests">
</target>
 
</project>