1 --- apache-tomcat-7.0.26-src/build.xml 2012-02-17 15:15:30.000000000 +0100
2 +++ apache-tomcat-7.0.26-src.new/build.xml 2012-03-19 10:05:29.185332581 +0100
7 - <target name="validate" depends="download-validate" if="${execute.validate}">
8 - <!-- Required so we can cache checkstyle results -->
9 - <mkdir dir="${tomcat.output}/res/checkstyle"/>
11 - <taskdef resource="checkstyletask.properties"
12 - classpath="${checkstyle.jar}" />
13 - <checkstyle config="res/checkstyle/checkstyle.xml">
15 - <patternset refid="text.files" />
16 - <include name="**/*.bat"/>
17 - <include name="**/*.sh"/>
18 - <exclude name="bin/setenv.*"/>
19 - <exclude name=".*/**"/>
20 - <exclude name="output/**"/>
21 - <exclude name="modules/**"/>
22 - <exclude name="**/*.mdl"/>
23 - <exclude name="**/*_2.xml"/>
24 - <exclude name="res/checkstyle/header-al2.txt"/>
25 - <!-- Exclude auto-generated files -->
26 - <exclude name="java/org/apache/el/parser/ELParser*.java" />
27 - <exclude name="java/org/apache/el/parser/JJTELParserState.java" />
28 - <exclude name="java/org/apache/el/parser/Node.java" />
29 - <exclude name="java/org/apache/el/parser/ParseException.java" />
30 - <exclude name="java/org/apache/el/parser/SimpleCharStream.java" />
31 - <exclude name="java/org/apache/el/parser/Token*.java" />
32 - <!-- Exclude these else Gump runs validate on them -->
33 - <exclude name="**/org/apache/tomcat/dbcp/**"/>
34 - <exclude name="**/tomcat-deps/**"/>
36 - <fileset dir="modules/jdbc-pool" >
37 - <patternset refid="text.files" />
40 - <!-- javax package checks -->
41 - <checkstyle config="res/checkstyle/javax-checkstyle.xml">
42 - <fileset dir="java/javax" >
43 - <include name="**/*.java"/>
46 - <!-- org package checks -->
47 - <checkstyle config="res/checkstyle/org-checkstyle.xml">
48 - <fileset dir="java/org" >
49 - <include name="**/*.java"/>
54 <target name="validate-eoln" depends="compile"
55 description="Validate that the source files have correct line ends">
56 <taskdef name="checkeol"
61 - <target name="compile" depends="build-prepare,download-compile,compile-prepare,validate">
62 + <target name="compile" depends="build-prepare">
63 <!-- Compile internal server components -->
64 <javac srcdir="java" destdir="${tomcat.classes}"
65 debug="${compile.debug}"
67 <target name="deploy" depends="package,build-docs"
68 description="Default. Builds a working Tomcat instance">
70 - <copy tofile="${tomcat.build}/bin/tomcat-native.tar.gz"
71 - file="${tomcat-native.tar.gz}" />
72 - <copy tofile="${tomcat.build}/bin/commons-daemon-native.tar.gz"
73 - file="${commons-daemon.native.src.tgz}" />
75 - <copy tofile="${tomcat.build}/bin/commons-daemon.jar" file="${commons-daemon.jar}" />
78 <copy todir="${tomcat.build}/bin">
84 - <target name="test-compile" depends="compile,download-test-compile" >
85 + <target name="test-compile" depends="compile" >
86 <mkdir dir="${test.classes}"/>
88 <javac srcdir="test" destdir="${test.classes}"
89 @@ -1183,52 +1129,10 @@
90 <mkdir dir="${tomcat.extras}/webservices"/>
93 - <target name="extras-commons-logging-prepare"
94 - depends="extras-prepare"
95 - description="Prepare to build web services extras package">
97 - <antcall target="downloadfile-2">
98 - <param name="sourcefile.1" value="${commons-logging-src.loc.1}"/>
99 - <param name="sourcefile.2" value="${commons-logging-src.loc.2}"/>
100 - <param name="destfile" value="${commons-logging-src.tar.gz}"/>
101 - <param name="destdir" value="${commons-logging.home}"/>
104 - <antcall target="downloadfile">
105 - <param name="sourcefile" value="${avalon-framework.loc}"/>
106 - <param name="destfile" value="${avalon-framework.jar}"/>
107 - <param name="destdir" value="${avalon-framework.home}"/>
110 - <antcall target="downloadfile">
111 - <param name="sourcefile" value="${log4j.loc}"/>
112 - <param name="destfile" value="${log4j.jar}"/>
113 - <param name="destdir" value="${log4j.home}"/>
116 - <antcall target="downloadfile">
117 - <param name="sourcefile" value="${logkit.loc}"/>
118 - <param name="destfile" value="${logkit.jar}"/>
119 - <param name="destdir" value="${logkit.home}"/>
122 - <antcall target="downloadfile">
123 - <param name="sourcefile" value="${servletapi.loc}"/>
124 - <param name="destfile" value="${servletapi.jar}"/>
125 - <param name="destdir" value="${servletapi.home}"/>
130 <target name="extras-commons-logging"
131 - depends="extras-commons-logging-prepare,compile,build-manifests"
132 + depends="extras-prepare,compile,build-manifests"
133 description="Build JULI for log4j extras package">
135 - <gunzip src="${commons-logging-src.tar.gz}"
136 - dest="${tomcat.extras}/logging/commons-logging-src.tar"/>
137 - <untar src="${tomcat.extras}/logging/commons-logging-src.tar"
138 - dest="${tomcat.extras}/logging/"/>
140 <replace dir="${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src/src/java/org/apache/commons"
141 encoding="ISO-8859-1">
142 <replacefilter token="org.apache.commons"
143 @@ -1250,7 +1154,8 @@
144 file="${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src/build.xml" />
146 <copy todir="${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src">
147 - <fileset file="${avalon-framework.jar}" />
148 + <fileset file="${avalon-framework-api.jar}" />
149 + <fileset file="${avalon-framework-impl.jar}" />
150 <fileset file="${log4j.jar}" />
151 <fileset file="${logkit.jar}" />
152 <fileset file="${servletapi.jar}" />
153 @@ -1330,18 +1235,6 @@
154 depends="extras-prepare"
155 description="Prepare to build web services extras package">
157 - <antcall target="downloadfile">
158 - <param name="sourcefile" value="${jaxrpc-lib.loc}"/>
159 - <param name="destfile" value="${jaxrpc-lib.jar}"/>
160 - <param name="destdir" value="${jaxrpc-lib.home}"/>
163 - <antcall target="downloadfile">
164 - <param name="sourcefile" value="${wsdl4j-lib.loc}"/>
165 - <param name="destfile" value="${wsdl4j-lib.jar}"/>
166 - <param name="destdir" value="${wsdl4j-lib.home}"/>
169 <copy file="${jaxrpc-lib.jar}"
170 tofile="${tomcat.extras}/webservices/jaxrpc.jar" />
171 <copy file="${wsdl4j-lib.jar}"
172 @@ -1448,7 +1341,7 @@
176 - <target name="dist-prepare" depends="download-dist">
177 + <target name="dist-prepare">
178 <mkdir dir="${tomcat.dist}"/>
179 <mkdir dir="${tomcat.dist}/bin"/>
180 <mkdir dir="${tomcat.dist}/conf"/>
181 @@ -2236,304 +2129,6 @@
182 <delete file="webapps/docs/jdbc-pool.xml"/>
186 - <!-- ================ Download and dependency building =================== -->
188 - <target name="download-validate"
189 - description="Download components necessary to validate source"
190 - if="${execute.validate}">
192 - <antcall target="downloadzip">
193 - <param name="sourcefile" value="${checkstyle.loc}"/>
194 - <param name="destfile" value="${checkstyle.jar}"/>
195 - <param name="destdir" value="${base.path}"/>
200 - <target name="download-compile"
201 - description="Download (and build) components necessary to compile" >
203 - <antcall target="downloadfile-2">
204 - <param name="sourcefile.1" value="${tomcat-native.loc.1}"/>
205 - <param name="sourcefile.2" value="${tomcat-native.loc.2}"/>
206 - <param name="destfile" value="${tomcat-native.tar.gz}"/>
207 - <param name="destdir" value="${tomcat-native.home}"/>
210 - <!-- Download Commons Daemon -->
211 - <antcall target="downloadgz-2">
212 - <param name="sourcefile.1" value="${commons-daemon.bin.loc.1}"/>
213 - <param name="sourcefile.2" value="${commons-daemon.bin.loc.2}"/>
214 - <param name="destfile" value="${commons-daemon.jar}"/>
217 - <antcall target="downloadfile-2">
218 - <param name="sourcefile.1" value="${commons-daemon.native.src.loc.1}"/>
219 - <param name="sourcefile.2" value="${commons-daemon.native.src.loc.2}"/>
220 - <param name="destfile" value="${commons-daemon.native.src.tgz}"/>
221 - <param name="destdir" value="${commons-daemon.home}"/>
224 - <!-- Download src and build Tomcat DBCP bundle -->
225 - <antcall target="downloadgz-2">
226 - <param name="sourcefile.1" value="${commons-pool-src.loc.1}"/>
227 - <param name="sourcefile.2" value="${commons-pool-src.loc.2}"/>
228 - <param name="destfile" value="${commons-pool.home}/build.xml" />
230 - <antcall target="downloadgz-2">
231 - <param name="sourcefile.1" value="${commons-dbcp-src.loc.1}"/>
232 - <param name="sourcefile.2" value="${commons-dbcp-src.loc.2}"/>
233 - <param name="destfile" value="${commons-dbcp.home}/build.xml" />
235 - <mkdir dir="${tomcat-dbcp.home}"/>
236 - <!-- Rebuild dbcp only if built jars do not exist -->
237 - <!-- or new versions of pool or dbcp have been downloaded. -->
238 - <condition property="no.build.dbcp">
240 - <uptodate srcfile="${commons-pool.home}" targetfile="${tomcat-dbcp.jar}" />
241 - <uptodate srcfile="${commons-pool.home}" targetfile="${tomcat-dbcp-src.jar}" />
242 - <uptodate srcfile="${commons-dbcp.home}" targetfile="${tomcat-dbcp.jar}" />
243 - <uptodate srcfile="${commons-dbcp.home}" targetfile="${tomcat-dbcp-src.jar}" />
246 - <antcall target="build-tomcat-dbcp" />
248 - <!-- Download JDT (Eclipse compiler) -->
249 - <antcall target="downloadfile-2">
250 - <param name="sourcefile.1" value="${jdt.loc.1}"/>
251 - <param name="sourcefile.2" value="${jdt.loc.2}"/>
252 - <param name="destfile" value="${jdt.jar}"/>
253 - <param name="destdir" value="${jdt.home}"/>
257 - <target name="download-test-compile"
258 - description="Download additional components for the tests" >
260 - <antcall target="downloadzip">
261 - <param name="sourcefile" value="${junit.loc}"/>
262 - <param name="destfile" value="${junit.jar}"/>
263 - <param name="destdir" value="${base.path}"/>
268 - <target name="download-dist"
269 - description="Download additional components for a distribution" >
271 - <antcall target="downloadfile-2">
272 - <param name="sourcefile.1" value="${tomcat-native.dll.1}/win32/tcnative-1.dll"/>
273 - <param name="sourcefile.2" value="${tomcat-native.dll.2}/win32/tcnative-1.dll"/>
274 - <param name="destfile" value="${tomcat-native.dll.win32}"/>
275 - <param name="destdir" value="${tomcat-native.home}"/>
278 - <antcall target="downloadfile-2">
279 - <param name="sourcefile.1" value="${tomcat-native.dll.1}/win64/x64/tcnative-1.dll"/>
280 - <param name="sourcefile.2" value="${tomcat-native.dll.2}/win64/x64/tcnative-1.dll"/>
281 - <param name="destfile" value="${tomcat-native.dll.x64}"/>
282 - <param name="destdir" value="${tomcat-native.home}"/>
285 - <antcall target="downloadfile-2">
286 - <param name="sourcefile.1" value="${tomcat-native.dll.1}/win64/ia64/tcnative-1.dll"/>
287 - <param name="sourcefile.2" value="${tomcat-native.dll.2}/win64/ia64/tcnative-1.dll"/>
288 - <param name="destfile" value="${tomcat-native.dll.i64}"/>
289 - <param name="destdir" value="${tomcat-native.home}"/>
292 - <antcall target="downloadzip-2">
293 - <param name="sourcefile.1" value="${commons-daemon.native.win.loc.1}"/>
294 - <param name="sourcefile.2" value="${commons-daemon.native.win.loc.2}"/>
295 - <param name="destfile" value="${commons-daemon.native.win.mgr.exe}"/>
296 - <param name="destdir" value="${commons-daemon.native.win.home}"/>
299 - <antcall target="downloadzip">
300 - <param name="sourcefile" value="${nsis.loc}"/>
301 - <param name="destfile" value="${nsis.exe}"/>
302 - <param name="destdir" value="${nsis.home}/.."/>
308 - <!-- =============== Targets for dependencies that need to =============== -->
309 - <!-- ================ be built rather than used directly ================ -->
311 - <target name="build-tomcat-dbcp" depends="build-manifests" unless="no.build.dbcp">
312 - <copy todir="${tomcat-dbcp.home}">
313 - <fileset dir="${commons-pool.home}">
314 - <include name="**/*.java" />
315 - <exclude name="**/test/**" />
317 - <fileset dir="${commons-dbcp.home}">
318 - <include name="**/*.java" />
319 - <exclude name="**/test/**" />
320 - <exclude name="**/managed/**" />
323 - <replace dir="${tomcat-dbcp.home}/src/java/org/apache/commons"
324 - encoding="ISO-8859-1">
325 - <replacefilter token="org.apache.commons"
326 - value="org.apache.tomcat.dbcp" />
328 - <replace dir="${tomcat-dbcp.home}/src/java/org/apache/commons/pool/impl"
329 - encoding="ISO-8859-1">
330 - <replacefilter token="enum"
331 - value="enumeration" />
334 - <mkdir dir="${tomcat-dbcp.home}/src/java/org/apache/tomcat/dbcp" />
335 - <move todir="${tomcat-dbcp.home}/src/java/org/apache/tomcat/dbcp">
336 - <fileset dir="${tomcat-dbcp.home}/src/java/org/apache/commons" />
338 - <mkdir dir="${tomcat-dbcp.home}/classes"/>
339 - <javac destdir="${tomcat-dbcp.home}/classes"
341 - debug="${compile.debug}"
342 - deprecation="${compile.deprecation}"
343 - source="${compile.source}"
344 - target="${compile.target}"
345 - sourcepath="${tomcat-dbcp.home}/src/java"
346 - srcdir="${tomcat-dbcp.home}/src/java"
347 - encoding="ISO-8859-1"
348 - includeantruntime="false">
349 - <include name="**" />
351 - <jarIt jarfile="${tomcat-dbcp.jar}"
352 - filesDir="${tomcat-dbcp.home}/classes"
353 - filesId="files.tomcat-dbcp" />
354 - <jarIt jarfile="${tomcat-dbcp-src.jar}"
355 - filesDir="${tomcat-dbcp.home}/src/java"
356 - filesId="files.tomcat-dbcp" />
359 - <!-- =============== Utility Targets to support downloads ================ -->
361 - <target name="proxyflags">
362 - <!-- check proxy parameters. -->
363 - <condition property="useproxy">
364 - <equals arg1="${proxy.use}" arg2="on" />
368 - <target name="setproxy" depends="proxyflags" if="useproxy">
369 - <taskdef name="setproxy"
370 - classname="org.apache.tools.ant.taskdefs.optional.net.SetProxy" />
371 - <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"
372 - proxyuser="${proxy.user}" proxypassword="${proxy.password}" />
373 - <echo message="Using ${proxy.host}:${proxy.port} to download ${sourcefile}"/>
376 - <target name="testexist">
377 - <echo message="Testing for ${destfile}"/>
378 - <available file="${destfile}" property="exist"/>
381 - <target name="downloadgz" unless="exist" depends="setproxy,testexist">
382 - <!-- Download and extract the package -->
383 - <get src="${sourcefile}" dest="${base.path}/file.tar.gz" />
384 - <gunzip src="${base.path}/file.tar.gz" dest="${base.path}/file.tar"/>
385 - <untar src="${base.path}/file.tar" dest="${base.path}"/>
386 - <delete file="${base.path}/file.tar"/>
387 - <delete file="${base.path}/file.tar.gz"/>
390 - <target name="downloadgz-2" unless="exist" depends="setproxy,testexist">
391 - <!-- Download and extract the package from the two alternative locations -->
392 - <delete file="${base.path}/file.tar" quiet="true" />
393 - <delete file="${base.path}/file.tar.gz" quiet="true" />
394 - <antcall target="trydownload">
395 - <param name="sourcefile" value="${sourcefile.1}" />
396 - <param name="destfile" value="${base.path}/file.tar.gz" />
398 - <antcall target="trydownload">
399 - <param name="sourcefile" value="${sourcefile.2}" />
400 - <param name="destfile" value="${base.path}/file.tar.gz" />
402 - <gunzip src="${base.path}/file.tar.gz" dest="${base.path}/file.tar"/>
403 - <untar src="${base.path}/file.tar" dest="${base.path}"/>
404 - <delete file="${base.path}/file.tar"/>
405 - <delete file="${base.path}/file.tar.gz"/>
408 - <target name="downloadzip" unless="exist" depends="setproxy,testexist">
409 - <!-- Download and extract the package -->
410 - <get src="${sourcefile}" dest="${base.path}/file.zip" />
411 - <mkdir dir="${destdir}" />
412 - <unzip src="${base.path}/file.zip" dest="${destdir}"/>
413 - <delete file="${base.path}/file.zip"/>
416 - <target name="downloadzip-2" unless="exist" depends="testexist">
417 - <!-- Download and extract the package from the two alternative locations -->
418 - <delete file="${base.path}/file.zip" quiet="true" />
419 - <antcall target="trydownload">
420 - <param name="sourcefile" value="${sourcefile.1}" />
421 - <param name="destfile" value="${base.path}/file.zip" />
423 - <antcall target="trydownload">
424 - <param name="sourcefile" value="${sourcefile.2}" />
425 - <param name="destfile" value="${base.path}/file.zip" />
427 - <mkdir dir="${destdir}" />
428 - <unzip src="${base.path}/file.zip" dest="${destdir}"/>
429 - <delete file="${base.path}/file.zip"/>
432 - <target name="downloadfile" unless="exist" depends="setproxy,testexist">
433 - <!-- Download extract the file -->
434 - <mkdir dir="${destdir}" />
435 - <get src="${sourcefile}" dest="${destfile}" />
438 - <target name="downloadfile-2" unless="exist" depends="testexist">
439 - <!-- Download the file from the two alternative locations -->
440 - <mkdir dir="${destdir}" />
442 - <antcall target="trydownload">
443 - <param name="sourcefile" value="${sourcefile.1}" />
446 - <antcall target="trydownload">
447 - <param name="sourcefile" value="${sourcefile.2}" />
450 - <available file="${destfile}" property="exist"/>
451 - <fail unless="exist" message="Failed to download [${destfile}]. All download sources are unavailable." />
454 - <target name="trydownload.check" depends="setproxy">
455 - <condition property="trydownload.run">
458 - <available file="${destfile}" />
460 - <http url="${sourcefile}" />
465 - <target name="trydownload" if="trydownload.run" depends="trydownload.check">
466 - <!-- Downloads a file if not yet downloaded and the source URL is available -->
467 - <get src="${sourcefile}" dest="${destfile}" />
470 - <!-- ============================ IDE Support ============================ -->
472 - <target name="ide-eclipse" depends="deploy, extras-webservices-prepare"
473 - description="Prepares the source tree to be built in Eclipse">
475 - <!-- Copy the sample project files into the root directory -->
476 - <copy file="${tomcat.home}/res/ide-support/eclipse/eclipse.project" tofile="${tomcat.home}/.project"/>
477 - <copy file="${tomcat.home}/res/ide-support/eclipse/eclipse.classpath" tofile="${tomcat.home}/.classpath"/>
479 - <echo>Eclipse project files created.
480 -Read the Building page on the Apache Tomcat documentation site for details on how to configure your Eclipse workplace.</echo>
483 <!-- ======================= Macros, Taskdefs etc ======================== -->
485 <macrodef name="jarIt" description="utility macro for standard JAR packaging">