-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathbuild.xml
More file actions
165 lines (137 loc) · 5.86 KB
/
build.xml
File metadata and controls
165 lines (137 loc) · 5.86 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
<?xml version="1.0"?>
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="${name}" default="dist">
<property file="./default.properties" />
<!--
Targets named nutch-* simply call Nutch's own ant targets
- package workflow -
* init
* compile
* compile-nutch-checkout
* compile-patch-nutch
* nutch-compile
* compile-typo3-plugins
* dist
* nutch-package-bin
* dist-tar-bin
-->
<!-- ====================================================== -->
<!-- Stuff needed by all targets -->
<!-- ====================================================== -->
<target name="init">
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.nutch}"/>
<mkdir dir="${build.dist}"/>
</target>
<target name="download-ivy" depends="init" unless="offline">
<mkdir dir="${ivy.jar.dir}"/>
<!-- download Ivy from web site so that it can be used even without any special installation -->
<get src="https://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar"
dest="${ivy.jar.file}" usetimestamp="true"/>
</target>
<target name="init-ivy" depends="download-ivy">
<!-- try to load Ivy here from Ivy home, in case the user has not already dropped
it into Ant's lib dir (note that the latter copy will always take precedence).
We will not fail as long as local lib dir exists (it may be empty) and
Ivy is in at least one of Ant's lib dir or the local lib dir. -->
<path id="ivy.lib.path">
<fileset dir="${ivy.jar.dir}" includes="*.jar"/>
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml"
uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
</target>
<!-- ====================================================== -->
<!-- Building Nutch -->
<!-- ====================================================== -->
<target name="compile"
depends="nutch-compile, compile-typo3-plugins"
description="--> build Nutch"
/>
<target name="nutch-compile" depends="init, compile-checkout-src, compile-patch-nutch">
<ant dir="${build.nutch}" inheritAll="false"/>
</target>
<target name="compile-checkout-src" depends="init, init-ivy">
<exec executable="git">
<arg value="clone"/>
<arg value="${nutch.scmsrc}"/>
<arg value="--branch"/>
<arg value="release-${nutch.version}"/>
<arg value="${build.nutch}"/>
</exec>
</target>
<target name="compile-patch-nutch" depends="init, compile-checkout-src">
<patch
patchfile="${basedir}/patches/nutch-585-excludeNodes.patch"
dir="${build.nutch}"
strip="0"
failonerror="false"
/>
</target>
<target name="compile-typo3-plugins" depends="nutch-compile">
<copy todir="${build.nutch}/src/plugin">
<fileset dir="${plugins.dir}"/>
</copy>
<ant dir="${build.nutch.src.plugin}/typo3-accessrootline" target="deploy" inheritAll="false"/>
<ant dir="${build.nutch.src.plugin}/typo3-base" target="deploy" inheritAll="false"/>
<ant dir="${build.nutch.src.plugin}/typo3-endtime" target="deploy" inheritAll="false"/>
<ant dir="${build.nutch.src.plugin}/typo3-index-keywords" target="deploy" inheritAll="false"/>
<ant dir="${build.nutch.src.plugin}/typo3-parse-keywords" target="deploy" inheritAll="false"/>
<ant dir="${build.nutch.src.plugin}/typo3-sitehash" target="deploy" inheritAll="false"/>
<ant dir="${build.nutch.src.plugin}/typo3-uid" target="deploy" inheritAll="false"/>
</target>
<!-- ====================================================== -->
<!-- Building a distributable file -->
<!-- ====================================================== -->
<target name="dist" depends="nutch-package-bin, dist-copy-configuration, dist-create-configuration, dist-tar-bin" description="--> build the distributable zip file" />
<target name="nutch-package-bin" depends="compile">
<ant dir="${build.nutch}" target="package-bin" inheritAll="false"/>
</target>
<target name="dist-copy-configuration" depends="init">
<copy
todir="${build.nutch}/dist/apache-nutch-${nutch.version}-bin/conf"
file="${basedir}/conf/nutch-site.xml"
overwrite="true"
/>
<copy
todir="${build.nutch}/dist/apache-nutch-${nutch.version}-bin/conf"
file="${basedir}/conf/solrindex-mapping.xml"
overwrite="true"
/>
<concat destfile="${build.nutch}/dist/apache-nutch-${nutch.version}-bin/conf/log4j.properties" append="true">
<fileset file="${basedir}/conf/log4j.properties" />
</concat>
</target>
<!-- depends="nutch-package-bin" -->
<target name="dist-create-configuration" depends="init">
<mkdir dir="${build.nutch}/dist/apache-nutch-${nutch.version}-bin/urls"/>
<touch file="${build.nutch}/dist/apache-nutch-${nutch.version}-bin/urls/seed.txt"/>
</target>
<target name="dist-tar-bin" >
<delete includeemptydirs="true" failonerror="false">
<fileset dir="${build.nutch}/dist/apache-nutch-${nutch.version}-bin/docs" />
</delete>
<tar
destfile="${build.dist}/${final.name}.tar.gz"
compression="gzip" longfile="gnu" >
<tarfileset dir="${build.nutch}/dist/apache-nutch-${nutch.version}-bin" mode="664">
<exclude name="bin/*" />
<include name="**" />
</tarfileset>
<tarfileset dir="${build.nutch}/dist/apache-nutch-${nutch.version}-bin" mode="755">
<include name="bin/*" />
<include name="crawl.sh" />
</tarfileset>
</tar>
</target>
<!-- ================================================================== -->
<!-- Clean. Delete the build files, and their directories -->
<!-- ================================================================== -->
<target name="clean" description="--> clean the project">
<delete includeemptydirs="true" dir="${build.dir}"/>
</target>
<target name="clean-nutch" description="--> clean Nutch">
<ant dir="${build.nutch}" target="clean" inheritAll="false"/>
<delete includeemptydirs="true">
<fileset dir="${build.nutch}/src/plugin" includes="typo3-*/"/>
</delete>
</target>
</project>