source: apps/jetty/build.xml @ 2de36ee

Last change on this file since 2de36ee was e68182a, checked in by zzz <zzz@…>, 2 years ago

Build: Provide option to prevent Class-Path in manifests (ticket #2317)

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