1 --- apache-tomcat-7.0.8-src/build.xml.orig 2011-02-04 13:52:30.000000000 +0100
2 +++ apache-tomcat-7.0.8-src/build.xml 2011-02-05 13:57:36.775158905 +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/**"/>
37 - <!-- javax package checks -->
38 - <checkstyle config="res/checkstyle/javax-checkstyle.xml">
39 - <fileset dir="java/javax" >
40 - <include name="**/*.java"/>
43 - <!-- org package checks -->
44 - <checkstyle config="res/checkstyle/org-checkstyle.xml">
45 - <fileset dir="java/org" >
46 - <include name="**/*.java"/>
51 - <target name="compile" depends="build-prepare,download-compile,validate">
52 + <target name="compile" depends="build-prepare">
54 <!-- Compile internal server components -->
55 <javac srcdir="java" destdir="${tomcat.classes}"
57 <target name="deploy" depends="package,build-docs"
58 description="Default. Builds a working Tomcat instance">
60 - <copy tofile="${tomcat.build}/bin/tomcat-native.tar.gz"
61 - file="${tomcat-native.tar.gz}" />
62 - <copy tofile="${tomcat.build}/bin/commons-daemon-native.tar.gz"
63 - file="${commons-daemon.native.src.tgz}" />
65 - <copy tofile="${tomcat.build}/bin/commons-daemon.jar" file="${commons-daemon.jar}" />
68 <copy todir="${tomcat.build}/bin">
74 - <target name="test-compile" depends="compile,download-test-compile" >
75 + <target name="test-compile" depends="compile" >
76 <mkdir dir="${test.classes}"/>
78 <javac srcdir="test" destdir="${test.classes}"
79 @@ -1103,52 +1055,10 @@
80 <mkdir dir="${tomcat.extras}/webservices"/>
83 - <target name="extras-commons-logging-prepare"
84 - depends="extras-prepare"
85 - description="Prepare to build web services extras package">
87 - <antcall target="downloadfile-2">
88 - <param name="sourcefile.1" value="${commons-logging-src.loc.1}"/>
89 - <param name="sourcefile.2" value="${commons-logging-src.loc.2}"/>
90 - <param name="destfile" value="${commons-logging-src.tar.gz}"/>
91 - <param name="destdir" value="${commons-logging.home}"/>
94 - <antcall target="downloadfile">
95 - <param name="sourcefile" value="${avalon-framework.loc}"/>
96 - <param name="destfile" value="${avalon-framework.jar}"/>
97 - <param name="destdir" value="${avalon-framework.home}"/>
100 - <antcall target="downloadfile">
101 - <param name="sourcefile" value="${log4j.loc}"/>
102 - <param name="destfile" value="${log4j.jar}"/>
103 - <param name="destdir" value="${log4j.home}"/>
106 - <antcall target="downloadfile">
107 - <param name="sourcefile" value="${logkit.loc}"/>
108 - <param name="destfile" value="${logkit.jar}"/>
109 - <param name="destdir" value="${logkit.home}"/>
112 - <antcall target="downloadfile">
113 - <param name="sourcefile" value="${servletapi.loc}"/>
114 - <param name="destfile" value="${servletapi.jar}"/>
115 - <param name="destdir" value="${servletapi.home}"/>
120 <target name="extras-commons-logging"
121 - depends="extras-commons-logging-prepare,compile,build-manifests"
122 + depends="extras-prepare,compile,build-manifests"
123 description="Build JULI for log4j extras package">
125 - <gunzip src="${commons-logging-src.tar.gz}"
126 - dest="${tomcat.extras}/logging/commons-logging-src.tar"/>
127 - <untar src="${tomcat.extras}/logging/commons-logging-src.tar"
128 - dest="${tomcat.extras}/logging/"/>
130 <replace dir="${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src/src/java/org/apache/commons"
131 encoding="ISO-8859-1">
132 <replacefilter token="org.apache.commons"
133 @@ -1170,7 +1080,8 @@
134 file="${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src/build.xml" />
136 <copy todir="${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src">
137 - <fileset file="${avalon-framework.jar}" />
138 + <fileset file="${avalon-framework-api.jar}" />
139 + <fileset file="${avalon-framework-impl.jar}" />
140 <fileset file="${log4j.jar}" />
141 <fileset file="${logkit.jar}" />
142 <fileset file="${servletapi.jar}" />
143 @@ -1250,18 +1161,6 @@
144 depends="extras-prepare"
145 description="Prepare to build web services extras package">
147 - <antcall target="downloadfile">
148 - <param name="sourcefile" value="${jaxrpc-lib.loc}"/>
149 - <param name="destfile" value="${jaxrpc-lib.jar}"/>
150 - <param name="destdir" value="${jaxrpc-lib.home}"/>
153 - <antcall target="downloadfile">
154 - <param name="sourcefile" value="${wsdl4j-lib.loc}"/>
155 - <param name="destfile" value="${wsdl4j-lib.jar}"/>
156 - <param name="destdir" value="${wsdl4j-lib.home}"/>
159 <copy file="${jaxrpc-lib.jar}"
160 tofile="${tomcat.extras}/webservices/jaxrpc.jar" />
161 <copy file="${wsdl4j-lib.jar}"
162 @@ -1368,7 +1267,7 @@
166 - <target name="dist-prepare" depends="download-dist">
167 + <target name="dist-prepare">
168 <mkdir dir="${tomcat.dist}"/>
169 <mkdir dir="${tomcat.dist}/bin"/>
170 <mkdir dir="${tomcat.dist}/conf"/>
171 @@ -2092,301 +1991,7 @@
172 description="Delete the default output folders">
173 <delete dir="${tomcat.output}" />
177 - <!-- ================ Download and dependency building =================== -->
179 - <target name="download-validate"
180 - description="Download components necessary to validate source"
181 - if="${execute.validate}">
183 - <antcall target="downloadzip">
184 - <param name="sourcefile" value="${checkstyle.loc}"/>
185 - <param name="destfile" value="${checkstyle.jar}"/>
186 - <param name="destdir" value="${base.path}"/>
191 - <target name="download-compile"
192 - description="Download (and build) components necessary to compile" >
194 - <antcall target="downloadfile-2">
195 - <param name="sourcefile.1" value="${tomcat-native.loc.1}"/>
196 - <param name="sourcefile.2" value="${tomcat-native.loc.2}"/>
197 - <param name="destfile" value="${tomcat-native.tar.gz}"/>
198 - <param name="destdir" value="${tomcat-native.home}"/>
201 - <!-- Download Commons Daemon -->
202 - <antcall target="downloadgz-2">
203 - <param name="sourcefile.1" value="${commons-daemon.bin.loc.1}"/>
204 - <param name="sourcefile.2" value="${commons-daemon.bin.loc.2}"/>
205 - <param name="destfile" value="${commons-daemon.jar}"/>
208 - <antcall target="downloadfile-2">
209 - <param name="sourcefile.1" value="${commons-daemon.native.src.loc.1}"/>
210 - <param name="sourcefile.2" value="${commons-daemon.native.src.loc.2}"/>
211 - <param name="destfile" value="${commons-daemon.native.src.tgz}"/>
212 - <param name="destdir" value="${commons-daemon.home}"/>
215 - <!-- Download src and build Tomcat DBCP bundle -->
216 - <antcall target="downloadgz-2">
217 - <param name="sourcefile.1" value="${commons-pool-src.loc.1}"/>
218 - <param name="sourcefile.2" value="${commons-pool-src.loc.2}"/>
219 - <param name="destfile" value="${commons-pool.home}/build.xml" />
221 - <antcall target="downloadgz-2">
222 - <param name="sourcefile.1" value="${commons-dbcp-src.loc.1}"/>
223 - <param name="sourcefile.2" value="${commons-dbcp-src.loc.2}"/>
224 - <param name="destfile" value="${commons-dbcp.home}/build.xml" />
226 - <mkdir dir="${tomcat-dbcp.home}"/>
227 - <condition property="no.build.dbcp">
229 - <available file="${tomcat-dbcp.jar}"/>
230 - <available file="${tomcat-dbcp-src.jar}"/>
233 - <antcall target="build-tomcat-dbcp" />
235 - <!-- Download JDT (Eclipse compiler) -->
236 - <antcall target="downloadfile-2">
237 - <param name="sourcefile.1" value="${jdt.loc.1}"/>
238 - <param name="sourcefile.2" value="${jdt.loc.2}"/>
239 - <param name="destfile" value="${jdt.jar}"/>
240 - <param name="destdir" value="${jdt.home}"/>
244 - <target name="download-test-compile"
245 - description="Download additional components for the tests" >
247 - <antcall target="downloadzip">
248 - <param name="sourcefile" value="${junit.loc}"/>
249 - <param name="destfile" value="${junit.jar}"/>
250 - <param name="destdir" value="${base.path}"/>
255 - <target name="download-dist"
256 - description="Download additional components for a distribution" >
258 - <antcall target="downloadfile-2">
259 - <param name="sourcefile.1" value="${tomcat-native.dll.1}/win32/tcnative-1.dll"/>
260 - <param name="sourcefile.2" value="${tomcat-native.dll.2}/win32/tcnative-1.dll"/>
261 - <param name="destfile" value="${tomcat-native.dll.win32}"/>
262 - <param name="destdir" value="${tomcat-native.home}"/>
265 - <antcall target="downloadfile-2">
266 - <param name="sourcefile.1" value="${tomcat-native.dll.1}/win64/x64/tcnative-1.dll"/>
267 - <param name="sourcefile.2" value="${tomcat-native.dll.2}/win64/x64/tcnative-1.dll"/>
268 - <param name="destfile" value="${tomcat-native.dll.x64}"/>
269 - <param name="destdir" value="${tomcat-native.home}"/>
272 - <antcall target="downloadfile-2">
273 - <param name="sourcefile.1" value="${tomcat-native.dll.1}/win64/ia64/tcnative-1.dll"/>
274 - <param name="sourcefile.2" value="${tomcat-native.dll.2}/win64/ia64/tcnative-1.dll"/>
275 - <param name="destfile" value="${tomcat-native.dll.i64}"/>
276 - <param name="destdir" value="${tomcat-native.home}"/>
279 - <antcall target="downloadzip-2">
280 - <param name="sourcefile.1" value="${commons-daemon.native.win.loc.1}"/>
281 - <param name="sourcefile.2" value="${commons-daemon.native.win.loc.2}"/>
282 - <param name="destfile" value="${commons-daemon.native.win.mgr.exe}"/>
283 - <param name="destdir" value="${commons-daemon.native.win.home}"/>
286 - <antcall target="downloadzip">
287 - <param name="sourcefile" value="${nsis.loc}"/>
288 - <param name="destfile" value="${nsis.exe}"/>
289 - <param name="destdir" value="${nsis.home}/.."/>
295 - <!-- =============== Targets for dependencies that need to =============== -->
296 - <!-- ================ be built rather than used directly ================ -->
298 - <target name="build-tomcat-dbcp" depends="build-manifests" unless="no.build.dbcp">
299 - <copy todir="${tomcat-dbcp.home}">
300 - <fileset dir="${commons-pool.home}">
301 - <include name="**/*.java" />
302 - <exclude name="**/test/**" />
304 - <fileset dir="${commons-dbcp.home}">
305 - <include name="**/*.java" />
306 - <exclude name="**/test/**" />
307 - <exclude name="**/managed/**" />
310 - <replace dir="${tomcat-dbcp.home}/src/java/org/apache/commons"
311 - encoding="ISO-8859-1">
312 - <replacefilter token="org.apache.commons"
313 - value="org.apache.tomcat.dbcp" />
315 - <replace dir="${tomcat-dbcp.home}/src/java/org/apache/commons/pool/impl"
316 - encoding="ISO-8859-1">
317 - <replacefilter token="enum"
318 - value="enumeration" />
321 - <mkdir dir="${tomcat-dbcp.home}/src/java/org/apache/tomcat/dbcp" />
322 - <move todir="${tomcat-dbcp.home}/src/java/org/apache/tomcat/dbcp">
323 - <fileset dir="${tomcat-dbcp.home}/src/java/org/apache/commons" />
325 - <mkdir dir="${tomcat-dbcp.home}/classes"/>
326 - <javac destdir="${tomcat-dbcp.home}/classes"
328 - debug="${compile.debug}"
329 - deprecation="${compile.deprecation}"
330 - source="${compile.source}"
331 - target="${compile.target}"
332 - sourcepath="${tomcat-dbcp.home}/src/java"
333 - srcdir="${tomcat-dbcp.home}/src/java"
334 - encoding="ISO-8859-1"
335 - includeantruntime="false">
336 - <include name="**" />
338 - <jarIt jarfile="${tomcat-dbcp.jar}"
339 - filesDir="${tomcat-dbcp.home}/classes"
340 - filesId="files.tomcat-dbcp" />
341 - <jarIt jarfile="${tomcat-dbcp-src.jar}"
342 - filesDir="${tomcat-dbcp.home}/src/java"
343 - filesId="files.tomcat-dbcp" />
346 - <!-- =============== Utility Targets to support downloads ================ -->
348 - <target name="proxyflags">
349 - <!-- check proxy parameters. -->
350 - <condition property="useproxy">
351 - <equals arg1="${proxy.use}" arg2="on" />
355 - <target name="setproxy" depends="proxyflags" if="useproxy">
356 - <taskdef name="setproxy"
357 - classname="org.apache.tools.ant.taskdefs.optional.net.SetProxy" />
358 - <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"
359 - proxyuser="${proxy.user}" proxypassword="${proxy.password}" />
360 - <echo message="Using ${proxy.host}:${proxy.port} to download ${sourcefile}"/>
363 - <target name="testexist">
364 - <echo message="Testing for ${destfile}"/>
365 - <available file="${destfile}" property="exist"/>
368 - <target name="downloadgz" unless="exist" depends="setproxy,testexist">
369 - <!-- Download and extract the package -->
370 - <get src="${sourcefile}" dest="${base.path}/file.tar.gz" />
371 - <gunzip src="${base.path}/file.tar.gz" dest="${base.path}/file.tar"/>
372 - <untar src="${base.path}/file.tar" dest="${base.path}"/>
373 - <delete file="${base.path}/file.tar"/>
374 - <delete file="${base.path}/file.tar.gz"/>
377 - <target name="downloadgz-2" unless="exist" depends="setproxy,testexist">
378 - <!-- Download and extract the package from the two alternative locations -->
379 - <delete file="${base.path}/file.tar" quiet="true" />
380 - <delete file="${base.path}/file.tar.gz" quiet="true" />
381 - <antcall target="trydownload">
382 - <param name="sourcefile" value="${sourcefile.1}" />
383 - <param name="destfile" value="${base.path}/file.tar.gz" />
385 - <antcall target="trydownload">
386 - <param name="sourcefile" value="${sourcefile.2}" />
387 - <param name="destfile" value="${base.path}/file.tar.gz" />
389 - <gunzip src="${base.path}/file.tar.gz" dest="${base.path}/file.tar"/>
390 - <untar src="${base.path}/file.tar" dest="${base.path}"/>
391 - <delete file="${base.path}/file.tar"/>
392 - <delete file="${base.path}/file.tar.gz"/>
395 - <target name="downloadzip" unless="exist" depends="setproxy,testexist">
396 - <!-- Download and extract the package -->
397 - <get src="${sourcefile}" dest="${base.path}/file.zip" />
398 - <mkdir dir="${destdir}" />
399 - <unzip src="${base.path}/file.zip" dest="${destdir}"/>
400 - <delete file="${base.path}/file.zip"/>
403 - <target name="downloadzip-2" unless="exist" depends="testexist">
404 - <!-- Download and extract the package from the two alternative locations -->
405 - <delete file="${base.path}/file.zip" quiet="true" />
406 - <antcall target="trydownload">
407 - <param name="sourcefile" value="${sourcefile.1}" />
408 - <param name="destfile" value="${base.path}/file.zip" />
410 - <antcall target="trydownload">
411 - <param name="sourcefile" value="${sourcefile.2}" />
412 - <param name="destfile" value="${base.path}/file.zip" />
414 - <mkdir dir="${destdir}" />
415 - <unzip src="${base.path}/file.zip" dest="${destdir}"/>
416 - <delete file="${base.path}/file.zip"/>
419 - <target name="downloadfile" unless="exist" depends="setproxy,testexist">
420 - <!-- Download extract the file -->
421 - <mkdir dir="${destdir}" />
422 - <get src="${sourcefile}" dest="${destfile}" />
425 - <target name="downloadfile-2" unless="exist" depends="testexist">
426 - <!-- Download the file from the two alternative locations -->
427 - <mkdir dir="${destdir}" />
429 - <antcall target="trydownload">
430 - <param name="sourcefile" value="${sourcefile.1}" />
433 - <antcall target="trydownload">
434 - <param name="sourcefile" value="${sourcefile.2}" />
437 - <available file="${destfile}" property="exist"/>
438 - <fail unless="exist" message="Failed to download [${destfile}]. All download sources are unavailable." />
441 - <target name="trydownload.check" depends="setproxy">
442 - <condition property="trydownload.run">
445 - <available file="${destfile}" />
447 - <http url="${sourcefile}" />
452 - <target name="trydownload" if="trydownload.run" depends="trydownload.check">
453 - <!-- Downloads a file if not yet downloaded and the source URL is available -->
454 - <get src="${sourcefile}" dest="${destfile}" />
457 - <!-- ============================ IDE Support ============================ -->
459 - <target name="ide-eclipse" depends="deploy, extras-webservices-prepare"
460 - description="Prepares the source tree to be built in Eclipse">
462 - <!-- Copy the sample project files into the root directory -->
463 - <copy file="${tomcat.home}/res/ide-support/eclipse/eclipse.project" tofile="${tomcat.home}/.project"/>
464 - <copy file="${tomcat.home}/res/ide-support/eclipse/eclipse.classpath" tofile="${tomcat.home}/.classpath"/>
466 - <echo>Eclipse project files created.
467 -Read the Building page on the Apache Tomcat documentation site for details on how to configure your Eclipse workplace.</echo>
470 <!-- ======================= Macros, Taskdefs etc ======================== -->
472 <macrodef name="jarIt" description="utility macro for standard JAR packaging">