~ubuntu-branches/ubuntu/maverick/tomcat6/maverick

« back to all changes in this revision

Viewing changes to .pc/0004-split-deploy-webapps-target-from-deploy-target.patch/build.xml

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2010-06-28 21:41:31 UTC
  • mfrom: (2.2.15 sid)
  • Revision ID: james.westby@ubuntu.com-20100628214131-3wktukpb3lgdf83h
Tags: 6.0.26-5
* Convert patches to dep3 format.
* Backport security fix from trunk to fix CVE-2010-1157. (Closes: #587447)
* Set urgency to medium due to the security fix.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0"?>
 
2
<!--
 
3
 Licensed to the Apache Software Foundation (ASF) under one or more
 
4
  contributor license agreements.  See the NOTICE file distributed with
 
5
  this work for additional information regarding copyright ownership.
 
6
  The ASF licenses this file to You under the Apache License, Version 2.0
 
7
  (the "License"); you may not use this file except in compliance with
 
8
  the License.  You may obtain a copy of the License at
 
9
 
 
10
      http://www.apache.org/licenses/LICENSE-2.0
 
11
 
 
12
  Unless required by applicable law or agreed to in writing, software
 
13
  distributed under the License is distributed on an "AS IS" BASIS,
 
14
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
15
  See the License for the specific language governing permissions and
 
16
  limitations under the License.
 
17
-->
 
18
<project name="Tomcat 6.0" default="deploy" basedir=".">
 
19
 
 
20
 
 
21
  <!-- ===================== Initialize Property Values =================== -->
 
22
 
 
23
  <!-- We read customizable properties from the file "build.properties.default" -->
 
24
  <!-- and also from "build.properties" if it exists.                           -->
 
25
  <!-- The values in "build.properties" have stronger preference.               -->
 
26
  <!-- If you want to customize your build, you can either change the values    -->
 
27
  <!-- directly in the default file, or create a new build.properties and set   -->
 
28
  <!-- the values there. This way you don't have to change a file which is part -->
 
29
  <!-- of the original project source code.                                     -->
 
30
  <!-- See "build.properties.default" in the top level directory for some       -->
 
31
  <!-- property values you may customize.                                       -->
 
32
  <property file="${user.home}/build.properties"/>
 
33
  <property file="build.properties"/>
 
34
 
 
35
  <property file="build.properties.default"/>
 
36
 
 
37
  <!-- Project Properties -->
 
38
  <property name="project"               value="apache-tomcat" />
 
39
  <property name="name"                  value="Apache Tomcat" />
 
40
  <tstamp>
 
41
    <format property="year" pattern="yyyy" locale="en"/>
 
42
  </tstamp>
 
43
  <property name="version.major"         value="6" />
 
44
  <property name="version.minor"         value="0" />
 
45
  <property name="version.build"         value="0" />
 
46
  <property name="version.patch"         value="0" />
 
47
  <property name="version.suffix"        value="-dev" />
 
48
 
 
49
  <property name="version"               value="${version.major}.${version.minor}.${version.build}${version.suffix}" />
 
50
  <property name="version.number"        value="${version.major}.${version.minor}.${version.build}.${version.patch}" />
 
51
  <property name="version.major.minor"   value="${version.major}.${version.minor}" />
 
52
 
 
53
  <property name="final.name"            value="${project}-${version}" />
 
54
  <property name="final-src.name"        value="${project}-${version}-src" />
 
55
 
 
56
  <!-- Build Defaults -->
 
57
  <property name="tomcat.home"           value="${basedir}"/>
 
58
  <property name="tomcat.build"          value="${basedir}/output/build"/>
 
59
  <property name="tomcat.classes"        value="${basedir}/output/classes"/>
 
60
  <property name="tomcat.dist"           value="${basedir}/output/dist"/>
 
61
  <property name="tomcat.manifests"      value="${basedir}/output/manifests"/>
 
62
  <property name="test.failonerror"      value="true"/>
 
63
  <property name="test.runner"           value="junit.textui.TestRunner"/>
 
64
 
 
65
  <!-- Can't be lower - jsp uses templates -->
 
66
  <property name="compile.source" value="1.5"/>
 
67
  <!-- Can't be higher - must run on 1.5 -->
 
68
  <property name="compile.target" value="1.5"/>
 
69
 
 
70
  <!-- Exact spec versions (for the manifests) -->
 
71
  <property name="servlet.revision" value="MR2" />
 
72
  <property name="jsp.revision" value="FR" />
 
73
  <property name="el.revision" value="FR" />
 
74
 
 
75
  <!-- JAR artifacts -->
 
76
  <property name="bootstrap.jar" value="${tomcat.build}/bin/bootstrap.jar"/>
 
77
  <property name="tomcat-juli.jar" value="${tomcat.build}/bin/tomcat-juli.jar"/>
 
78
 
 
79
  <property name="annotations-api.jar" value="${tomcat.build}/lib/annotations-api.jar"/>
 
80
  <property name="servlet-api.jar" value="${tomcat.build}/lib/servlet-api.jar"/>
 
81
  <property name="jsp-api.jar" value="${tomcat.build}/lib/jsp-api.jar"/>
 
82
  <property name="el-api.jar" value="${tomcat.build}/lib/el-api.jar"/>
 
83
  <property name="catalina.jar" value="${tomcat.build}/lib/catalina.jar"/>
 
84
  <property name="catalina-tribes.jar" value="${tomcat.build}/lib/catalina-tribes.jar"/>
 
85
  <property name="catalina-ha.jar" value="${tomcat.build}/lib/catalina-ha.jar"/>
 
86
  <property name="catalina-ant.jar" value="${tomcat.build}/lib/catalina-ant.jar"/>
 
87
  <property name="tomcat-coyote.jar" value="${tomcat.build}/lib/tomcat-coyote.jar"/>
 
88
 
 
89
  <property name="jasper.jar" value="${tomcat.build}/lib/jasper.jar"/>
 
90
  <property name="jasper-el.jar" value="${tomcat.build}/lib/jasper-el.jar"/>
 
91
 
 
92
  <property name="tomcat-dbcp.home" value="${base.path}/tomcat${version.major}-deps/dbcp" />
 
93
  <property name="jasper-jdt.home" value="${base.path}/tomcat${version.major}-deps/jdt" />
 
94
  <property name="tomcat-dbcp.jar" value="${tomcat-dbcp.home}/tomcat-dbcp.jar"/>
 
95
  <property name="jasper-jdt.jar" value="${jasper-jdt.home}/jasper-jdt.jar"/>
 
96
  <available property="tomcat-dbcp.present" file="${tomcat-dbcp.jar}" />
 
97
  <available property="jdk16.present" classname="javax.sql.StatementEvent" />
 
98
 
 
99
  <!-- Classpath -->
 
100
  <path id="tomcat.classpath">
 
101
    <pathelement location="${ant.jar}"/>
 
102
    <pathelement location="${jdt.jar}"/>
 
103
  </path>
 
104
 
 
105
  <!-- Version info filter set -->
 
106
  <tstamp>
 
107
    <format property="TODAY" pattern="MMM d yyyy" locale="en"/>
 
108
    <format property="TSTAMP" pattern="hh:mm:ss"/>
 
109
  </tstamp>
 
110
  <filterset id="version.filters">
 
111
    <filter token="YEAR" value="${year}"/>
 
112
    <filter token="VERSION" value="${version}"/>
 
113
    <filter token="VERSION_NUMBER" value="${version.number}"/>
 
114
    <filter token="VERSION_MAJOR" value="${version.major}"/>
 
115
    <filter token="VERSION_MAJOR_MINOR" value="${version.major.minor}"/>
 
116
    <filter token="VERSION_BUILT" value="${TODAY} ${TSTAMP}"/>
 
117
  </filterset>
 
118
 
 
119
  <!-- Just build Tomcat -->
 
120
  <target name="build-prepare">
 
121
 
 
122
    <available classname="junit.framework.TestCase" property="junit.present" />
 
123
 
 
124
    <mkdir dir="${tomcat.classes}"/>
 
125
 
 
126
    <delete dir="${tomcat.build}/temp" />
 
127
    <delete dir="${tomcat.build}/work" />
 
128
 
 
129
    <mkdir dir="${tomcat.build}"/>
 
130
    <mkdir dir="${tomcat.build}/bin"/>
 
131
    <mkdir dir="${tomcat.build}/conf"/>
 
132
    <mkdir dir="${tomcat.build}/lib"/>
 
133
    <mkdir dir="${tomcat.build}/logs"/>
 
134
    <mkdir dir="${tomcat.build}/temp"/>
 
135
    <mkdir dir="${tomcat.build}/webapps"/>
 
136
 
 
137
  </target>
 
138
 
 
139
  <target name="compile">
 
140
 
 
141
    <!-- Compile internal server components -->
 
142
    <javac srcdir="java" destdir="${tomcat.classes}"
 
143
           debug="${compile.debug}"
 
144
           deprecation="${compile.deprecation}"
 
145
           source="${compile.source}"
 
146
           target="${compile.target}"
 
147
           optimize="${compile.optimize}"
 
148
           excludes="**/CVS/**,**/.svn/**"
 
149
           encoding="ISO-8859-1">
 
150
<!-- Comment this in to show unchecked warnings:
 
151
      <compilerarg value="-Xlint:unchecked"/>
 
152
 -->
 
153
      <classpath refid="tomcat.classpath" />
 
154
      <exclude name="org/apache/naming/factory/webservices/**" />
 
155
    </javac>
 
156
    <!-- Copy static resource files -->
 
157
    <copy todir="${tomcat.classes}" encoding="ISO-8859-1">
 
158
      <filterset refid="version.filters"/>
 
159
      <fileset dir="java">
 
160
        <include name="**/*.properties"/>
 
161
        <include name="**/*.dtd"/>
 
162
        <include name="**/*.tasks"/>
 
163
        <include name="**/*.xsd"/>
 
164
        <include name="**/*.xml"/>
 
165
      </fileset>
 
166
    </copy>
 
167
 
 
168
  </target>
 
169
 
 
170
  <target name="build-only" depends="build-prepare,compile,package" />
 
171
 
 
172
  <!-- Pattern sets for jar files -->
 
173
  <patternset id="files.annotations-api">
 
174
    <include name="javax/annotation/*" />
 
175
    <include name="javax/annotation/security/*" />
 
176
    <include name="javax/ejb/*" />
 
177
    <include name="javax/persistence/*" />
 
178
    <include name="javax/xml/ws/*" />
 
179
  </patternset>
 
180
 
 
181
  <patternset id="files.servlet-api">
 
182
    <include name="javax/servlet/*" />
 
183
    <include name="javax/servlet/http/*" />
 
184
    <include name="javax/servlet/resources/*" />
 
185
  </patternset>
 
186
 
 
187
  <patternset id="files.jsp-api">
 
188
    <include name="javax/servlet/jsp/**" />
 
189
  </patternset>
 
190
 
 
191
  <patternset id="files.el-api">
 
192
    <include name="javax/el/*" />
 
193
  </patternset>
 
194
 
 
195
  <patternset id="files.bootstrap">
 
196
    <include name="org/apache/catalina/startup/Bootstrap.*" />
 
197
    <include name="org/apache/catalina/startup/catalina.properties" />
 
198
    <include name="org/apache/catalina/startup/CatalinaProperties.*" />
 
199
    <include name="org/apache/catalina/startup/ClassLoaderFactory.*" />
 
200
    <include name="org/apache/catalina/startup/Tool.*" />
 
201
    <include name="org/apache/catalina/loader/StandardClassLoader*.*" />
 
202
    <include name="org/apache/catalina/loader/Extension.*" />
 
203
    <include name="org/apache/catalina/loader/Reloader.*" />
 
204
    <include name="org/apache/catalina/security/SecurityClassLoad.*" />
 
205
    <include name="org/apache/naming/JndiPermission.*" />
 
206
    <include name="org/apache/tomcat/util/compat/*" />
 
207
  </patternset>
 
208
 
 
209
  <patternset id="files.tomcat-juli">
 
210
    <include name="org/apache/juli/**" />
 
211
  </patternset>
 
212
 
 
213
  <patternset id="files.catalina">
 
214
    <include name="org/apache/*" />
 
215
    <include name="org/apache/catalina/**" />
 
216
    <include name="org/apache/naming/**" />
 
217
    <!-- Modules -->
 
218
    <exclude name="org/apache/catalina/ant/**" />
 
219
    <exclude name="org/apache/catalina/cluster/**" />
 
220
    <exclude name="org/apache/catalina/ha/**" />
 
221
    <exclude name="org/apache/catalina/mbeans/JmxRemote*" />
 
222
    <exclude name="org/apache/catalina/tribes/**" />
 
223
    <exclude name="org/apache/catalina/launcher/**" />
 
224
    <exclude name="org/apache/catalina/storeconfig/**" />
 
225
    <exclude name="org/apache/naming/factory/webservices/**" />
 
226
  </patternset>
 
227
 
 
228
  <patternset id="files.catalina-tribes">
 
229
    <include name="org/apache/catalina/tribes/**" />
 
230
  </patternset>
 
231
 
 
232
  <patternset id="files.catalina-ha">
 
233
    <include name="org/apache/catalina/ha/**" />
 
234
  </patternset>
 
235
 
 
236
  <patternset id="files.catalina-ant">
 
237
    <include name="org/apache/catalina/ant/*" />
 
238
    <include name="org/apache/catalina/ant/jmx/*" />
 
239
    <include name="org/apache/catalina/util/Base64.*" />
 
240
  </patternset>
 
241
 
 
242
  <patternset id="files.tomcat-coyote">
 
243
    <include name="org/apache/coyote/**" />
 
244
    <include name="org/apache/tomcat/jni/**" />
 
245
    <include name="org/apache/jk/**" />
 
246
    <include name="org/apache/tomcat/util/**" />
 
247
  </patternset>
 
248
 
 
249
  <patternset id="files.jasper">
 
250
    <include name="org/apache/*" />
 
251
    <include name="org/apache/jasper/**" />
 
252
  </patternset>
 
253
 
 
254
  <patternset id="files.jasper-el">
 
255
    <include name="org/apache/el/**" />
 
256
  </patternset>
 
257
 
 
258
 
 
259
  <macrodef name="jarIt" description="utility macro for standard JAR packaging">
 
260
    <attribute name="jarfile" description="the name of the JAR file to create"/>
 
261
    <attribute name="filesId" description="the patternset id of the files to use"/>
 
262
    <attribute name="manifest" description="the manifest file use"
 
263
               default="${tomcat.manifests}/default.manifest" />
 
264
    <attribute name="notice" description="the LICENSE file to use"
 
265
               default="${tomcat.manifests}/default.notice" />
 
266
    <attribute name="license" description="the NOTICE file to use"
 
267
               default="${tomcat.manifests}/default.license" />
 
268
    <sequential>
 
269
      <jar  jarfile="@{jarfile}" manifest="@{manifest}">
 
270
        <fileset dir="${tomcat.classes}">
 
271
          <patternset refid="@{filesId}"/>
 
272
          <!-- Javadoc and i18n exclusions -->
 
273
          <exclude name="**/package.html" />
 
274
          <exclude name="**/LocalStrings_*" />
 
275
        </fileset>
 
276
        <zipfileset file="@{notice}" fullpath="META-INF/NOTICE" />
 
277
        <zipfileset file="@{license}" fullpath="META-INF/LICENSE" />
 
278
      </jar>
 
279
    </sequential>
 
280
  </macrodef>
 
281
 
 
282
  <target name="build-manifests" >
 
283
    <!-- Filtering tokens for JAR manifests-->
 
284
    <filter token="source.jdk" value="${compile.source}"/>
 
285
    <filter token="target.jdk" value="${compile.target}"/>
 
286
    <filter token="servlet.revision" value="${servlet.revision}"/>
 
287
    <filter token="jsp.revision" value="${jsp.revision}"/>
 
288
    <filter token="el.revision" value="${el.revision}"/>
 
289
 
 
290
    <mkdir dir="${tomcat.manifests}" />
 
291
    <copy todir="${tomcat.manifests}" overwrite="yes" filtering="yes"
 
292
      encoding="ISO-8859-1">
 
293
      <filterset refid="version.filters"/>
 
294
      <fileset dir="${tomcat.home}/res/META-INF" >
 
295
        <include name="*.manifest" />
 
296
        <include name="*.license" />
 
297
        <include name="*.notice" />
 
298
      </fileset>
 
299
    </copy>
 
300
 
 
301
  </target>
 
302
 
 
303
  <target name="package" depends="build-manifests" >
 
304
    <!-- Common Annotations 1.0 JAR File -->
 
305
    <jarIt jarfile="${annotations-api.jar}" filesId="files.annotations-api"
 
306
      manifest="${tomcat.manifests}/annotations-api.jar.manifest" />
 
307
 
 
308
    <!-- Servlet 2.5 Implementation JAR File -->
 
309
    <jarIt jarfile="${servlet-api.jar}" filesId="files.servlet-api"
 
310
      manifest="${tomcat.manifests}/servlet-api.jar.manifest" />
 
311
 
 
312
    <!-- JSP 2.1 Implementation JAR File -->
 
313
    <jarIt jarfile="${jsp-api.jar}" filesId="files.jsp-api"
 
314
      manifest="${tomcat.manifests}/jsp-api.jar.manifest" />
 
315
 
 
316
 
 
317
    <!-- JSP 2.1 EL Implementation JAR File -->
 
318
    <jarIt jarfile="${el-api.jar}" filesId="files.el-api"
 
319
      manifest="${tomcat.manifests}/el-api.jar.manifest" />
 
320
 
 
321
    <!-- Bootstrap JAR File -->
 
322
    <jarIt jarfile="${bootstrap.jar}" filesId="files.bootstrap"
 
323
      manifest="${tomcat.manifests}/bootstrap.jar.manifest" />
 
324
 
 
325
    <!-- Tomcat-juli JAR File -->
 
326
    <jarIt jarfile="${tomcat-juli.jar}" filesId="files.tomcat-juli" />
 
327
 
 
328
    <!-- Catalina Main JAR File -->
 
329
    <jarIt jarfile="${catalina.jar}" filesId="files.catalina" />
 
330
 
 
331
    <!-- Catalina GroupCom/Tribes JAR File -->
 
332
    <jarIt jarfile="${catalina-tribes.jar}" filesId="files.catalina-tribes" />
 
333
 
 
334
    <!-- Catalina Cluster/HA JAR File -->
 
335
    <jarIt jarfile="${catalina-ha.jar}" filesId="files.catalina-ha" />
 
336
 
 
337
    <!-- Catalina Ant Tasks JAR File -->
 
338
    <jarIt jarfile="${catalina-ant.jar}" filesId="files.catalina-ant" />
 
339
 
 
340
    <!-- Protocol handlers - Coyote -->
 
341
    <jarIt jarfile="${tomcat-coyote.jar}" filesId="files.tomcat-coyote" />
 
342
 
 
343
    <!-- Jasper Implementation JAR File -->
 
344
    <jarIt jarfile="${jasper.jar}" filesId="files.jasper" />
 
345
 
 
346
    <!-- Jasper EL Implementation JAR File -->
 
347
    <jarIt jarfile="${jasper-el.jar}" filesId="files.jasper-el" />
 
348
 
 
349
    <!-- i18n JARs -->
 
350
    <jar jarfile="${tomcat.build}/lib/tomcat-i18n-es.jar"
 
351
      manifest="${tomcat.manifests}/default.manifest" >
 
352
      <fileset dir="${tomcat.classes}">
 
353
        <include name="**/LocalStrings_es.properties" />
 
354
      </fileset>
 
355
      <zipfileset file="${tomcat.manifests}/default.notice"
 
356
        fullpath="META-INF/NOTICE" />
 
357
      <zipfileset file="${tomcat.manifests}/default.license"
 
358
        fullpath="META-INF/LICENSE" />
 
359
    </jar>
 
360
    <jar jarfile="${tomcat.build}/lib/tomcat-i18n-fr.jar"
 
361
      manifest="${tomcat.manifests}/default.manifest" >
 
362
      <fileset dir="${tomcat.classes}">
 
363
        <include name="**/LocalStrings_fr.properties" />
 
364
      </fileset>
 
365
      <zipfileset file="${tomcat.manifests}/default.notice"
 
366
        fullpath="META-INF/NOTICE" />
 
367
      <zipfileset file="${tomcat.manifests}/default.license"
 
368
        fullpath="META-INF/LICENSE" />
 
369
    </jar>
 
370
    <jar jarfile="${tomcat.build}/lib/tomcat-i18n-ja.jar"
 
371
      manifest="${tomcat.manifests}/default.manifest" >
 
372
      <fileset dir="${tomcat.classes}">
 
373
        <include name="**/LocalStrings_ja.properties" />
 
374
      </fileset>
 
375
      <zipfileset file="${tomcat.manifests}/default.notice"
 
376
        fullpath="META-INF/NOTICE" />
 
377
      <zipfileset file="${tomcat.manifests}/default.license"
 
378
        fullpath="META-INF/LICENSE" />
 
379
    </jar>
 
380
 
 
381
  </target>
 
382
 
 
383
  <target name="build-docs">
 
384
 
 
385
    <copy todir="${tomcat.build}/webapps">
 
386
      <fileset dir="webapps">
 
387
        <include name="docs/images/**"/>
 
388
        <include name="docs/**/*.html"/>
 
389
        <include name="docs/WEB-INF/**"/>
 
390
        <include name="docs/appdev/*.txt"/>
 
391
        <include name="docs/appdev/sample/**"/>
 
392
      </fileset>
 
393
        <fileset dir="webapps">
 
394
          <include name="docs/architecture/**"/>
 
395
          <exclude name="docs/architecture/*.xml"/>
 
396
        </fileset>
 
397
    </copy>
 
398
    <copy todir="${tomcat.build}/webapps/docs" encoding="ISO-8859-1">
 
399
      <filterset refid="version.filters"/>
 
400
      <fileset dir=".">
 
401
        <include name="BUILDING.txt"/>
 
402
        <include name="RUNNING.txt"/>
 
403
      </fileset>
 
404
    </copy>
 
405
    <copy tofile="${tomcat.build}/webapps/docs/RELEASE-NOTES.txt" file="RELEASE-NOTES" encoding="ISO-8859-1">
 
406
      <filterset refid="version.filters"/>
 
407
    </copy>
 
408
 
 
409
    <copy   tofile="${tomcat.build}/webapps/docs/appdev/sample/build.xml"
 
410
              file="webapps/docs/appdev/build.xml.txt"/>
 
411
 
 
412
    <mkdir dir="${tomcat.build}/webapps/docs/funcspecs" />
 
413
 
 
414
    <!-- XSL processing -->
 
415
    <xslt basedir="webapps/docs"
 
416
           destdir="${tomcat.build}/webapps/docs"
 
417
         extension=".html"
 
418
             style="webapps/docs/tomcat-docs.xsl"
 
419
          excludes="build.xml project.xml"
 
420
          includes="*.xml">
 
421
      <param name="relative-path" expression="."/>
 
422
    </xslt>
 
423
    <xslt basedir="webapps/docs/appdev"
 
424
           destdir="${tomcat.build}/webapps/docs/appdev"
 
425
         extension=".html"
 
426
             style="webapps/docs/tomcat-docs.xsl"
 
427
          excludes="project.xml"
 
428
          includes="*.xml">
 
429
      <param name="relative-path" expression=".."/>
 
430
    </xslt>
 
431
    <xslt basedir="webapps/docs/funcspecs"
 
432
           destdir="${tomcat.build}/webapps/docs/funcspecs"
 
433
         extension=".html"
 
434
             style="webapps/docs/tomcat-docs.xsl"
 
435
          excludes="project.xml"
 
436
          includes="*.xml">
 
437
      <param name="relative-path" expression=".."/>
 
438
    </xslt>
 
439
    <xslt basedir="webapps/docs/config"
 
440
           destdir="${tomcat.build}/webapps/docs/config"
 
441
         extension=".html"
 
442
             style="webapps/docs/tomcat-docs.xsl"
 
443
          excludes="project.xml"
 
444
          includes="*.xml">
 
445
      <param name="relative-path" expression=".."/>
 
446
    </xslt>
 
447
    <xslt basedir="webapps/docs/architecture"
 
448
           destdir="${tomcat.build}/webapps/docs/architecture"
 
449
         extension=".html"
 
450
             style="webapps/docs/tomcat-docs.xsl"
 
451
          excludes="project.xml"
 
452
          includes="*.xml">
 
453
      <param name="relative-path" expression=".."/>
 
454
    </xslt>
 
455
 
 
456
    <xslt basedir="webapps/docs/tribes"
 
457
               destdir="${tomcat.build}/webapps/docs/tribes"
 
458
             extension=".html"
 
459
                 style="webapps/docs/tomcat-docs.xsl"
 
460
              excludes="project.xml"
 
461
              includes="*.xml">
 
462
          <param name="relative-path" expression=".."/>
 
463
    </xslt>
 
464
  </target>
 
465
 
 
466
  <target name="warn.dbcp" unless="tomcat-dbcp.present">
 
467
    <echo>WARNING: tomcat-dbcp.jar not included, this build can't be used
 
468
    in a release. Please run 'ant download' with JDK1.5 if you are 
 
469
    building a tomcat release.</echo>
 
470
  </target>
 
471
 
 
472
  <target name="deploy" depends="build-only,build-docs,warn.dbcp">
 
473
 
 
474
    <copy tofile="${tomcat.build}/bin/tomcat-native.tar.gz"
 
475
            file="${tomcat-native.tar.gz}" />
 
476
 
 
477
    <copy todir="${tomcat.build}/bin" file="${commons-daemon.jar}" />
 
478
    <copy todir="${tomcat.build}/bin" file="${commons-daemon.jsvc.tar.gz}" />
 
479
 
 
480
    <!-- Copy scripts -->
 
481
    <copy todir="${tomcat.build}/bin">
 
482
      <fileset dir="bin">
 
483
         <exclude name="**/*.launch"/>
 
484
         <exclude name="**/*.sh"/>
 
485
         <exclude name="**/*.bat"/>
 
486
      </fileset>
 
487
    </copy>
 
488
    <copy todir="${tomcat.build}/bin" encoding="ISO-8859-1">
 
489
      <filterset refid="version.filters"/>
 
490
      <fileset dir="bin">
 
491
         <include name="**/*.sh"/>
 
492
         <include name="**/*.bat"/>
 
493
      </fileset>
 
494
    </copy>
 
495
    <!-- Copy doesn't retain permissions -->
 
496
    <chmod dir="${tomcat.build}/bin" includes="*.sh" perm="+x"/>
 
497
 
 
498
    <!-- Copy static resource files -->
 
499
    <copy todir="${tomcat.build}/conf" encoding="ISO-8859-1">
 
500
      <filterset refid="version.filters"/>
 
501
      <fileset dir="conf">
 
502
        <include name="**/*.policy"/>
 
503
        <include name="**/*.xml"/>
 
504
        <include name="**/*.properties"/>
 
505
      </fileset>
 
506
    </copy>
 
507
 
 
508
    <!-- Copy other regular webapps -->
 
509
    <copy todir="${tomcat.build}/webapps">
 
510
      <fileset dir="webapps">
 
511
        <include name="ROOT/**"/>
 
512
        <exclude name="ROOT/index.html"/>
 
513
        <exclude name="ROOT/index.jsp"/>
 
514
        <include name="examples/**"/>
 
515
        <include name="manager/**"/>
 
516
        <include name="host-manager/**"/>
 
517
      </fileset>
 
518
    </copy>
 
519
    <copy todir="${tomcat.build}/webapps" encoding="ISO-8859-1">
 
520
      <filterset refid="version.filters" />
 
521
      <fileset dir="webapps">
 
522
        <include name="ROOT/index.html"/>
 
523
        <include name="ROOT/index.jsp"/>
 
524
      </fileset>
 
525
    </copy>
 
526
 
 
527
    <copy tofile="${tomcat.build}/webapps/ROOT/RELEASE-NOTES.txt" file="RELEASE-NOTES" encoding="ISO-8859-1">
 
528
      <filterset refid="version.filters"/>
 
529
    </copy>
 
530
 
 
531
    <!-- Build classes for examples webapp -->
 
532
    <javac   srcdir="webapps/examples/WEB-INF/classes"
 
533
             destdir="${tomcat.build}/webapps/examples/WEB-INF/classes"
 
534
             debug="${compile.debug}" deprecation="${compile.deprecation}"
 
535
             source="${compile.source}"
 
536
             target="${compile.target}"
 
537
             optimize="${compile.optimize}"
 
538
             classpath="${tomcat.classes}"
 
539
             excludes="**/CVS/**,**/.svn/**"
 
540
             encoding="ISO-8859-1">
 
541
    </javac>
 
542
 
 
543
    <javac   srcdir="webapps/examples/jsp/plugin/applet"
 
544
             destdir="${tomcat.build}/webapps/examples/jsp/plugin/applet"
 
545
             debug="${compile.debug}" deprecation="${compile.deprecation}"
 
546
             source="${compile.source}"
 
547
             target="${compile.target}"
 
548
             optimize="${compile.optimize}"
 
549
             classpath="$tomcat.lcasses}"
 
550
             excludes="**/CVS/**,**/.svn/**"
 
551
             encoding="ISO-8859-1">
 
552
    </javac>
 
553
 
 
554
    <!-- Add sources for examples -->
 
555
    <taskdef    name="txt2html"
 
556
           classname="org.apache.tomcat.buildutil.Txt2Html"
 
557
           classpath="${tomcat.classes}" />
 
558
    <txt2html todir="${tomcat.build}/webapps/examples/jsp/jsp2/simpletag">
 
559
      <fileset dir="webapps/examples/WEB-INF/classes/jsp2/examples">
 
560
        <include name="BookBean.java"/>
 
561
      </fileset>
 
562
      <fileset dir="webapps/examples/WEB-INF/classes/jsp2/examples/simpletag">
 
563
        <include name="FindBookSimpleTag.java"/>
 
564
        <include name="RepeatSimpleTag.java"/>
 
565
        <include name="HelloWorldSimpleTag.java"/>
 
566
      </fileset>
 
567
      <fileset dir="webapps/examples/WEB-INF/classes/jsp2/examples/el">
 
568
        <include name="Functions.java"/>
 
569
      </fileset>
 
570
    </txt2html>
 
571
 
 
572
    <txt2html todir="${tomcat.build}/webapps/examples/jsp/jsp2/jspattribute">
 
573
      <fileset dir="webapps/examples/WEB-INF/classes/jsp2/examples">
 
574
        <include name="FooBean.java"/>
 
575
      </fileset>
 
576
      <fileset dir="webapps/examples/WEB-INF/classes/jsp2/examples/simpletag">
 
577
        <include name="ShuffleSimpleTag.java"/>
 
578
        <include name="TileSimpleTag.java"/>
 
579
        <include name="HelloWorldSimpleTag.java"/>
 
580
      </fileset>
 
581
    </txt2html>
 
582
 
 
583
    <txt2html todir="${tomcat.build}/webapps/examples/jsp/cal">
 
584
      <fileset dir="webapps/examples/WEB-INF/classes/cal">
 
585
        <include name="Entries.java"/>
 
586
        <include name="Entry.java"/>
 
587
        <include name="JspCalendar.java"/>
 
588
        <include name="TableBean.java"/>
 
589
      </fileset>
 
590
    </txt2html>
 
591
 
 
592
    <txt2html todir="${tomcat.build}/webapps/examples/jsp/jsptoserv">
 
593
      <fileset dir="webapps/examples/WEB-INF/classes">
 
594
        <include name="servletToJsp.java"/>
 
595
      </fileset>
 
596
    </txt2html>
 
597
 
 
598
    <txt2html todir="${tomcat.build}/webapps/examples/jsp/jsp2/el">
 
599
      <fileset dir="webapps/examples/WEB-INF/classes/jsp2/examples/el">
 
600
        <include name="Functions.java"/>
 
601
      </fileset>
 
602
    </txt2html>
 
603
 
 
604
    <txt2html todir="${tomcat.build}/webapps/examples/jsp/jsp2/misc">
 
605
      <fileset dir="webapps/examples/WEB-INF/classes/jsp2/examples/simpletag">
 
606
        <include name="EchoAttributesTag.java"/>
 
607
      </fileset>
 
608
    </txt2html>
 
609
 
 
610
    <txt2html todir="${tomcat.build}/webapps/examples/jsp/jsp2/tagfiles">
 
611
      <fileset dir="webapps/examples/WEB-INF/tags">
 
612
        <include name="**/*.tag" />
 
613
      </fileset>
 
614
    </txt2html>
 
615
 
 
616
    <txt2html todir="${tomcat.build}/webapps/examples">
 
617
      <fileset dir="webapps/examples">
 
618
        <include name="**/*.jsp" />
 
619
        <include name="**/*.jspx" />
 
620
        <include name="**/*.jspf" />
 
621
        <exclude name="error/errorpge.jsp"/>
 
622
        <exclude name="forward/one.jsp"/>
 
623
        <exclude name="include/foo.jsp"/>
 
624
        <exclude name="jsptoserv/hello.jsp"/>
 
625
        <exclude name="security/protected/error.jsp"/>
 
626
        <exclude name="security/protected/index.jsp"/>
 
627
        <exclude name="security/protected/login.jsp"/>
 
628
        <exclude name="source.jsp"/>
 
629
      </fileset>
 
630
    </txt2html>
 
631
 
 
632
    <copy file="${tomcat-dbcp.jar}" todir="${tomcat.build}/lib"
 
633
      failonerror="false"/>
 
634
    <copy file="${jasper-jdt.jar}" todir="${tomcat.build}/lib" />
 
635
 
 
636
  </target>
 
637
 
 
638
  <target name="clean-depend"
 
639
          description="Clean depend src components">
 
640
     <delete dir="${tomcat-dbcp.home}"/>
 
641
     <delete dir="${jasper-jdt.home}"/>
 
642
  </target>
 
643
 
 
644
  <target name="clean">
 
645
    <delete dir="${tomcat.classes}" />
 
646
    <delete dir="${tomcat.build}" />
 
647
    <delete dir="${tomcat.manifests}" />
 
648
  </target>
 
649
 
 
650
  <!-- Download and dependency building -->
 
651
  <target name="proxyflags">
 
652
    <!-- check proxy parameters. -->
 
653
    <condition property="useproxy">
 
654
      <equals arg1="${proxy.use}" arg2="on" />
 
655
    </condition>
 
656
  </target>
 
657
 
 
658
  <target name="setproxy" depends="proxyflags" if="useproxy">
 
659
    <taskdef name="setproxy"
 
660
            classname="org.apache.tools.ant.taskdefs.optional.net.SetProxy" />
 
661
    <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"
 
662
              proxyuser="${proxy.user}" proxypassword="${proxy.password}" />
 
663
    <echo message="Using ${proxy.host}:${proxy.port} to download ${sourcefile}"/>
 
664
  </target>
 
665
 
 
666
  <target name="testexist">
 
667
    <echo message="Testing  for ${destfile}"/>
 
668
    <available file="${destfile}" property="exist"/>
 
669
  </target>
 
670
 
 
671
  <target name="downloadgz" unless="exist" depends="setproxy,testexist">
 
672
    <!-- Download and extract the package -->
 
673
    <get src="${sourcefile}" dest="${base.path}/file.tar.gz" />
 
674
    <gunzip src="${base.path}/file.tar.gz" dest="${base.path}/file.tar"/>
 
675
    <untar src="${base.path}/file.tar" dest="${base.path}"/>
 
676
    <delete file="${base.path}/file.tar"/>
 
677
    <delete file="${base.path}/file.tar.gz"/>
 
678
  </target>
 
679
 
 
680
  <target name="downloadzip" unless="exist" depends="setproxy,testexist">
 
681
    <!-- Download and extract the package -->
 
682
    <get src="${sourcefile}" dest="${base.path}/file.zip" />
 
683
    <mkdir dir="${destdir}" />
 
684
    <unzip src="${base.path}/file.zip" dest="${destdir}"/>
 
685
    <delete file="${base.path}/file.zip"/>
 
686
  </target>
 
687
 
 
688
  <target name="downloadfile" unless="exist" depends="setproxy,testexist">
 
689
    <!-- Download extract the file -->
 
690
    <mkdir dir="${destdir}" />
 
691
    <get src="${sourcefile}" dest="${destfile}" />
 
692
  </target>
 
693
 
 
694
  <target name="download"
 
695
          description="Download (and build as necessary) dependent components"
 
696
          depends="build-manifests">
 
697
 
 
698
    <antcall target="downloadfile">
 
699
      <param name="sourcefile" value="${tomcat-native.loc}"/>
 
700
      <param name="destfile" value="${tomcat-native.tar.gz}"/>
 
701
      <param name="destdir" value="${tomcat-native.home}"/>
 
702
    </antcall>
 
703
 
 
704
    <antcall target="downloadfile">
 
705
      <param name="sourcefile" value="${tomcat-native.dll}/win32/tcnative-1.dll"/>
 
706
      <param name="destfile" value="${tomcat-native.home}/tcnative-1.dll.x86"/>
 
707
      <param name="destdir" value="${tomcat-native.home}"/>
 
708
    </antcall>
 
709
 
 
710
    <antcall target="downloadfile">
 
711
      <param name="sourcefile" value="${tomcat-native.dll}/win64/x64/tcnative-1.dll"/>
 
712
      <param name="destfile" value="${tomcat-native.home}/tcnative-1.dll.x64"/>
 
713
      <param name="destdir" value="${tomcat-native.home}"/>
 
714
    </antcall>
 
715
 
 
716
    <antcall target="downloadfile">
 
717
      <param name="sourcefile" value="${tomcat-native.dll}/win64/ia64/tcnative-1.dll"/>
 
718
      <param name="destfile" value="${tomcat-native.home}/tcnative-1.dll.i64"/>
 
719
      <param name="destdir" value="${tomcat-native.home}"/>
 
720
    </antcall>
 
721
 
 
722
    <antcall target="downloadgz">
 
723
      <param name="sourcefile" value="${commons-daemon.loc}"/>
 
724
      <param name="destfile" value="${commons-daemon.jar}"/>
 
725
    </antcall>
 
726
 
 
727
    <!-- Build Tomcat DBCP bundle -->
 
728
    <antcall target="downloadgz">
 
729
      <param name="sourcefile" value="${commons-pool-src.loc}"/>
 
730
      <param name="destfile" value="${commons-pool.home}/build.xml" />
 
731
    </antcall>
 
732
    <antcall target="downloadgz">
 
733
      <param name="sourcefile" value="${commons-dbcp-src.loc}"/>
 
734
      <param name="destfile" value="${commons-dbcp.home}/build.xml" />
 
735
    </antcall>
 
736
    <mkdir dir="${tomcat-dbcp.home}"/>
 
737
    <antcall target="build-tomcat-dbcp">
 
738
      <param name="basedir" value="${tomcat-dbcp.home}" />
 
739
    </antcall>
 
740
 
 
741
    <!-- Build Jasper JDT bundle -->
 
742
    <antcall target="downloadzip">
 
743
      <param name="sourcefile" value="${jdt.loc}"/>
 
744
      <param name="destfile" value="${jdt.jar}"/>
 
745
      <param name="destdir" value="${base.path}"/>
 
746
    </antcall>
 
747
    <mkdir dir="${jasper-jdt.home}"/>
 
748
    <antcall target="build-jasper-jdt">
 
749
      <param name="basedir" value="${jasper-jdt.home}" />
 
750
    </antcall>
 
751
 
 
752
    <antcall target="downloadzip">
 
753
      <param name="sourcefile" value="${nsis.loc}"/>
 
754
      <param name="destfile" value="${nsis.exe}"/>
 
755
      <param name="destdir" value="${nsis.home}/.."/>
 
756
    </antcall>
 
757
 
 
758
  </target>
 
759
 
 
760
  <target name="build-tomcat-dbcp" unless="jdk16.present"
 
761
          depends="build-manifests">
 
762
    <copy todir="${tomcat-dbcp.home}">
 
763
      <fileset dir="${commons-pool.home}">
 
764
        <include name="**/*.java" />
 
765
        <exclude name="**/test/**" />
 
766
      </fileset>
 
767
      <fileset dir="${commons-dbcp.home}">
 
768
        <include name="**/*.java" />
 
769
        <exclude name="**/test/**" />
 
770
      </fileset>
 
771
    </copy>
 
772
    <replace dir="${tomcat-dbcp.home}/src/java/org/apache/commons"
 
773
        encoding="ISO-8859-1">
 
774
      <replacefilter token="org.apache.commons"
 
775
            value="org.apache.tomcat.dbcp" />
 
776
    </replace>
 
777
    <replace dir="${tomcat-dbcp.home}/src/java/org/apache/commons/pool/impl"
 
778
        encoding="ISO-8859-1">
 
779
      <replacefilter token="enum"
 
780
            value="enumeration" />
 
781
    </replace>
 
782
 
 
783
    <mkdir dir="${tomcat-dbcp.home}/src/java/org/apache/tomcat/dbcp" />
 
784
    <move todir="${tomcat-dbcp.home}/src/java/org/apache/tomcat/dbcp">
 
785
      <fileset dir="${tomcat-dbcp.home}/src/java/org/apache/commons" />
 
786
    </move>
 
787
    <mkdir dir="${tomcat-dbcp.home}/classes"/>
 
788
    <javac destdir="${tomcat-dbcp.home}/classes"
 
789
           optimize="off"
 
790
           debug="${compile.debug}"
 
791
           deprecation="${compile.deprecation}"
 
792
           source="${compile.source}"
 
793
           target="${compile.target}"
 
794
           sourcepath="${tomcat-dbcp.home}/src/java"
 
795
           srcdir="${tomcat-dbcp.home}/src/java"
 
796
           encoding="ISO-8859-1">
 
797
      <include name="**" />
 
798
    </javac>
 
799
    <jar jarfile="${tomcat-dbcp.jar}"
 
800
         index="true"
 
801
         manifest="${tomcat.manifests}/default.manifest">
 
802
      <fileset dir="${tomcat-dbcp.home}/classes">
 
803
        <include name="**/*.class" />
 
804
        <include name="**/*.properties" />
 
805
      </fileset>
 
806
      <zipfileset file="${tomcat.manifests}/default.notice"
 
807
        fullpath="META-INF/NOTICE" />
 
808
      <zipfileset file="${tomcat.manifests}/default.license"
 
809
        fullpath="META-INF/LICENSE" />
 
810
    </jar>
 
811
  </target>
 
812
 
 
813
  <target name="build-jasper-jdt" depends="build-manifests">
 
814
    <unjar src="${jdt.jar}" dest="${jasper-jdt.home}" />
 
815
    <jar destfile="${jasper-jdt.jar}" index="true"
 
816
         manifest="${tomcat.manifests}/default.manifest">
 
817
      <fileset dir="${jasper-jdt.home}">
 
818
        <include name="org/eclipse/jdt/core/compiler/**"/>
 
819
        <include name="org/eclipse/jdt/internal/compiler/**"/>
 
820
        <include name="org/eclipse/jdt/internal/core/util/CommentRecorder*"/>
 
821
      </fileset>
 
822
      <zipfileset file="${tomcat.manifests}/jasper-jdt.jar.notice"
 
823
        fullpath="META-INF/NOTICE" />
 
824
      <zipfileset file="${tomcat.manifests}/jasper-jdt.jar.license"
 
825
        fullpath="META-INF/LICENSE" />
 
826
    </jar>
 
827
  </target>
 
828
 
 
829
</project>