1 --- apache-tomcat-7.0.52-src/build.xml.orig 2014-02-13 08:40:56.000000000 +0100
2 +++ apache-tomcat-7.0.52-src/build.xml 2014-02-28 11:21:53.676705236 +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">
65 <target name="compile" depends="compile-java6,compile-java7" />
67 <target name="compile-java6"
68 - depends="build-prepare,download-compile,compile-prepare,validate">
69 + 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}"
100 - <target name="cobertura-instrument" depends="compile,download-cobertura,cobertura-disabled"
101 + <target name="cobertura-instrument" depends="compile,cobertura-disabled"
102 if="${test.cobertura}"
103 description="Adds Cobertura instrumentation to the compiled bytecode">
105 @@ -1430,52 +1369,10 @@
106 <mkdir dir="${tomcat.extras}/webservices"/>
109 - <target name="extras-commons-logging-prepare"
110 - depends="extras-prepare"
111 - description="Prepare to build web services extras package">
113 - <antcall target="downloadfile-2">
114 - <param name="sourcefile.1" value="${commons-logging-src.loc.1}"/>
115 - <param name="sourcefile.2" value="${commons-logging-src.loc.2}"/>
116 - <param name="destfile" value="${commons-logging-src.tar.gz}"/>
117 - <param name="destdir" value="${commons-logging.home}"/>
120 - <antcall target="downloadfile">
121 - <param name="sourcefile" value="${avalon-framework.loc}"/>
122 - <param name="destfile" value="${avalon-framework.jar}"/>
123 - <param name="destdir" value="${avalon-framework.home}"/>
126 - <antcall target="downloadfile">
127 - <param name="sourcefile" value="${log4j.loc}"/>
128 - <param name="destfile" value="${log4j.jar}"/>
129 - <param name="destdir" value="${log4j.home}"/>
132 - <antcall target="downloadfile">
133 - <param name="sourcefile" value="${logkit.loc}"/>
134 - <param name="destfile" value="${logkit.jar}"/>
135 - <param name="destdir" value="${logkit.home}"/>
138 - <antcall target="downloadfile">
139 - <param name="sourcefile" value="${servletapi.loc}"/>
140 - <param name="destfile" value="${servletapi.jar}"/>
141 - <param name="destdir" value="${servletapi.home}"/>
146 <target name="extras-commons-logging"
147 - depends="extras-commons-logging-prepare,compile,build-manifests"
148 + depends="compile,build-manifests"
149 description="Build JULI for log4j extras package">
151 - <gunzip src="${commons-logging-src.tar.gz}"
152 - dest="${tomcat.extras}/logging/commons-logging-src.tar"/>
153 - <untar src="${tomcat.extras}/logging/commons-logging-src.tar"
154 - dest="${tomcat.extras}/logging/"/>
156 <replace dir="${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src/src/main/java/org/apache/commons"
157 encoding="ISO-8859-1">
158 <replacefilter token="org.apache.commons"
159 @@ -1497,7 +1394,8 @@
160 file="${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src/build.xml" />
162 <copy todir="${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src">
163 - <fileset file="${avalon-framework.jar}" />
164 + <fileset file="${avalon-framework-api.jar}" />
165 + <fileset file="${avalon-framework-impl.jar}" />
166 <fileset file="${log4j.jar}" />
167 <fileset file="${logkit.jar}" />
168 <fileset file="${servletapi.jar}" />
169 @@ -1577,18 +1475,6 @@
170 depends="extras-prepare"
171 description="Prepare to build web services extras package">
173 - <antcall target="downloadfile">
174 - <param name="sourcefile" value="${jaxrpc-lib.loc}"/>
175 - <param name="destfile" value="${jaxrpc-lib.jar}"/>
176 - <param name="destdir" value="${jaxrpc-lib.home}"/>
179 - <antcall target="downloadfile">
180 - <param name="sourcefile" value="${wsdl4j-lib.loc}"/>
181 - <param name="destfile" value="${wsdl4j-lib.jar}"/>
182 - <param name="destdir" value="${wsdl4j-lib.home}"/>
185 <copy file="${jaxrpc-lib.jar}"
186 tofile="${tomcat.extras}/webservices/jaxrpc.jar" />
187 <copy file="${wsdl4j-lib.jar}"
188 @@ -1694,7 +1580,7 @@
192 - <target name="dist-prepare" depends="download-dist">
193 + <target name="dist-prepare">
194 <mkdir dir="${tomcat.dist}"/>
195 <mkdir dir="${tomcat.dist}/bin"/>
196 <mkdir dir="${tomcat.dist}/conf"/>
197 @@ -2602,292 +2488,6 @@
201 - <!-- ================ Download and dependency building =================== -->
203 - <target name="download-validate"
204 - description="Download components necessary to validate source"
205 - if="${execute.validate}">
207 - <antcall target="downloadzip">
208 - <param name="sourcefile" value="${checkstyle.loc}"/>
209 - <param name="destfile" value="${checkstyle.jar}"/>
210 - <param name="destdir" value="${base.path}"/>
215 - <target name="download-compile"
216 - description="Download (and build) components necessary to compile" >
218 - <antcall target="downloadfile-2">
219 - <param name="sourcefile.1" value="${tomcat-native.loc.1}"/>
220 - <param name="sourcefile.2" value="${tomcat-native.loc.2}"/>
221 - <param name="destfile" value="${tomcat-native.tar.gz}"/>
222 - <param name="destdir" value="${tomcat-native.home}"/>
225 - <!-- Download Commons Daemon -->
226 - <antcall target="downloadgz-2">
227 - <param name="sourcefile.1" value="${commons-daemon.bin.loc.1}"/>
228 - <param name="sourcefile.2" value="${commons-daemon.bin.loc.2}"/>
229 - <param name="destfile" value="${commons-daemon.jar}"/>
232 - <antcall target="downloadfile-2">
233 - <param name="sourcefile.1" value="${commons-daemon.native.src.loc.1}"/>
234 - <param name="sourcefile.2" value="${commons-daemon.native.src.loc.2}"/>
235 - <param name="destfile" value="${commons-daemon.native.src.tgz}"/>
236 - <param name="destdir" value="${commons-daemon.home}"/>
239 - <!-- Download src and build Tomcat DBCP bundle -->
240 - <antcall target="downloadgz-2">
241 - <param name="sourcefile.1" value="${commons-pool-src.loc.1}"/>
242 - <param name="sourcefile.2" value="${commons-pool-src.loc.2}"/>
243 - <param name="destfile" value="${commons-pool.home}/build.xml" />
245 - <antcall target="downloadgz-2">
246 - <param name="sourcefile.1" value="${commons-dbcp-src.loc.1}"/>
247 - <param name="sourcefile.2" value="${commons-dbcp-src.loc.2}"/>
248 - <param name="destfile" value="${commons-dbcp.home}/build.xml" />
250 - <mkdir dir="${tomcat-dbcp.home}"/>
251 - <!-- Rebuild dbcp only if built jars do not exist -->
252 - <!-- or new versions of pool or dbcp have been downloaded. -->
253 - <condition property="no.build.dbcp">
255 - <uptodate srcfile="${commons-pool.home}" targetfile="${tomcat-dbcp.jar}" />
256 - <uptodate srcfile="${commons-pool.home}" targetfile="${tomcat-dbcp-src.jar}" />
257 - <uptodate srcfile="${commons-dbcp.home}" targetfile="${tomcat-dbcp.jar}" />
258 - <uptodate srcfile="${commons-dbcp.home}" targetfile="${tomcat-dbcp-src.jar}" />
261 - <antcall target="build-tomcat-dbcp" />
263 - <!-- Download JDT (Eclipse compiler) -->
264 - <antcall target="downloadfile-2">
265 - <param name="sourcefile.1" value="${jdt.loc.1}"/>
266 - <param name="sourcefile.2" value="${jdt.loc.2}"/>
267 - <param name="destfile" value="${jdt.jar}"/>
268 - <param name="destdir" value="${jdt.home}"/>
272 - <target name="download-test-compile"
273 - description="Download additional components for the tests" >
275 - <antcall target="downloadfile">
276 - <param name="sourcefile" value="${junit.loc}"/>
277 - <param name="destfile" value="${junit.jar}"/>
278 - <param name="destdir" value="${junit.home}"/>
281 - <antcall target="downloadfile">
282 - <param name="sourcefile" value="${hamcrest.loc}"/>
283 - <param name="destfile" value="${hamcrest.jar}"/>
284 - <param name="destdir" value="${hamcrest.home}"/>
289 - <target name="download-cobertura"
290 - if="${test.cobertura}"
291 - description="Download the Cobertura code coverage tool" >
293 - <antcall target="downloadgz">
294 - <param name="sourcefile" value="${cobertura.loc}"/>
295 - <param name="destfile" value="${cobertura.jar}"/>
300 - <target name="download-dist"
301 - description="Download additional components for a distribution" >
303 - <antcall target="downloadzip-2">
304 - <param name="sourcefile.1" value="${tomcat-native.win.1}"/>
305 - <param name="sourcefile.2" value="${tomcat-native.win.2}"/>
306 - <param name="destfile" value="${tomcat-native.home}/LICENSE"/>
307 - <param name="destdir" value="${tomcat-native.home}"/>
310 - <antcall target="downloadzip-2">
311 - <param name="sourcefile.1" value="${commons-daemon.native.win.loc.1}"/>
312 - <param name="sourcefile.2" value="${commons-daemon.native.win.loc.2}"/>
313 - <param name="destfile" value="${commons-daemon.native.win.mgr.exe}"/>
314 - <param name="destdir" value="${commons-daemon.native.win.home}"/>
317 - <antcall target="downloadzip">
318 - <param name="sourcefile" value="${nsis.loc}"/>
319 - <param name="destfile" value="${nsis.exe}"/>
320 - <param name="destdir" value="${nsis.home}/.."/>
326 - <!-- =============== Targets for dependencies that need to =============== -->
327 - <!-- ================ be built rather than used directly ================ -->
329 - <target name="build-tomcat-dbcp" depends="build-manifests" unless="no.build.dbcp">
330 - <copy todir="${tomcat-dbcp.home}">
331 - <fileset dir="${commons-pool.home}">
332 - <include name="**/*.java" />
333 - <exclude name="**/test/**" />
335 - <fileset dir="${commons-dbcp.home}">
336 - <include name="**/*.java" />
337 - <exclude name="**/test/**" />
338 - <exclude name="**/managed/**" />
341 - <replace dir="${tomcat-dbcp.home}/src/java/org/apache/commons"
342 - encoding="ISO-8859-1">
343 - <replacefilter token="org.apache.commons"
344 - value="org.apache.tomcat.dbcp" />
346 - <replace dir="${tomcat-dbcp.home}/src/java/org/apache/commons/pool/impl"
347 - encoding="ISO-8859-1">
348 - <replacefilter token="enum"
349 - value="enumeration" />
352 - <mkdir dir="${tomcat-dbcp.home}/src/java/org/apache/tomcat/dbcp" />
353 - <move todir="${tomcat-dbcp.home}/src/java/org/apache/tomcat/dbcp">
354 - <fileset dir="${tomcat-dbcp.home}/src/java/org/apache/commons" />
356 - <mkdir dir="${tomcat-dbcp.home}/classes"/>
357 - <javac destdir="${tomcat-dbcp.home}/classes"
358 - debug="${compile.debug}"
359 - deprecation="${compile.deprecation}"
360 - source="${compile.source}"
361 - target="${compile.target}"
362 - sourcepath="${tomcat-dbcp.home}/src/java"
363 - srcdir="${tomcat-dbcp.home}/src/java"
364 - encoding="ISO-8859-1"
365 - includeantruntime="false">
366 - <include name="**" />
368 - <jarIt jarfile="${tomcat-dbcp.jar}"
369 - filesDir="${tomcat-dbcp.home}/classes"
370 - filesId="files.tomcat-dbcp" />
371 - <jarIt jarfile="${tomcat-dbcp-src.jar}"
372 - filesDir="${tomcat-dbcp.home}/src/java"
373 - filesId="files.tomcat-dbcp" />
376 - <!-- =============== Utility Targets to support downloads ================ -->
378 - <target name="proxyflags">
379 - <!-- check proxy parameters. -->
380 - <condition property="useproxy">
381 - <equals arg1="${proxy.use}" arg2="on" />
385 - <target name="setproxy" depends="proxyflags" if="useproxy">
386 - <taskdef name="setproxy"
387 - classname="org.apache.tools.ant.taskdefs.optional.net.SetProxy" />
388 - <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"
389 - proxyuser="${proxy.user}" proxypassword="${proxy.password}" />
390 - <echo message="Using ${proxy.host}:${proxy.port} to download ${sourcefile}"/>
393 - <target name="testexist">
394 - <echo message="Testing for ${destfile}"/>
395 - <available file="${destfile}" property="exist"/>
398 - <target name="downloadgz" unless="exist" depends="setproxy,testexist">
399 - <!-- Download and extract the package -->
400 - <get src="${sourcefile}" httpusecaches="${trydownload.httpusecaches}" dest="${base.path}/file.tar.gz" />
401 - <gunzip src="${base.path}/file.tar.gz" dest="${base.path}/file.tar"/>
402 - <untar src="${base.path}/file.tar" dest="${base.path}"/>
403 - <delete file="${base.path}/file.tar"/>
404 - <delete file="${base.path}/file.tar.gz"/>
407 - <target name="downloadgz-2" unless="exist" depends="setproxy,testexist">
408 - <!-- Download and extract the package from the two alternative locations -->
409 - <delete file="${base.path}/file.tar" quiet="true" />
410 - <delete file="${base.path}/file.tar.gz" quiet="true" />
411 - <antcall target="trydownload">
412 - <param name="sourcefile" value="${sourcefile.1}" />
413 - <param name="destfile" value="${base.path}/file.tar.gz" />
415 - <antcall target="trydownload">
416 - <param name="sourcefile" value="${sourcefile.2}" />
417 - <param name="destfile" value="${base.path}/file.tar.gz" />
419 - <gunzip src="${base.path}/file.tar.gz" dest="${base.path}/file.tar"/>
420 - <untar src="${base.path}/file.tar" dest="${base.path}"/>
421 - <delete file="${base.path}/file.tar"/>
422 - <delete file="${base.path}/file.tar.gz"/>
425 - <target name="downloadzip" unless="exist" depends="setproxy,testexist">
426 - <!-- Download and extract the package -->
427 - <get src="${sourcefile}" httpusecaches="${trydownload.httpusecaches}" dest="${base.path}/file.zip" />
428 - <mkdir dir="${destdir}" />
429 - <unzip src="${base.path}/file.zip" dest="${destdir}"/>
430 - <delete file="${base.path}/file.zip"/>
433 - <target name="downloadzip-2" unless="exist" depends="testexist">
434 - <!-- Download and extract the package from the two alternative locations -->
435 - <delete file="${base.path}/file.zip" quiet="true" />
436 - <antcall target="trydownload">
437 - <param name="sourcefile" value="${sourcefile.1}" />
438 - <param name="destfile" value="${base.path}/file.zip" />
440 - <antcall target="trydownload">
441 - <param name="sourcefile" value="${sourcefile.2}" />
442 - <param name="destfile" value="${base.path}/file.zip" />
444 - <mkdir dir="${destdir}" />
445 - <unzip src="${base.path}/file.zip" dest="${destdir}"/>
446 - <delete file="${base.path}/file.zip"/>
449 - <target name="downloadfile" unless="exist" depends="setproxy,testexist">
450 - <!-- Download extract the file -->
451 - <mkdir dir="${destdir}" />
452 - <get src="${sourcefile}" httpusecaches="${trydownload.httpusecaches}" dest="${destfile}" />
455 - <target name="downloadfile-2" unless="exist" depends="testexist">
456 - <!-- Download the file from the two alternative locations -->
457 - <mkdir dir="${destdir}" />
459 - <antcall target="trydownload">
460 - <param name="sourcefile" value="${sourcefile.1}" />
463 - <antcall target="trydownload">
464 - <param name="sourcefile" value="${sourcefile.2}" />
467 - <available file="${destfile}" property="exist"/>
468 - <fail unless="exist" message="Failed to download [${destfile}]. All download sources are unavailable." />
471 - <target name="trydownload.check" depends="setproxy">
472 - <condition property="trydownload.run">
475 - <available file="${destfile}" />
477 - <http url="${sourcefile}" />
482 - <target name="trydownload" if="trydownload.run" depends="trydownload.check">
483 - <!-- Downloads a file if not yet downloaded and the source URL is available -->
484 - <get src="${sourcefile}" httpusecaches="${trydownload.httpusecaches}" dest="${destfile}" />
487 <!-- ============================ IDE Support ============================ -->
489 <target name="ide-eclipse" depends="deploy, extras-webservices-prepare"