1 --- apache-tomcat-7.0.32-src/build.xml~ 2012-10-03 09:55:49.000000000 +0200
2 +++ apache-tomcat-7.0.32-src/build.xml 2012-11-09 11:22:30.324804340 +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/tomcat/util/http/parser/HttpParser*.java" />
31 - <exclude name="java/org/apache/**/parser/JJT*ParserState.java" />
32 - <exclude name="java/org/apache/**/parser/ParseException.java" />
33 - <exclude name="java/org/apache/**/parser/SimpleCharStream.java" />
34 - <exclude name="java/org/apache/**/parser/Token*.java" />
35 - <!-- Exclude these else Gump runs validate on them -->
36 - <exclude name="**/org/apache/tomcat/dbcp/**"/>
37 - <exclude name="**/tomcat-deps/**"/>
38 - <!-- Exclude simple test files -->
39 - <exclude name="test/webapp-3.0/bug53257/*.txt"/>
40 - <exclude name="test/webapp-3.0-fragments/WEB-INF/classes/*.txt"/>
42 - <fileset dir="modules/jdbc-pool" >
43 - <exclude name=".*/**"/>
44 - <exclude name="**/MANIFEST.MF"/>
45 - <patternset refid="text.files" />
48 - <!-- javax package checks -->
49 - <checkstyle config="res/checkstyle/javax-checkstyle.xml">
50 - <fileset dir="java/javax" >
51 - <include name="**/*.java"/>
54 - <!-- org package checks -->
55 - <checkstyle config="res/checkstyle/org-checkstyle.xml">
56 - <fileset dir="java/org" >
57 - <include name="**/*.java"/>
62 <target name="validate-eoln" depends="build-prepare,compile-prepare"
63 description="Validate that the source files have correct line ends">
69 - <target name="compile" depends="build-prepare,download-compile,compile-prepare,validate">
70 + <target name="compile" depends="build-prepare">
71 <!-- Compile internal server components -->
72 <javac srcdir="java" destdir="${tomcat.classes}"
73 debug="${compile.debug}"
75 <target name="deploy" depends="package,build-docs"
76 description="Default. Builds a working Tomcat instance">
78 - <copy tofile="${tomcat.build}/bin/tomcat-native.tar.gz"
79 - file="${tomcat-native.tar.gz}" />
80 - <copy tofile="${tomcat.build}/bin/commons-daemon-native.tar.gz"
81 - file="${commons-daemon.native.src.tgz}" />
83 - <copy tofile="${tomcat.build}/bin/commons-daemon.jar" file="${commons-daemon.jar}" />
86 <copy todir="${tomcat.build}/bin">
92 - <target name="test-compile" depends="compile,download-test-compile" >
93 + <target name="test-compile" depends="compile" >
94 <mkdir dir="${test.classes}"/>
96 <javac srcdir="test" destdir="${test.classes}"
97 @@ -1212,52 +1150,10 @@
98 <mkdir dir="${tomcat.extras}/webservices"/>
101 - <target name="extras-commons-logging-prepare"
102 - depends="extras-prepare"
103 - description="Prepare to build web services extras package">
105 - <antcall target="downloadfile-2">
106 - <param name="sourcefile.1" value="${commons-logging-src.loc.1}"/>
107 - <param name="sourcefile.2" value="${commons-logging-src.loc.2}"/>
108 - <param name="destfile" value="${commons-logging-src.tar.gz}"/>
109 - <param name="destdir" value="${commons-logging.home}"/>
112 - <antcall target="downloadfile">
113 - <param name="sourcefile" value="${avalon-framework.loc}"/>
114 - <param name="destfile" value="${avalon-framework.jar}"/>
115 - <param name="destdir" value="${avalon-framework.home}"/>
118 - <antcall target="downloadfile">
119 - <param name="sourcefile" value="${log4j.loc}"/>
120 - <param name="destfile" value="${log4j.jar}"/>
121 - <param name="destdir" value="${log4j.home}"/>
124 - <antcall target="downloadfile">
125 - <param name="sourcefile" value="${logkit.loc}"/>
126 - <param name="destfile" value="${logkit.jar}"/>
127 - <param name="destdir" value="${logkit.home}"/>
130 - <antcall target="downloadfile">
131 - <param name="sourcefile" value="${servletapi.loc}"/>
132 - <param name="destfile" value="${servletapi.jar}"/>
133 - <param name="destdir" value="${servletapi.home}"/>
138 <target name="extras-commons-logging"
139 - depends="extras-commons-logging-prepare,compile,build-manifests"
140 + depends="extras-prepare,compile,build-manifests"
141 description="Build JULI for log4j extras package">
143 - <gunzip src="${commons-logging-src.tar.gz}"
144 - dest="${tomcat.extras}/logging/commons-logging-src.tar"/>
145 - <untar src="${tomcat.extras}/logging/commons-logging-src.tar"
146 - dest="${tomcat.extras}/logging/"/>
148 <replace dir="${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src/src/java/org/apache/commons"
149 encoding="ISO-8859-1">
150 <replacefilter token="org.apache.commons"
151 @@ -1279,7 +1175,8 @@
152 file="${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src/build.xml" />
154 <copy todir="${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src">
155 - <fileset file="${avalon-framework.jar}" />
156 + <fileset file="${avalon-framework-api.jar}" />
157 + <fileset file="${avalon-framework-impl.jar}" />
158 <fileset file="${log4j.jar}" />
159 <fileset file="${logkit.jar}" />
160 <fileset file="${servletapi.jar}" />
161 @@ -1359,18 +1256,6 @@
162 depends="extras-prepare"
163 description="Prepare to build web services extras package">
165 - <antcall target="downloadfile">
166 - <param name="sourcefile" value="${jaxrpc-lib.loc}"/>
167 - <param name="destfile" value="${jaxrpc-lib.jar}"/>
168 - <param name="destdir" value="${jaxrpc-lib.home}"/>
171 - <antcall target="downloadfile">
172 - <param name="sourcefile" value="${wsdl4j-lib.loc}"/>
173 - <param name="destfile" value="${wsdl4j-lib.jar}"/>
174 - <param name="destdir" value="${wsdl4j-lib.home}"/>
177 <copy file="${jaxrpc-lib.jar}"
178 tofile="${tomcat.extras}/webservices/jaxrpc.jar" />
179 <copy file="${wsdl4j-lib.jar}"
180 @@ -1477,7 +1362,7 @@
184 - <target name="dist-prepare" depends="download-dist">
185 + <target name="dist-prepare">
186 <mkdir dir="${tomcat.dist}"/>
187 <mkdir dir="${tomcat.dist}/bin"/>
188 <mkdir dir="${tomcat.dist}/conf"/>
189 @@ -2268,290 +2153,6 @@
190 <delete file="webapps/docs/jdbc-pool.xml"/>
194 - <!-- ================ Download and dependency building =================== -->
196 - <target name="download-validate"
197 - description="Download components necessary to validate source"
198 - if="${execute.validate}">
200 - <antcall target="downloadzip">
201 - <param name="sourcefile" value="${checkstyle.loc}"/>
202 - <param name="destfile" value="${checkstyle.jar}"/>
203 - <param name="destdir" value="${base.path}"/>
208 - <target name="download-compile"
209 - description="Download (and build) components necessary to compile" >
211 - <antcall target="downloadfile-2">
212 - <param name="sourcefile.1" value="${tomcat-native.loc.1}"/>
213 - <param name="sourcefile.2" value="${tomcat-native.loc.2}"/>
214 - <param name="destfile" value="${tomcat-native.tar.gz}"/>
215 - <param name="destdir" value="${tomcat-native.home}"/>
218 - <!-- Download Commons Daemon -->
219 - <antcall target="downloadgz-2">
220 - <param name="sourcefile.1" value="${commons-daemon.bin.loc.1}"/>
221 - <param name="sourcefile.2" value="${commons-daemon.bin.loc.2}"/>
222 - <param name="destfile" value="${commons-daemon.jar}"/>
225 - <antcall target="downloadfile-2">
226 - <param name="sourcefile.1" value="${commons-daemon.native.src.loc.1}"/>
227 - <param name="sourcefile.2" value="${commons-daemon.native.src.loc.2}"/>
228 - <param name="destfile" value="${commons-daemon.native.src.tgz}"/>
229 - <param name="destdir" value="${commons-daemon.home}"/>
232 - <!-- Download src and build Tomcat DBCP bundle -->
233 - <antcall target="downloadgz-2">
234 - <param name="sourcefile.1" value="${commons-pool-src.loc.1}"/>
235 - <param name="sourcefile.2" value="${commons-pool-src.loc.2}"/>
236 - <param name="destfile" value="${commons-pool.home}/build.xml" />
238 - <antcall target="downloadgz-2">
239 - <param name="sourcefile.1" value="${commons-dbcp-src.loc.1}"/>
240 - <param name="sourcefile.2" value="${commons-dbcp-src.loc.2}"/>
241 - <param name="destfile" value="${commons-dbcp.home}/build.xml" />
243 - <mkdir dir="${tomcat-dbcp.home}"/>
244 - <!-- Rebuild dbcp only if built jars do not exist -->
245 - <!-- or new versions of pool or dbcp have been downloaded. -->
246 - <condition property="no.build.dbcp">
248 - <uptodate srcfile="${commons-pool.home}" targetfile="${tomcat-dbcp.jar}" />
249 - <uptodate srcfile="${commons-pool.home}" targetfile="${tomcat-dbcp-src.jar}" />
250 - <uptodate srcfile="${commons-dbcp.home}" targetfile="${tomcat-dbcp.jar}" />
251 - <uptodate srcfile="${commons-dbcp.home}" targetfile="${tomcat-dbcp-src.jar}" />
254 - <antcall target="build-tomcat-dbcp" />
256 - <!-- Download JDT (Eclipse compiler) -->
257 - <antcall target="downloadfile-2">
258 - <param name="sourcefile.1" value="${jdt.loc.1}"/>
259 - <param name="sourcefile.2" value="${jdt.loc.2}"/>
260 - <param name="destfile" value="${jdt.jar}"/>
261 - <param name="destdir" value="${jdt.home}"/>
265 - <target name="download-test-compile"
266 - description="Download additional components for the tests" >
268 - <antcall target="downloadzip">
269 - <param name="sourcefile" value="${junit.loc}"/>
270 - <param name="destfile" value="${junit.jar}"/>
271 - <param name="destdir" value="${base.path}"/>
276 - <target name="download-dist"
277 - description="Download additional components for a distribution" >
279 - <antcall target="downloadzip-2">
280 - <param name="sourcefile.1" value="${tomcat-native.win.1}"/>
281 - <param name="sourcefile.2" value="${tomcat-native.win.2}"/>
282 - <param name="destfile" value="${tomcat-native.home}/LICENSE"/>
283 - <param name="destdir" value="${tomcat-native.home}"/>
286 - <antcall target="downloadzip-2">
287 - <param name="sourcefile.1" value="${commons-daemon.native.win.loc.1}"/>
288 - <param name="sourcefile.2" value="${commons-daemon.native.win.loc.2}"/>
289 - <param name="destfile" value="${commons-daemon.native.win.mgr.exe}"/>
290 - <param name="destdir" value="${commons-daemon.native.win.home}"/>
293 - <antcall target="downloadzip">
294 - <param name="sourcefile" value="${nsis.loc}"/>
295 - <param name="destfile" value="${nsis.exe}"/>
296 - <param name="destdir" value="${nsis.home}/.."/>
302 - <!-- =============== Targets for dependencies that need to =============== -->
303 - <!-- ================ be built rather than used directly ================ -->
305 - <target name="build-tomcat-dbcp" depends="build-manifests" unless="no.build.dbcp">
306 - <copy todir="${tomcat-dbcp.home}">
307 - <fileset dir="${commons-pool.home}">
308 - <include name="**/*.java" />
309 - <exclude name="**/test/**" />
311 - <fileset dir="${commons-dbcp.home}">
312 - <include name="**/*.java" />
313 - <exclude name="**/test/**" />
314 - <exclude name="**/managed/**" />
317 - <replace dir="${tomcat-dbcp.home}/src/java/org/apache/commons"
318 - encoding="ISO-8859-1">
319 - <replacefilter token="org.apache.commons"
320 - value="org.apache.tomcat.dbcp" />
322 - <replace dir="${tomcat-dbcp.home}/src/java/org/apache/commons/pool/impl"
323 - encoding="ISO-8859-1">
324 - <replacefilter token="enum"
325 - value="enumeration" />
328 - <mkdir dir="${tomcat-dbcp.home}/src/java/org/apache/tomcat/dbcp" />
329 - <move todir="${tomcat-dbcp.home}/src/java/org/apache/tomcat/dbcp">
330 - <fileset dir="${tomcat-dbcp.home}/src/java/org/apache/commons" />
332 - <mkdir dir="${tomcat-dbcp.home}/classes"/>
333 - <javac destdir="${tomcat-dbcp.home}/classes"
335 - debug="${compile.debug}"
336 - deprecation="${compile.deprecation}"
337 - source="${compile.source}"
338 - target="${compile.target}"
339 - sourcepath="${tomcat-dbcp.home}/src/java"
340 - srcdir="${tomcat-dbcp.home}/src/java"
341 - encoding="ISO-8859-1"
342 - includeantruntime="false">
343 - <include name="**" />
345 - <jarIt jarfile="${tomcat-dbcp.jar}"
346 - filesDir="${tomcat-dbcp.home}/classes"
347 - filesId="files.tomcat-dbcp" />
348 - <jarIt jarfile="${tomcat-dbcp-src.jar}"
349 - filesDir="${tomcat-dbcp.home}/src/java"
350 - filesId="files.tomcat-dbcp" />
353 - <!-- =============== Utility Targets to support downloads ================ -->
355 - <target name="proxyflags">
356 - <!-- check proxy parameters. -->
357 - <condition property="useproxy">
358 - <equals arg1="${proxy.use}" arg2="on" />
362 - <target name="setproxy" depends="proxyflags" if="useproxy">
363 - <taskdef name="setproxy"
364 - classname="org.apache.tools.ant.taskdefs.optional.net.SetProxy" />
365 - <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"
366 - proxyuser="${proxy.user}" proxypassword="${proxy.password}" />
367 - <echo message="Using ${proxy.host}:${proxy.port} to download ${sourcefile}"/>
370 - <target name="testexist">
371 - <echo message="Testing for ${destfile}"/>
372 - <available file="${destfile}" property="exist"/>
375 - <target name="downloadgz" unless="exist" depends="setproxy,testexist">
376 - <!-- Download and extract the package -->
377 - <get src="${sourcefile}" dest="${base.path}/file.tar.gz" />
378 - <gunzip src="${base.path}/file.tar.gz" dest="${base.path}/file.tar"/>
379 - <untar src="${base.path}/file.tar" dest="${base.path}"/>
380 - <delete file="${base.path}/file.tar"/>
381 - <delete file="${base.path}/file.tar.gz"/>
384 - <target name="downloadgz-2" unless="exist" depends="setproxy,testexist">
385 - <!-- Download and extract the package from the two alternative locations -->
386 - <delete file="${base.path}/file.tar" quiet="true" />
387 - <delete file="${base.path}/file.tar.gz" quiet="true" />
388 - <antcall target="trydownload">
389 - <param name="sourcefile" value="${sourcefile.1}" />
390 - <param name="destfile" value="${base.path}/file.tar.gz" />
392 - <antcall target="trydownload">
393 - <param name="sourcefile" value="${sourcefile.2}" />
394 - <param name="destfile" value="${base.path}/file.tar.gz" />
396 - <gunzip src="${base.path}/file.tar.gz" dest="${base.path}/file.tar"/>
397 - <untar src="${base.path}/file.tar" dest="${base.path}"/>
398 - <delete file="${base.path}/file.tar"/>
399 - <delete file="${base.path}/file.tar.gz"/>
402 - <target name="downloadzip" unless="exist" depends="setproxy,testexist">
403 - <!-- Download and extract the package -->
404 - <get src="${sourcefile}" dest="${base.path}/file.zip" />
405 - <mkdir dir="${destdir}" />
406 - <unzip src="${base.path}/file.zip" dest="${destdir}"/>
407 - <delete file="${base.path}/file.zip"/>
410 - <target name="downloadzip-2" unless="exist" depends="testexist">
411 - <!-- Download and extract the package from the two alternative locations -->
412 - <delete file="${base.path}/file.zip" quiet="true" />
413 - <antcall target="trydownload">
414 - <param name="sourcefile" value="${sourcefile.1}" />
415 - <param name="destfile" value="${base.path}/file.zip" />
417 - <antcall target="trydownload">
418 - <param name="sourcefile" value="${sourcefile.2}" />
419 - <param name="destfile" value="${base.path}/file.zip" />
421 - <mkdir dir="${destdir}" />
422 - <unzip src="${base.path}/file.zip" dest="${destdir}"/>
423 - <delete file="${base.path}/file.zip"/>
426 - <target name="downloadfile" unless="exist" depends="setproxy,testexist">
427 - <!-- Download extract the file -->
428 - <mkdir dir="${destdir}" />
429 - <get src="${sourcefile}" dest="${destfile}" />
432 - <target name="downloadfile-2" unless="exist" depends="testexist">
433 - <!-- Download the file from the two alternative locations -->
434 - <mkdir dir="${destdir}" />
436 - <antcall target="trydownload">
437 - <param name="sourcefile" value="${sourcefile.1}" />
440 - <antcall target="trydownload">
441 - <param name="sourcefile" value="${sourcefile.2}" />
444 - <available file="${destfile}" property="exist"/>
445 - <fail unless="exist" message="Failed to download [${destfile}]. All download sources are unavailable." />
448 - <target name="trydownload.check" depends="setproxy">
449 - <condition property="trydownload.run">
452 - <available file="${destfile}" />
454 - <http url="${sourcefile}" />
459 - <target name="trydownload" if="trydownload.run" depends="trydownload.check">
460 - <!-- Downloads a file if not yet downloaded and the source URL is available -->
461 - <get src="${sourcefile}" dest="${destfile}" />
464 - <!-- ============================ IDE Support ============================ -->
466 - <target name="ide-eclipse" depends="deploy, extras-webservices-prepare"
467 - description="Prepares the source tree to be built in Eclipse">
469 - <!-- Copy the sample project files into the root directory -->
470 - <copy file="${tomcat.home}/res/ide-support/eclipse/eclipse.project" tofile="${tomcat.home}/.project"/>
471 - <copy file="${tomcat.home}/res/ide-support/eclipse/eclipse.classpath" tofile="${tomcat.home}/.classpath"/>
473 - <echo>Eclipse project files created.
474 -Read the Building page on the Apache Tomcat documentation site for details on how to configure your Eclipse workplace.</echo>
477 <!-- ======================= Macros, Taskdefs etc ======================== -->
479 <macrodef name="jarIt" description="utility macro for standard JAR packaging">