source: apps/jetty/build.xml @ 69f380f

Last change on this file since 69f380f was 68feb08, checked in by zzz <zzz@…>, 2 years ago

Jetty 9.2.25.v20180606

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