source: apps/jetty/build.xml @ 14941d0d

Last change on this file since 14941d0d was d28220c, checked in by zzz <zzz@…>, 3 years ago

Tomcat 8.5.23
Prior to Jetty 9, we used the Tomcat 6 distribution.
As of Jetty 9, we used Tomcat 8.0.33 that was included in the Jetty 9 distribution,
but that is old and doesn't get updated.
Now use the latest Tomcat 8 distribution, and pick the same packages
as Jetty 9 did in their distribution.

  • Property mode set to 100644
File size: 26.6 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<project basedir="." default="all" name="jetty">
3
4    <!-- This copies jars, with some modifications and renaming,
5         from the jetty-distribution directory to the jettylib directory.
6         This is disabled if the property with-libjetty9-java=true.
7
8         This copies jars, with some modifications and renaming,
9         from the apache-tomcat-deployer and apache-tomcat directories to the jettylib directory.
10         This is disabled if the property with-libservlet2.5-java=true.
11
12         This also builds the small helper jar jetty-i2p.jar from
13         the source in the java/ directory.
14     -->
15
16    <!-- Note: Please change all references in top-level build.xml if you update to a new Jetty! -->
17    <!--       Also change javadoc URL in top-level build.properties.                            -->
18    <!-- jetty.branch unused until we go to 9.3 -->
19    <property name="jetty.branch" value="stable-9" />
20    <property name="jetty.ver" value="9.2.22.v20170606" />
21    <property name="jetty.base" value="jetty-distribution-${jetty.ver}" />
22    <property name="jetty.sha1" value="7f0b10d69b214337622e3c0565f94417828ba13e" />
23    <property name="jetty.filename" value="${jetty.base}.zip" />
24    <!-- change jetty.ver to jetty.branch for 9.3 -->
25    <property name="jetty.url" value="http://central.maven.org/maven2/org/eclipse/jetty/jetty-distribution/${jetty.ver}/${jetty.filename}" />
26    <property name="verified.filename" value="verified.txt" />
27    <property name="javac.compilerargs" value="" />
28    <property name="javac.version" value="1.7" />
29
30    <!-- Note: Please change all references in top-level build.xml if you update to a new Tomcat! -->
31    <property name="tomcat.ver" value="8.5.23" />
32    <!-- everything we need is in the deployer package, except for tomcat-api.jar in the full package,
33         so we just use the full package instead.
34      <property name="tomcat.lib" value="apache-tomcat-${tomcat.ver}-deployer/lib" />
35     -->
36    <property name="tomcat.lib" value="apache-tomcat-${tomcat.ver}/lib" />
37    <property name="tomcat.bin" value="apache-tomcat-${tomcat.ver}/bin" />
38
39    <target name="all" depends="build" />
40
41    <!--
42      - We now check in the jars we need to ${jetty.base}, so
43      - fetchJettylib, verifyJettylib, and extractJettylib are not used unless
44      - updating to a new Jetty version by changing ${jetty.ver} and ${jetty.sha1} above.
45     -->
46
47    <!-- verify everything we need is in jettylib/ -->
48    <target name="ensureJettylib" depends="ensureJettylib1, copyJettylib" />
49
50    <target name="ensureJettylib1" >
51        <condition property="jetty.zip.extracted" >
52            <or>
53                <istrue value="${with-libjetty9-java}" />
54                <available file="${jetty.base}" type="dir" />
55            </or>
56        </condition>
57        <condition property="jetty.zip.available" >
58            <or>
59                <istrue value="${jetty.zip.extracted}" />
60                <available file="${jetty.filename}" type="file" />
61            </or>
62        </condition>
63        <condition property="verified.already" >
64            <or>
65                <istrue value="${with-libjetty9-java}" />
66                <istrue value="${jetty.zip.extracted}" />
67                <and>
68                    <available file="${jetty.filename}" />
69                    <uptodate property="foo.bar.baz" srcfile="${jetty.filename}" targetfile="${verified.filename}" />
70                </and>
71            </or>
72        </condition>
73    </target>
74
75  <!--
76    <target name="ensureJettylib" depends="extractJettylib" />
77   -->
78
79    <target name="fetchJettylib" unless="jetty.zip.available" >
80        <echo message="It seems that you don't have '${jetty.filename}' deployed." />
81        <echo message="The build script can download this file for you automatically," />
82        <echo message="or alternatively you can obtain it manually from:" />
83        <echo message="${jetty.url}" />
84        <echo message="" />
85        <echo message="The libraries contained in the fetched file provide the Jetty web server" />
86        <echo message="(http://jetty.mortbay.org/). They are not absolutely necessary" />
87        <echo message="but strongly recommended, since they are used by some applications" />
88        <echo message="on top of I2P, like the router console." />
89        <echo message="" />
90        <echo message="Even if you deploy the Jetty archive manually into directory apps/jetty/," />
91        <echo message="the build script will still attempt to verify its checksums, which must be:" />
92        <echo message="SHA1 ${jetty.sha1}" />
93        <echo message="" />
94        <input message="Download Jetty archive automatically?" validargs="y,n" addproperty="jetty.download" />
95        <fail message="Aborting as requested. Please deploy the Jetty archive manually." >
96            <condition>
97                <equals arg1="${jetty.download}" arg2="n"/>
98            </condition>
99        </fail>
100        <get src="${jetty.url}" verbose="true" dest="${jetty.filename}" />
101    </target>
102
103    <target name="verifyJettylib" depends="fetchJettylib" unless="verified.already" >
104        <condition property="jetty.zip.verified" >
105                <checksum file="${jetty.filename}" algorithm="SHA" property="${jetty.sha1}" />
106        </condition>
107        <fail message="Jetty archive does not match its checksum!" >
108            <condition>
109                <not>
110                    <istrue value="${jetty.zip.verified}" />
111                </not>
112            </condition>
113        </fail>
114        <touch file="${verified.filename}" />
115    </target>
116
117    <target name="extractJettylib" depends="verifyJettylib" unless="jetty.zip.extracted" >
118      <!-- for .tgz -->
119      <!--
120        <gunzip src="${jetty.filename}" dest="jetty.tar" />
121        <untar src="jetty.tar" dest="." />
122      -->
123      <!-- for .zip -->
124        <unzip src="${jetty.filename}" dest="." />
125    </target>
126
127    <target name="mkJettylibdir" >
128        <mkdir dir="jettylib" />
129    </target>
130
131    <!-- Jetty and tomcat files -->
132    <!--
133         We support the following configurations:
134           no system jars: Precise, Trusty
135           with-libtomcat8-java: Jessie (without backports), Wheezy
136           with-libtomcat8-java AND with-libjetty9-java: Xenial, Jessie (with backports), Stretch
137           with-libjetty9-java (only): not supported
138     -->
139    <target name="copyJettylib" depends="mkJettylibdir, copyJettylib1, copyTomcatLib1, copyJettylib2, copyTomcatLib" />
140
141    <!-- Jetty files only -->
142    <target name="copyJettylib1" depends="extractJettylib, buildPatches" unless="${with-libjetty9-java}" >
143      <!-- We copy everything to names without the version numbers so we
144           can update them later. Where there was something similar in Jetty 5/6,
145           we use the same names so they will overwrite the Jetty 5/6 jar on upgrade.
146           Otherwise we use the same name as the symlink in Ubuntu /usr/share/java.
147           Reasons for inclusion:
148              start.jar: Needed for clients.config startup of eepsites
149              jetty-util-xxx.jar: LifeCycle (base class for stuff), URIUtil (used in i2psnark)
150              jetty-deploy, -http, -io, -security, -servlet, -webapp: All split out from main server jar in Jetty 7
151              jetty-continuation-xxx.jar: Needed? Useful?
152              jetty-servlets-xxx.jar: Needed for CGI for eepsite
153              jetty-sslengine-xxx.jar: Old Jetty 6, now a dummy
154              jetty-java5-threadpool-xxx.jar: Old Jetty 6, now a dummy
155              jetty-rewrite-handler: Not used by I2P, but only 20KB and could be useful for eepsites
156              jetty-management: Not used by I2P, but only 34KB and could be useful for eepsites, and we bundled it with Jetty 5
157              javax.servlet.jsp-2.2.0.v201112011158.jar: Required API
158              servlet-api-3.0.jar: Required API
159              All of these are available in the Ubuntu packages libjetty-java and libjetty-extra-java
160        -->
161        <copy preservelastmodified="true" file="${jetty.base}/start.jar" tofile="jettylib/jetty-start.jar" />
162        <copy file="${jetty.base}/lib/jetty-server-${jetty.ver}.jar" tofile="jettylib/org.mortbay.jetty.jar" />
163        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-continuation-${jetty.ver}.jar" tofile="jettylib/jetty-continuation.jar" />
164        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-deploy-${jetty.ver}.jar" tofile="jettylib/jetty-deploy.jar" />
165        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-http-${jetty.ver}.jar" tofile="jettylib/jetty-http.jar" />
166        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-io-${jetty.ver}.jar" tofile="jettylib/jetty-io.jar" />
167        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-jmx-${jetty.ver}.jar" tofile="jettylib/org.mortbay.jmx.jar" />
168        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-rewrite-${jetty.ver}.jar" tofile="jettylib/jetty-rewrite-handler.jar" />
169        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-security-${jetty.ver}.jar" tofile="jettylib/jetty-security.jar" />
170        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-servlet-${jetty.ver}.jar" tofile="jettylib/jetty-servlet.jar" />
171        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-servlets-${jetty.ver}.jar" tofile="jettylib/jetty-servlets.jar" />
172        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-util-${jetty.ver}.jar" tofile="jettylib/jetty-util.jar" />
173      <!-- comment out above line and uncomment below and the patches section further down if we need patches
174        <jar destfile="jettylib/jetty-util.jar"  manifest="${jetty.base}/lib/jetty-util-${jetty.ver}.jar" filesetmanifest="mergewithoutmain" >
175            <zipfileset excludes="**/RolloverFileOutputStream*.class" src="${jetty.base}/lib/jetty-util-${jetty.ver}.jar" />
176            <zipfileset src="build/jetty-util-patch.jar" />
177        </jar>
178       -->
179        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-webapp-${jetty.ver}.jar" tofile="jettylib/jetty-webapp.jar" />
180        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-xml-${jetty.ver}.jar" tofile="jettylib/jetty-xml.jar" />
181        <jar destfile="jettylib/jetty-java5-threadpool.jar" >
182            <manifest>
183                <attribute name="Note" value="Intentionally empty" />
184            </manifest>
185        </jar>
186        <jar destfile="jettylib/jetty-sslengine.jar" >
187            <manifest>
188                <attribute name="Note" value="Intentionally empty" />
189            </manifest>
190        </jar>
191    </target>
192
193    <!-- Make javax.servlet.jar -->
194    <!-- If with-libtomcat8-java but not with-libjetty9-java, we don't do this -->
195    <target name="copyJettylib2" depends="extractJettylib" unless="${with-libtomcat8-java}" >
196        <jar destfile="jettylib/javax.servlet.jar" duplicate="preserve" filesetmanifest="mergewithoutmain" >
197            <!-- all versions - Servlet API -->
198            <zipfileset excludes="about.html about_files about_files/* META-INF/ECLIPSEF.* META-INF/eclipse.inf plugin.properties" src="${jetty.base}/lib/servlet-api-3.1.jar" />
199
200          <!--
201            Jetty version - see below for why we don't use this one
202            <zipfileset excludes="about.html about_files about_files/* META-INF/ECLIPSEF.* META-INF/eclipse.inf plugin.properties" src="${jetty.base}/lib/jsp/javax.servlet.jsp-api-2.3.1.jar" />
203           -->
204
205            <!-- Apache in Jetty package version -->
206            <!-- Also includes org.apache.*, this is copied into jasper-runtime.jar below -->
207            <!-- In Debian packages they are found in /usr/share/java/tomcat8-servlet-api.jar in the libtomcat8-java package -->
208            <!-- javax/servlet/jsp/resources are dups of those in apache-jsp jar -->
209          <!--
210            <zipfileset includes="javax/**/*" src="${jetty.base}/lib/apache-jsp/org.mortbay.jasper.apache-jsp-8.0.33.jar"/>
211            <zipfileset excludes="about.html about_files about_files/* META-INF/ECLIPSEF.* META-INF/eclipse.inf plugin.properties javax/servlet/jsp/resources/*" src="${jetty.base}/lib/jetty-schemas-3.1.jar" />
212           -->
213
214            <!-- Apache package version -->
215            <zipfileset excludes="META-INF/LICENSE META-INF/NOTICE" src="${tomcat.lib}/jsp-api.jar"/>
216            <zipfileset excludes="about.html about_files about_files/* META-INF/ECLIPSEF.* META-INF/eclipse.inf plugin.properties" src="${jetty.base}/lib/jetty-schemas-3.1.jar" />
217        </jar>
218      <!--
219        <delete file="jetty.tar" />
220        <delete dir="${jetty.base}" />
221      -->
222    </target>
223
224
225    <!-- Tomcat.
226         The glassfish jars bundled in Jetty 6 are way too old.
227         For compatibility with very old I2P installations where the classpath
228         was set individually in wrapper.config, we rename and combine the jars as follows:
229         jasper.jar : jasper-runtime.jar
230         jasper-el.jar + el-api.jar : commons-el.jar
231         tomcat-juli.jar : Add to commons-logging.jar
232         empty jar : jasper-compiler.jar
233         Also, take NOTICE and LICENSE out of each one, we bundle those separately.
234
235         Not as of Jetty 8 (using from Jetty):
236         servlet-api.jar + jsp-api.jar : javax.servlet.jar
237         If we go to Tomcat 7:
238         tomcat-api.jar + tomcat-util.jar: Add to javax.servlet.jar (as of Tomcat 7 / Jetty 8)
239     -->
240    <target name="copyTomcatLib" depends="mkJettylibdir, copyTomcatLib1, copyTomcatLib2, copyTomcatLib3" />
241
242    <target name="copyTomcatLib1" >
243        <condition property="with-libtomcat-java" >
244            <or>
245                <istrue value="${with-libtomcat6-java}" />
246                <istrue value="${with-libtomcat7-java}" />
247                <istrue value="${with-libtomcat8-java}" />
248            </or>
249        </condition>
250    </target>
251
252
253    <!-- Make commons-el.jar and jasper-runtime.jar -->
254    <target name="copyTomcatLib2" unless="${with-libtomcat-java}" >
255        <!-- EL API and compiler libs.
256             Tomcat 6 has EL 2.1.
257             Tomcat 7 / libservlet3.0 has EL 2.2.
258             Jetty 9 / Tomcat 8 / libservlet3.1 has EL 3.0.
259             According to http://stackoverflow.com/questions/7202686/differences-between-el-2-1-and-2-2
260             2.2 is backwards-compatible with 2.1.
261         -->
262        <!-- the javax.el API, AND the com.sun.el parser -->
263        <!-- actually from jetty9, not tomcat8... this will fail unless we have the jetty files also -->
264        <jar destfile="jettylib/commons-el.jar" duplicate="preserve" filesetmanifest="mergewithoutmain">
265          <!--
266            Jetty version
267            <zipfileset src="${jetty.base}/lib/jsp/javax.el-3.0.0.jar"/>
268           -->
269
270            <!-- Apache in Jetty package version -->
271          <!--
272            <zipfileset src="${jetty.base}/lib/apache-jsp/org.mortbay.jasper.apache-el-${tomcat.ver}.jar"/>
273           -->
274
275            <!-- Apache package version -->
276            <zipfileset excludes="META-INF/LICENSE META-INF/NOTICE" src="${tomcat.lib}/el-api.jar"/>
277            <zipfileset excludes="META-INF/LICENSE META-INF/NOTICE" src="${tomcat.lib}/jasper-el.jar"/>
278        </jar>
279
280        <!-- actually from jetty9, not tomcat8... this will fail unless we have the jetty files also -->
281        <jar destfile="jettylib/jasper-runtime.jar" duplicate="preserve" filesetmanifest="mergewithoutmain" >
282          <!--
283            Jetty version
284            <zipfileset src="${jetty.base}/lib/jsp/javax.servlet.jsp-2.3.2.jar"/>
285            To be included in jasper-runtime.jar?
286            Server complains "NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet" even with this included (but it still works).
287            The following file has the class, but /usr/share/java/jetty8-jsp.jar is empty
288            We don't use this one, because we want to be consistent with Debian builds that
289            must use Apache (aka libtomcat8).
290            <zipfileset excludes="about.html about_files about_files/* META-INF/ECLIPSEF.* META-INF/eclipse.inf plugin.properties" src="${jetty.base}/lib/jsp/jetty-jsp-${jetty.ver}.jar" />
291           -->
292
293            <!-- For both Apache in Jetty package and Apache package versions -->
294            <!-- required Jetty initializer (see RouterConsoleRunner) -->
295            <zipfileset src="${jetty.base}/lib/apache-jsp/org.eclipse.jetty.apache-jsp-${jetty.ver}.jar"/>
296
297            <!-- Apache in Jetty package version -->
298            <!-- Also includes javax.servlet.jsp.*, this is copied into javax.servlet.jar above -->
299          <!--
300            <zipfileset src="${jetty.base}/lib/apache-jsp/org.mortbay.jasper.apache-jsp-${jetty.ver}.jar"/>
301           -->
302
303            <!-- Apache package version -->
304            <!-- we match what was bundled in the Jetty package version -->
305            <zipfileset excludes="META-INF/LICENSE META-INF/NOTICE" src="${tomcat.lib}/jasper.jar"/>
306            <zipfileset excludes="META-INF/LICENSE META-INF/NOTICE" src="${tomcat.lib}/tomcat-api.jar"/>
307            <zipfileset includes="org/apache/juli/logging/**/*" src="${tomcat.bin}/tomcat-juli.jar"/>
308            <zipfileset excludes="META-INF/LICENSE META-INF/NOTICE org/apache/tomcat/util/codec/ org/apache/tomcat/util/compat/ org/apache/tomcat/util/threads/" src="${tomcat.lib}/tomcat-util.jar"/>
309            <zipfileset excludes="META-INF/LICENSE META-INF/NOTICE" src="${tomcat.lib}/tomcat-util-scan.jar"/>
310        </jar>
311
312        <jar destfile="jettylib/commons-logging.jar" update="true" >
313            <manifest>
314                <attribute name="Note" value="Intentionally empty" />
315            </manifest>
316        </jar>
317    </target>
318
319    <target name="copyTomcatLib3" unless="${with-libtomcat-java}" >
320        <jar destfile="jettylib/jasper-compiler.jar" >
321            <manifest>
322                <attribute name="Note" value="Intentionally empty" />
323            </manifest>
324        </jar>
325    </target>
326
327    <target name="build" depends="jar" />
328
329    <target name="builddep" />
330
331    <condition property="depend.available">
332        <typefound name="depend" />
333    </condition>
334
335    <target name="depend" if="depend.available">
336        <depend
337            cache="../../build"
338            srcdir="./java/src" 
339            destdir="./build/obj" >
340            <classpath>
341                <pathelement location="../../../core/java/build/i2p.jar" />
342                <pathelement location="./jettylib/commons-logging.jar" />
343                <pathelement location="./jettylib/org.mortbay.jetty.jar" />
344                <pathelement location="./jettylib/javax.servlet.jar" />
345                <pathelement location="./jettylib/jetty-http.jar" />
346                <pathelement location="./jettylib/jetty-io.jar" />
347                <pathelement location="./jettylib/jetty-security.jar" />
348                <pathelement location="./jettylib/jetty-servlet.jar" />
349                <pathelement location="./jettylib/jetty-util.jar" />
350                <pathelement location="./jettylib/jetty-xml.jar" />
351            </classpath>
352        </depend>
353    </target>
354
355    <target name="compile" depends="builddep, ensureJettylib, depend" >
356        <mkdir dir="./build" />
357        <mkdir dir="./build/obj" />
358        <javac 
359            srcdir="./java/src" 
360            debug="true" deprecation="on" source="${javac.version}" target="${javac.version}" 
361            destdir="./build/obj" 
362            includeAntRuntime="false"
363            classpath="../../core/java/build/i2p.jar:./jettylib/commons-logging.jar:./jettylib/javax.servlet.jar:./jettylib/org.mortbay.jetty.jar:./jettylib/jetty-http.jar:./jettylib/jetty-io.jar:./jettylib/jetty-security.jar:./jettylib/jetty-servlet.jar:./jettylib/jetty-util.jar:./jettylib/jetty-xml.jar" >
364            <compilerarg line="${javac.compilerargs}" />
365        </javac>
366    </target>
367
368    <target name="listChangedFiles" depends="jarUpToDate" if="shouldListChanges" >
369        <exec executable="mtn" outputproperty="workspace.changes" errorproperty="mtn.error2" failifexecutionfails="false" >
370            <arg value="list" />
371            <arg value="changed" />
372            <arg value="." />
373        </exec>
374        <!-- \n in an attribute value generates an invalid manifest -->
375        <exec executable="tr" inputstring="${workspace.changes}" outputproperty="workspace.changes.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
376            <arg value="-s" />
377            <arg value="[:space:]" />
378            <arg value="," />
379        </exec>
380    </target>
381
382    <!-- With Jetty 5 we replaced classes in the jar, but with Jetty 6 we
383         put our stuff in its own jar so we can work with standard Jetty 6 packages
384      -->
385    <target name="jar" depends="compile, jarUpToDate, listChangedFiles" unless="jar.uptodate" >
386        <!-- set if unset -->
387        <property name="workspace.changes.tr" value="" />
388        <copy todir="build/obj" file="resources/log4j.properties" />
389        <jar destfile="./jettylib/jetty-i2p.jar" basedir="./build/obj" includes="**/*.class log4j.properties" >
390            <manifest>
391                <attribute name="Built-By" value="${build.built-by}" />
392                <attribute name="Build-Date" value="${build.timestamp}" />
393                <attribute name="Base-Revision" value="${workspace.version}" />
394                <!-- needed by JettyStart for pre-0.7.5 wrapper.config -->
395                <attribute name="Class-Path" value="jetty-deploy.jar jetty-xml.jar" />
396                <attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
397                <attribute name="X-Compile-Source-JDK" value="${javac.version}" />
398                <attribute name="X-Compile-Target-JDK" value="${javac.version}" />
399            </manifest>
400        </jar>
401    </target>   
402
403    <target name="jarUpToDate">
404        <uptodate property="jar.uptodate" targetfile="jettylib/jetty-i2p.jar" >
405            <srcfiles dir= "build/obj" includes="**/*.class" />
406        </uptodate>
407        <condition property="shouldListChanges" >
408            <and>
409                <not>
410                    <isset property="jar.uptodate" />
411                </not>
412                <isset property="mtn.available" />
413            </and>
414        </condition>
415    </target>   
416
417    <!-- empty, uncomment below if needed -->
418    <target name="buildPatches" unless="${with-libjetty9-java}" />
419<!--
420    <target name="buildPatches" depends="jarPatches" unless="${with-libjetty9-java}" />
421
422    <target name="compilePatches" unless="${with-libjetty9-java}" >
423        <mkdir dir="./build" />
424        <mkdir dir="./build/objPatches" />
425        <javac
426            srcdir="./patches/jetty-util/src/main/java"
427            debug="true" deprecation="on" source="${javac.version}" target="${javac.version}"
428            destdir="./build/objPatches"
429            includeAntRuntime="false"
430            classpath="" >
431            <compilerarg line="${javac.compilerargs}" />
432        </javac>
433    </target>
434
435    <target name="jarPatches" depends="compilePatches, jarPatchesUpToDate" unless="jarPatches.uptodate" >
436        <jar destfile="./build/jetty-util-patch.jar" basedir="./build/objPatches" includes="**/*.class" >
437        </jar>
438    </target>   
439
440    <target name="jarPatchesUpToDate" >
441        <condition property="jarPatches.uptodate" >
442            <or>
443                <equals arg1="${with-libjetty9-java}" arg2="true" />
444                <uptodate property="jarPatches.uptodate" targetfile="jettylib/jetty-i2p.jar" >
445                    <srcfiles dir= "build/objPatches" includes="**/*.class" />
446                </uptodate>
447            </or>
448        </condition>
449    </target>   
450-->
451
452    <target name="clean" >
453        <delete dir="./build" />
454        <delete file="${verified.filename}" />
455    </target>   
456    <target name="cleandep" depends="clean" />
457    <target name="distclean" depends="clean">
458        <delete dir="./jettylib" />
459      <!--
460        <echo message="Not actually deleting the jetty libs (since they're so large)" />
461       -->
462    </target>
463    <target name="reallyclean" depends="distclean">
464    </target>
465    <target name="totallyclean" depends="clean">
466        <delete dir="./jettylib" />
467        <delete file="${jetty.filename}" />
468    </target>
469    <target name="javadoc" >
470        <available property="jetty.zip.available" file="${jetty.filename}" type="file" />
471        <available property="jetty.zip.javadocExtracted" file="build/javadoc" type="dir" />
472        <ant target="fetchJettylib" />
473        <ant target="verifyJettylib" />
474        <ant target="extractJavadoc" />
475    </target>
476    <target name="extractJavadoc" unless="jetty.zip.javadocExtracted" >
477        <mkdir dir="./build" />
478        <mkdir dir="./build/javadoc" />
479        <unzip src="${jetty.filename}" dest="./build/javadoc" >
480            <patternset>
481                <include name="${jetty.base}/javadoc/" />
482            </patternset>
483            <mapper type="glob" from="${jetty.base}/javadoc/*" to="javadoc/*" />
484        </unzip>
485    </target>
486
487    <!-- for Maven Central -->
488    <target name="servletJar" depends="compile" >
489        <!-- set if unset -->
490        <jar destfile="./build/servlet-i2p-${release.number}.jar" basedir="./build/obj" includes="net/i2p/servlet/filters/*.class" >
491            <manifest>
492                <attribute name="Specification-Title" value="I2P Servlet classes" />
493                <attribute name="Specification-Version" value="${release.number}" />
494                <attribute name="Specification-Vendor" value="The I2P Project https://geti2p.net/" />
495                <attribute name="Implementation-Title" value="I2P Java Servlet classes" />
496                <attribute name="Implementation-Version" value="${full.version}" />
497                <attribute name="Implementation-Vendor" value="The I2P Project https://geti2p.net/" />
498                <attribute name="Built-By" value="${build.built-by}" />
499                <attribute name="Build-Date" value="${build.timestamp}" />
500                <attribute name="Base-Revision" value="${workspace.version}" />
501                <attribute name="X-Compile-Source-JDK" value="${javac.version}" />
502                <attribute name="X-Compile-Target-JDK" value="${javac.version}" />
503            </manifest>
504        </jar>
505    </target>   
506    <target name="servletJavadoc">
507        <mkdir dir="./build" />
508        <mkdir dir="./build/servlet-i2p-javadoc" />
509        <javadoc
510            sourcepath="./java/src:../../core/java/src" destdir="./build/servlet-i2p-javadoc"
511            packagenames="net.i2p.servlet.filters.*"
512            use="true"
513            splitindex="true"
514            windowtitle="I2P Servlet classes" />
515    </target>
516    <target name="servletJavadocJar" depends="servletJavadoc">
517        <jar jarfile="./build/servlet-i2p-${release.number}-javadoc.jar">
518            <fileset dir="./build/servlet-i2p-javadoc" />
519        </jar>
520    </target>
521    <target name="servletSourcesJar">
522        <jar jarfile="./build/servlet-i2p-${release.number}-sources.jar">
523            <fileset dir="./java/src" includes="net/i2p/servlet/filters/**" />
524        </jar>
525    </target>
526
527</project>
Note: See TracBrowser for help on using the repository browser.