1 --- apache-tomcat-7.0.35-src/build.xml~ 2013-01-10 23:59:20.000000000 +0100
2 +++ apache-tomcat-7.0.35-src/build.xml 2013-02-02 10:03:33.530400312 +0100
7 - <target name="validate" if="${execute.validate}"
8 - depends="build-prepare,compile-prepare,download-validate"
9 - description="Uses Checkstyle tool to perform style check for the source code">
10 - <!-- Required so we can cache checkstyle results -->
11 - <mkdir dir="${tomcat.output}/res/checkstyle"/>
13 - <taskdef resource="checkstyletask.properties"
14 - classpath="${checkstyle.jar}" />
15 - <checkstyle config="res/checkstyle/checkstyle.xml">
17 - <patternset refid="text.files" />
18 - <include name="**/*.bat"/>
19 - <include name="**/*.sh"/>
20 - <exclude name="bin/setenv.*"/>
21 - <exclude name=".*/**"/>
22 - <exclude name="output/**"/>
23 - <exclude name="modules/**"/>
24 - <exclude name="**/*.mdl"/>
25 - <exclude name="**/*_2.xml"/>
26 - <exclude name="res/checkstyle/header-al2.txt"/>
27 - <!-- Exclude auto-generated files -->
28 - <exclude name="java/org/apache/el/parser/ELParser*.java" />
29 - <exclude name="java/org/apache/el/parser/Node.java" />
30 - <exclude name="java/org/apache/**/parser/JJT*ParserState.java" />
31 - <exclude name="java/org/apache/**/parser/ParseException.java" />
32 - <exclude name="java/org/apache/**/parser/SimpleCharStream.java" />
33 - <exclude name="java/org/apache/**/parser/Token*.java" />
34 - <!-- Exclude these else Gump runs validate on them -->
35 - <exclude name="**/org/apache/tomcat/dbcp/**"/>
36 - <exclude name="**/tomcat-deps/**"/>
37 - <!-- Exclude simple test files -->
38 - <exclude name="test/webapp-3.0/bug53257/**/*.txt"/>
39 - <exclude name="test/webapp-3.0-fragments/WEB-INF/classes/*.txt"/>
41 - <fileset dir="modules/jdbc-pool" >
42 - <exclude name=".*/**"/>
43 - <exclude name="**/MANIFEST.MF"/>
44 - <patternset refid="text.files" />
47 - <!-- javax package checks -->
48 - <checkstyle config="res/checkstyle/javax-checkstyle.xml">
49 - <fileset dir="java/javax" >
50 - <include name="**/*.java"/>
53 - <!-- org package checks -->
54 - <checkstyle config="res/checkstyle/org-checkstyle.xml">
55 - <fileset dir="java/org" >
56 - <include name="**/*.java"/>
61 <target name="validate-eoln" depends="build-prepare,compile-prepare"
62 description="Validate that the source files have correct line ends">
68 - <target name="compile" depends="build-prepare,download-compile,compile-prepare,validate">
69 + <target name="compile" depends="build-prepare">
70 <!-- Compile internal server components -->
71 <javac srcdir="java" destdir="${tomcat.classes}"
72 debug="${compile.debug}"
74 <target name="deploy" depends="package,build-docs"
75 description="Default. Builds a working Tomcat instance">
77 - <copy tofile="${tomcat.build}/bin/tomcat-native.tar.gz"
78 - file="${tomcat-native.tar.gz}" />
79 - <copy tofile="${tomcat.build}/bin/commons-daemon-native.tar.gz"
80 - file="${commons-daemon.native.src.tgz}" />
82 - <copy tofile="${tomcat.build}/bin/commons-daemon.jar" file="${commons-daemon.jar}" />
85 <copy todir="${tomcat.build}/bin">
91 - <target name="test-compile" depends="compile,download-test-compile" >
92 + <target name="test-compile" depends="compile" >
93 <mkdir dir="${test.classes}"/>
95 <javac srcdir="test" destdir="${test.classes}"
96 @@ -1240,52 +1179,10 @@
97 <mkdir dir="${tomcat.extras}/webservices"/>
100 - <target name="extras-commons-logging-prepare"
101 - depends="extras-prepare"
102 - description="Prepare to build web services extras package">
104 - <antcall target="downloadfile-2">
105 - <param name="sourcefile.1" value="${commons-logging-src.loc.1}"/>
106 - <param name="sourcefile.2" value="${commons-logging-src.loc.2}"/>
107 - <param name="destfile" value="${commons-logging-src.tar.gz}"/>
108 - <param name="destdir" value="${commons-logging.home}"/>
111 - <antcall target="downloadfile">
112 - <param name="sourcefile" value="${avalon-framework.loc}"/>
113 - <param name="destfile" value="${avalon-framework.jar}"/>
114 - <param name="destdir" value="${avalon-framework.home}"/>
117 - <antcall target="downloadfile">
118 - <param name="sourcefile" value="${log4j.loc}"/>
119 - <param name="destfile" value="${log4j.jar}"/>
120 - <param name="destdir" value="${log4j.home}"/>
123 - <antcall target="downloadfile">
124 - <param name="sourcefile" value="${logkit.loc}"/>
125 - <param name="destfile" value="${logkit.jar}"/>
126 - <param name="destdir" value="${logkit.home}"/>
129 - <antcall target="downloadfile">
130 - <param name="sourcefile" value="${servletapi.loc}"/>
131 - <param name="destfile" value="${servletapi.jar}"/>
132 - <param name="destdir" value="${servletapi.home}"/>
137 <target name="extras-commons-logging"
138 - depends="extras-commons-logging-prepare,compile,build-manifests"
139 + depends="extras-prepare,compile,build-manifests"
140 description="Build JULI for log4j extras package">
142 - <gunzip src="${commons-logging-src.tar.gz}"
143 - dest="${tomcat.extras}/logging/commons-logging-src.tar"/>
144 - <untar src="${tomcat.extras}/logging/commons-logging-src.tar"
145 - dest="${tomcat.extras}/logging/"/>
147 <replace dir="${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src/src/java/org/apache/commons"
148 encoding="ISO-8859-1">
149 <replacefilter token="org.apache.commons"
150 @@ -1307,7 +1204,8 @@
151 file="${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src/build.xml" />
153 <copy todir="${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src">
154 - <fileset file="${avalon-framework.jar}" />
155 + <fileset file="${avalon-framework-api.jar}" />
156 + <fileset file="${avalon-framework-impl.jar}" />
157 <fileset file="${log4j.jar}" />
158 <fileset file="${logkit.jar}" />
159 <fileset file="${servletapi.jar}" />
160 @@ -1387,18 +1285,6 @@
161 depends="extras-prepare"
162 description="Prepare to build web services extras package">
164 - <antcall target="downloadfile">
165 - <param name="sourcefile" value="${jaxrpc-lib.loc}"/>
166 - <param name="destfile" value="${jaxrpc-lib.jar}"/>
167 - <param name="destdir" value="${jaxrpc-lib.home}"/>
170 - <antcall target="downloadfile">
171 - <param name="sourcefile" value="${wsdl4j-lib.loc}"/>
172 - <param name="destfile" value="${wsdl4j-lib.jar}"/>
173 - <param name="destdir" value="${wsdl4j-lib.home}"/>
176 <copy file="${jaxrpc-lib.jar}"
177 tofile="${tomcat.extras}/webservices/jaxrpc.jar" />
178 <copy file="${wsdl4j-lib.jar}"
179 @@ -1505,7 +1391,7 @@
183 - <target name="dist-prepare" depends="download-dist">
184 + <target name="dist-prepare">
185 <mkdir dir="${tomcat.dist}"/>
186 <mkdir dir="${tomcat.dist}/bin"/>
187 <mkdir dir="${tomcat.dist}/conf"/>
188 @@ -2297,290 +2183,6 @@
189 <delete file="webapps/docs/jdbc-pool.xml"/>
193 - <!-- ================ Download and dependency building =================== -->
195 - <target name="download-validate"
196 - description="Download components necessary to validate source"
197 - if="${execute.validate}">
199 - <antcall target="downloadzip">
200 - <param name="sourcefile" value="${checkstyle.loc}"/>
201 - <param name="destfile" value="${checkstyle.jar}"/>
202 - <param name="destdir" value="${base.path}"/>
207 - <target name="download-compile"
208 - description="Download (and build) components necessary to compile" >
210 - <antcall target="downloadfile-2">
211 - <param name="sourcefile.1" value="${tomcat-native.loc.1}"/>
212 - <param name="sourcefile.2" value="${tomcat-native.loc.2}"/>
213 - <param name="destfile" value="${tomcat-native.tar.gz}"/>
214 - <param name="destdir" value="${tomcat-native.home}"/>
217 - <!-- Download Commons Daemon -->
218 - <antcall target="downloadgz-2">
219 - <param name="sourcefile.1" value="${commons-daemon.bin.loc.1}"/>
220 - <param name="sourcefile.2" value="${commons-daemon.bin.loc.2}"/>
221 - <param name="destfile" value="${commons-daemon.jar}"/>
224 - <antcall target="downloadfile-2">
225 - <param name="sourcefile.1" value="${commons-daemon.native.src.loc.1}"/>
226 - <param name="sourcefile.2" value="${commons-daemon.native.src.loc.2}"/>
227 - <param name="destfile" value="${commons-daemon.native.src.tgz}"/>
228 - <param name="destdir" value="${commons-daemon.home}"/>
231 - <!-- Download src and build Tomcat DBCP bundle -->
232 - <antcall target="downloadgz-2">
233 - <param name="sourcefile.1" value="${commons-pool-src.loc.1}"/>
234 - <param name="sourcefile.2" value="${commons-pool-src.loc.2}"/>
235 - <param name="destfile" value="${commons-pool.home}/build.xml" />
237 - <antcall target="downloadgz-2">
238 - <param name="sourcefile.1" value="${commons-dbcp-src.loc.1}"/>
239 - <param name="sourcefile.2" value="${commons-dbcp-src.loc.2}"/>
240 - <param name="destfile" value="${commons-dbcp.home}/build.xml" />
242 - <mkdir dir="${tomcat-dbcp.home}"/>
243 - <!-- Rebuild dbcp only if built jars do not exist -->
244 - <!-- or new versions of pool or dbcp have been downloaded. -->
245 - <condition property="no.build.dbcp">
247 - <uptodate srcfile="${commons-pool.home}" targetfile="${tomcat-dbcp.jar}" />
248 - <uptodate srcfile="${commons-pool.home}" targetfile="${tomcat-dbcp-src.jar}" />
249 - <uptodate srcfile="${commons-dbcp.home}" targetfile="${tomcat-dbcp.jar}" />
250 - <uptodate srcfile="${commons-dbcp.home}" targetfile="${tomcat-dbcp-src.jar}" />
253 - <antcall target="build-tomcat-dbcp" />
255 - <!-- Download JDT (Eclipse compiler) -->
256 - <antcall target="downloadfile-2">
257 - <param name="sourcefile.1" value="${jdt.loc.1}"/>
258 - <param name="sourcefile.2" value="${jdt.loc.2}"/>
259 - <param name="destfile" value="${jdt.jar}"/>
260 - <param name="destdir" value="${jdt.home}"/>
264 - <target name="download-test-compile"
265 - description="Download additional components for the tests" >
267 - <antcall target="downloadzip">
268 - <param name="sourcefile" value="${junit.loc}"/>
269 - <param name="destfile" value="${junit.jar}"/>
270 - <param name="destdir" value="${base.path}"/>
275 - <target name="download-dist"
276 - description="Download additional components for a distribution" >
278 - <antcall target="downloadzip-2">
279 - <param name="sourcefile.1" value="${tomcat-native.win.1}"/>
280 - <param name="sourcefile.2" value="${tomcat-native.win.2}"/>
281 - <param name="destfile" value="${tomcat-native.home}/LICENSE"/>
282 - <param name="destdir" value="${tomcat-native.home}"/>
285 - <antcall target="downloadzip-2">
286 - <param name="sourcefile.1" value="${commons-daemon.native.win.loc.1}"/>
287 - <param name="sourcefile.2" value="${commons-daemon.native.win.loc.2}"/>
288 - <param name="destfile" value="${commons-daemon.native.win.mgr.exe}"/>
289 - <param name="destdir" value="${commons-daemon.native.win.home}"/>
292 - <antcall target="downloadzip">
293 - <param name="sourcefile" value="${nsis.loc}"/>
294 - <param name="destfile" value="${nsis.exe}"/>
295 - <param name="destdir" value="${nsis.home}/.."/>
301 - <!-- =============== Targets for dependencies that need to =============== -->
302 - <!-- ================ be built rather than used directly ================ -->
304 - <target name="build-tomcat-dbcp" depends="build-manifests" unless="no.build.dbcp">
305 - <copy todir="${tomcat-dbcp.home}">
306 - <fileset dir="${commons-pool.home}">
307 - <include name="**/*.java" />
308 - <exclude name="**/test/**" />
310 - <fileset dir="${commons-dbcp.home}">
311 - <include name="**/*.java" />
312 - <exclude name="**/test/**" />
313 - <exclude name="**/managed/**" />
316 - <replace dir="${tomcat-dbcp.home}/src/java/org/apache/commons"
317 - encoding="ISO-8859-1">
318 - <replacefilter token="org.apache.commons"
319 - value="org.apache.tomcat.dbcp" />
321 - <replace dir="${tomcat-dbcp.home}/src/java/org/apache/commons/pool/impl"
322 - encoding="ISO-8859-1">
323 - <replacefilter token="enum"
324 - value="enumeration" />
327 - <mkdir dir="${tomcat-dbcp.home}/src/java/org/apache/tomcat/dbcp" />
328 - <move todir="${tomcat-dbcp.home}/src/java/org/apache/tomcat/dbcp">
329 - <fileset dir="${tomcat-dbcp.home}/src/java/org/apache/commons" />
331 - <mkdir dir="${tomcat-dbcp.home}/classes"/>
332 - <javac destdir="${tomcat-dbcp.home}/classes"
334 - debug="${compile.debug}"
335 - deprecation="${compile.deprecation}"
336 - source="${compile.source}"
337 - target="${compile.target}"
338 - sourcepath="${tomcat-dbcp.home}/src/java"
339 - srcdir="${tomcat-dbcp.home}/src/java"
340 - encoding="ISO-8859-1"
341 - includeantruntime="false">
342 - <include name="**" />
344 - <jarIt jarfile="${tomcat-dbcp.jar}"
345 - filesDir="${tomcat-dbcp.home}/classes"
346 - filesId="files.tomcat-dbcp" />
347 - <jarIt jarfile="${tomcat-dbcp-src.jar}"
348 - filesDir="${tomcat-dbcp.home}/src/java"
349 - filesId="files.tomcat-dbcp" />
352 - <!-- =============== Utility Targets to support downloads ================ -->
354 - <target name="proxyflags">
355 - <!-- check proxy parameters. -->
356 - <condition property="useproxy">
357 - <equals arg1="${proxy.use}" arg2="on" />
361 - <target name="setproxy" depends="proxyflags" if="useproxy">
362 - <taskdef name="setproxy"
363 - classname="org.apache.tools.ant.taskdefs.optional.net.SetProxy" />
364 - <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"
365 - proxyuser="${proxy.user}" proxypassword="${proxy.password}" />
366 - <echo message="Using ${proxy.host}:${proxy.port} to download ${sourcefile}"/>
369 - <target name="testexist">
370 - <echo message="Testing for ${destfile}"/>
371 - <available file="${destfile}" property="exist"/>
374 - <target name="downloadgz" unless="exist" depends="setproxy,testexist">
375 - <!-- Download and extract the package -->
376 - <get src="${sourcefile}" dest="${base.path}/file.tar.gz" />
377 - <gunzip src="${base.path}/file.tar.gz" dest="${base.path}/file.tar"/>
378 - <untar src="${base.path}/file.tar" dest="${base.path}"/>
379 - <delete file="${base.path}/file.tar"/>
380 - <delete file="${base.path}/file.tar.gz"/>
383 - <target name="downloadgz-2" unless="exist" depends="setproxy,testexist">
384 - <!-- Download and extract the package from the two alternative locations -->
385 - <delete file="${base.path}/file.tar" quiet="true" />
386 - <delete file="${base.path}/file.tar.gz" quiet="true" />
387 - <antcall target="trydownload">
388 - <param name="sourcefile" value="${sourcefile.1}" />
389 - <param name="destfile" value="${base.path}/file.tar.gz" />
391 - <antcall target="trydownload">
392 - <param name="sourcefile" value="${sourcefile.2}" />
393 - <param name="destfile" value="${base.path}/file.tar.gz" />
395 - <gunzip src="${base.path}/file.tar.gz" dest="${base.path}/file.tar"/>
396 - <untar src="${base.path}/file.tar" dest="${base.path}"/>
397 - <delete file="${base.path}/file.tar"/>
398 - <delete file="${base.path}/file.tar.gz"/>
401 - <target name="downloadzip" unless="exist" depends="setproxy,testexist">
402 - <!-- Download and extract the package -->
403 - <get src="${sourcefile}" dest="${base.path}/file.zip" />
404 - <mkdir dir="${destdir}" />
405 - <unzip src="${base.path}/file.zip" dest="${destdir}"/>
406 - <delete file="${base.path}/file.zip"/>
409 - <target name="downloadzip-2" unless="exist" depends="testexist">
410 - <!-- Download and extract the package from the two alternative locations -->
411 - <delete file="${base.path}/file.zip" quiet="true" />
412 - <antcall target="trydownload">
413 - <param name="sourcefile" value="${sourcefile.1}" />
414 - <param name="destfile" value="${base.path}/file.zip" />
416 - <antcall target="trydownload">
417 - <param name="sourcefile" value="${sourcefile.2}" />
418 - <param name="destfile" value="${base.path}/file.zip" />
420 - <mkdir dir="${destdir}" />
421 - <unzip src="${base.path}/file.zip" dest="${destdir}"/>
422 - <delete file="${base.path}/file.zip"/>
425 - <target name="downloadfile" unless="exist" depends="setproxy,testexist">
426 - <!-- Download extract the file -->
427 - <mkdir dir="${destdir}" />
428 - <get src="${sourcefile}" dest="${destfile}" />
431 - <target name="downloadfile-2" unless="exist" depends="testexist">
432 - <!-- Download the file from the two alternative locations -->
433 - <mkdir dir="${destdir}" />
435 - <antcall target="trydownload">
436 - <param name="sourcefile" value="${sourcefile.1}" />
439 - <antcall target="trydownload">
440 - <param name="sourcefile" value="${sourcefile.2}" />
443 - <available file="${destfile}" property="exist"/>
444 - <fail unless="exist" message="Failed to download [${destfile}]. All download sources are unavailable." />
447 - <target name="trydownload.check" depends="setproxy">
448 - <condition property="trydownload.run">
451 - <available file="${destfile}" />
453 - <http url="${sourcefile}" />
458 - <target name="trydownload" if="trydownload.run" depends="trydownload.check">
459 - <!-- Downloads a file if not yet downloaded and the source URL is available -->
460 - <get src="${sourcefile}" dest="${destfile}" />
463 - <!-- ============================ IDE Support ============================ -->
465 - <target name="ide-eclipse" depends="deploy, extras-webservices-prepare"
466 - description="Prepares the source tree to be built in Eclipse">
468 - <!-- Copy the sample project files into the root directory -->
469 - <copy file="${tomcat.home}/res/ide-support/eclipse/eclipse.project" tofile="${tomcat.home}/.project"/>
470 - <copy file="${tomcat.home}/res/ide-support/eclipse/eclipse.classpath" tofile="${tomcat.home}/.classpath"/>
472 - <echo>Eclipse project files created.
473 -Read the Building page on the Apache Tomcat documentation site for details on how to configure your Eclipse workplace.</echo>
476 <!-- ======================= Macros, Taskdefs etc ======================== -->
478 <macrodef name="jarIt" description="utility macro for standard JAR packaging">