-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
249 lines (220 loc) · 9.29 KB
/
Copy pathbuild.xml
File metadata and controls
249 lines (220 loc) · 9.29 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
<?xml version="1.0"?>
<project name="${name}" default="build" xmlns:ivy="antlib:org.apache.ivy.ant" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<property file="${user.home}/build.properties" />
<property file="${basedir}/build.properties" />
<property file="${basedir}/default.properties" />
<property name="groupId" value="org.top500" />
<property name="artifactId" value="crawler" />
<property name="maven-repository-url" value="https://repository.apache.org/service/local/staging/deploy/maven2" />
<property name="maven-repository-id" value="apache.releases.https" />
<property name="crawler" value="${build.dir}/${artifactId}-${version}.jar" />
<property name="crawler-server" value="${build.dir}/crawler-server-${version}.jar" />
<property name="verifier" value="${build.dir}/verifier-${version}.jar" />
<path id="classpath">
<pathelement location="${build.classes}" />
<fileset dir="${build.lib.dir}">
<include name="*.jar" />
</fileset>
</path>
<presetdef name="javac">
<javac includeantruntime="false" />
</presetdef>
<!-- ====================================================== -->
<!-- Stuff needed by all targets -->
<!-- ====================================================== -->
<target name="init" depends="ivy-init" description="--> stuff required by all targets">
<mkdir dir="${build.dir}" />
<mkdir dir="${build.classes}" />
<mkdir dir="${build.conf}" />
<touch datetime="01/25/1971 2:00 pm">
<fileset dir="${conf.dir}" includes="**/*.template" />
</touch>
<copy todir="${conf.dir}" verbose="true">
<fileset dir="${conf.dir}" includes="**/*.template" />
<mapper type="glob" from="*.template" to="*" />
</copy>
</target>
<target name="compile" description="--> Just compile, no dependency check">
<javac
encoding="${build.encoding}"
srcdir="${src.dir}"
includes="**/*.java"
destdir="${build.classes}"
debug="${javac.debug}"
optimize="${javac.optimize}"
target="${javac.version}"
source="${javac.version}"
deprecation="${javac.deprecation}">
<compilerarg value="-Xlint:-path"/>
<classpath refid="classpath" />
</javac>
<copy todir="${build.classes}">
<fileset dir="${src.dir}" includes="**/*.html" />
<fileset dir="${src.dir}" includes="**/*.css" />
<fileset dir="${src.dir}" includes="**/*.properties" />
</copy>
</target>
<target name="crawler" depends="compile" description="make jar file for crawler" >
<pathconvert property="libs" pathsep=" ">
<mapper>
<chainedmapper>
<flattenmapper />
<globmapper from="*" to="lib/*" />
</chainedmapper>
</mapper>
<fileset dir="${build.lib.dir}">
<include name="*.jar" />
</fileset>
</pathconvert>
<jar jarfile="${crawler}" basedir="${build.classes}">
<manifest>
<attribute name="Main-Class" value="org.top500.fetcher.Fetcher" />
<attribute name="Class-Path" value="conf/ ${libs}"></attribute>
</manifest>
</jar>
</target>
<target name="crawler-server" depends="compile" description="make jar file" >
<pathconvert property="libs" pathsep=" ">
<mapper>
<chainedmapper>
<flattenmapper />
<globmapper from="*" to="lib/*" />
</chainedmapper>
</mapper>
<fileset dir="${build.lib.dir}">
<include name="*.jar" />
</fileset>
</pathconvert>
<jar jarfile="${crawler-server}" basedir="${build.classes}">
<include name="**/WebDriverService*.class"/>
<include name="**/Configuration.class"/>
<manifest>
<attribute name="Main-Class" value="org.top500.fetcher.WebDriverService" />
<attribute name="Class-Path" value="conf/ ${libs}"></attribute>
</manifest>
</jar>
</target>
<target name="verifier" depends="compile" description="make jar file" >
<pathconvert property="libs" pathsep=" ">
<mapper>
<chainedmapper>
<flattenmapper />
<globmapper from="*" to="lib/*" />
</chainedmapper>
</mapper>
<fileset dir="${build.lib.dir}">
<include name="*.jar" />
</fileset>
</pathconvert>
<jar jarfile="${verifier}" basedir="${build.classes}">
<manifest>
<attribute name="Main-Class" value="org.top500.verifier.Verifier" />
<attribute name="Class-Path" value="conf/ ${libs}"></attribute>
</manifest>
</jar>
</target>
<target name="build" depends="init, resolve-default, compile, crawler, crawler-server, verifier">
<copy todir="${build.conf}">
<fileset dir="${conf.dir}" includes="*" />
</copy>
<copy todir="${build.lib.dir}">
<fileset dir="${lib.dir}" includes="*" />
</copy>
</target>
<!-- ================================================================== -->
<!-- Ivy targets -->
<!-- ================================================================== -->
<!-- target: resolve ================================================= -->
<target name="resolve-default" depends="clean-lib, init" description="--> resolve and retrieve dependencies with ivy">
<ivy:resolve file="${ivy.file}" conf="default" log="download-only" />
<ivy:retrieve pattern="${build.lib.dir}/[artifact]-[revision].[ext]" symlink="false" log="quiet" />
<antcall target="copy-libs" />
</target>
<target name="resolve-test" depends="clean-lib, init" description="--> resolve and retrieve dependencies with ivy">
<ivy:resolve file="${ivy.file}" conf="test" log="download-only" />
<ivy:retrieve pattern="${build.lib.dir}/[artifact]-[revision].[ext]" symlink="false" log="quiet" />
<antcall target="copy-libs" />
</target>
<target name="copy-libs" description="--> copy the libs in lib, which are not ivy enabled">
<copy todir="${build.lib.dir}/" failonerror="false">
<fileset dir="${lib.dir}" includes="**/*.jar" />
</copy>
</target>
<!-- target: report ================================================== -->
<target name="report" depends="resolve-test" description="--> generates a report of dependencies">
<ivy:report todir="${build.dir}" />
</target>
<!-- target: ivy-init ================================================ -->
<target name="ivy-init" depends="ivy-probe-antlib, ivy-init-antlib" description="--> initialise Ivy settings">
<ivy:settings file="${ivy.dir}/ivysettings.xml" />
</target>
<!-- target: ivy-probe-antlib ======================================== -->
<target name="ivy-probe-antlib" description="--> probe the antlib library">
<condition property="ivy.found">
<typefound uri="antlib:org.apache.ivy.ant" name="cleancache" />
</condition>
</target>
<!-- target: ivy-download ============================================ -->
<target name="ivy-download" description="--> download ivy">
<available file="${ivy.jar}" property="ivy.jar.found" />
<antcall target="ivy-download-unchecked" />
</target>
<!-- target: ivy-download-unchecked ================================== -->
<target name="ivy-download-unchecked" unless="ivy.jar.found" description="--> fetch any ivy file">
<get src="${ivy.repo.url}" dest="${ivy.jar}" usetimestamp="true" />
</target>
<!-- target: ivy-init-antlib ========================================= -->
<target name="ivy-init-antlib" depends="ivy-download" unless="ivy.found" description="--> attempt to use Ivy with Antlib">
<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>
<!-- ================================================================== -->
<!-- Clean. Delete the build files, and their directories -->
<!-- ================================================================== -->
<!-- target: clean =================================================== -->
<target name="clean" depends="clean-build, clean-lib" description="--> clean the project" />
<!-- target: clean-local ============================================= -->
<target name="clean-local" depends="" description="--> cleans the local repository for the current module">
<delete dir="${ivy.local.default.root}/${ivy.organisation}/${ivy.module}" />
</target>
<!-- target: clean-lib =============================================== -->
<target name="clean-lib" description="--> clean the project libraries directory (dependencies)">
<delete includeemptydirs="true" dir="${build.lib.dir}" />
</target>
<!-- target: clean-build ============================================= -->
<target name="clean-build" description="--> clean the project built files">
<delete includeemptydirs="true" dir="${build.dir}" />
</target>
<!-- ================================================================== -->
<!-- RAT targets -->
<!-- ================================================================== -->
<target name="rat-sources-typedef" description="--> run RAT antlib task">
<typedef resource="org/apache/rat/anttasks/antlib.xml">
<classpath>
<fileset dir="." includes="rat*.jar" />
</classpath>
</typedef>
</target>
<target name="rat-sources" depends="rat-sources-typedef"
description="--> runs the tasks over src/java">
<rat:report xmlns:rat="antlib:org.apache.rat.anttasks">
<fileset dir="src">
<include name="java/**/*" />
<include name="plugin/**/src/**/*" />
</fileset>
</rat:report>
</target>
</project>