source: apps/jetty/build.xml

Last change on this file was eff2bdbf, checked in by zzz <zzz@…>, 14 months ago

Build: Fix Debian (ticket #2517)

  • Property mode set to 100644
File size: 31.0 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-libtomcat9-java: Buster
143           with-libtomcat9-java AND with-libjetty9-java: Buster
144           with-libjetty9-java (only): not supported
145     -->
146    <target name="copyJettylib" depends="mkJettylibdir, copyJettylib1, copyTomcatLib1, copyJettylib2, copyJettylib3, copyTomcatLib" />
147
148    <!-- Jetty files only -->
149    <target name="copyJettylib1" depends="extractJettylib, buildPatches" unless="${with-libjetty9-java}" >
150      <!-- We copy everything to names without the version numbers so we
151           can update them later. Where there was something similar in Jetty 5/6,
152           we use the same names so they will overwrite the Jetty 5/6 jar on upgrade.
153           Otherwise we use the same name as the symlink in Ubuntu /usr/share/java.
154           Reasons for inclusion:
155              start.jar: Needed for clients.config startup of eepsites
156              jetty-util-xxx.jar: LifeCycle (base class for stuff), URIUtil (used in i2psnark)
157              jetty-deploy, -http, -io, -security, -servlet, -webapp: All split out from main server jar in Jetty 7
158              jetty-continuation-xxx.jar: Needed? Useful?
159              jetty-servlets-xxx.jar: Needed for CGI for eepsite
160              jetty-sslengine-xxx.jar: Old Jetty 6, now a dummy
161              jetty-java5-threadpool-xxx.jar: Old Jetty 6, now a dummy
162              jetty-rewrite-handler: Not used by I2P, but only 20KB and could be useful for eepsites
163              jetty-management: Not used by I2P, but only 34KB and could be useful for eepsites, and we bundled it with Jetty 5
164              javax.servlet.jsp-2.2.0.v201112011158.jar: Required API
165              servlet-api-3.0.jar: Required API
166              All of these are available in the Ubuntu packages libjetty-java and libjetty-extra-java
167        -->
168        <copy preservelastmodified="true" file="${jetty.base}/start.jar" tofile="jettylib/jetty-start.jar" />
169        <copy file="${jetty.base}/lib/jetty-server-${jetty.ver}.jar" tofile="jettylib/org.mortbay.jetty.jar" />
170        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-continuation-${jetty.ver}.jar" tofile="jettylib/jetty-continuation.jar" />
171        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-deploy-${jetty.ver}.jar" tofile="jettylib/jetty-deploy.jar" />
172        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-http-${jetty.ver}.jar" tofile="jettylib/jetty-http.jar" />
173        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-io-${jetty.ver}.jar" tofile="jettylib/jetty-io.jar" />
174        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-jmx-${jetty.ver}.jar" tofile="jettylib/org.mortbay.jmx.jar" />
175        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-rewrite-${jetty.ver}.jar" tofile="jettylib/jetty-rewrite-handler.jar" />
176        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-security-${jetty.ver}.jar" tofile="jettylib/jetty-security.jar" />
177        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-servlet-${jetty.ver}.jar" tofile="jettylib/jetty-servlet.jar" />
178        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-servlets-${jetty.ver}.jar" tofile="jettylib/jetty-servlets.jar" />
179        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-util-${jetty.ver}.jar" tofile="jettylib/jetty-util.jar" />
180      <!-- comment out above line and uncomment below and the patches section further down if we need patches
181        <jar destfile="jettylib/jetty-util.jar"  manifest="${jetty.base}/lib/jetty-util-${jetty.ver}.jar" filesetmanifest="mergewithoutmain" >
182            <zipfileset excludes="**/RolloverFileOutputStream*.class" src="${jetty.base}/lib/jetty-util-${jetty.ver}.jar" />
183            <zipfileset src="build/jetty-util-patch.jar" />
184        </jar>
185       -->
186        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-webapp-${jetty.ver}.jar" tofile="jettylib/jetty-webapp.jar" />
187        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-xml-${jetty.ver}.jar" tofile="jettylib/jetty-xml.jar" />
188        <jar destfile="jettylib/jetty-java5-threadpool.jar" >
189            <manifest>
190                <attribute name="Note" value="Intentionally empty" />
191            </manifest>
192        </jar>
193        <jar destfile="jettylib/jetty-sslengine.jar" >
194            <manifest>
195                <attribute name="Note" value="Intentionally empty" />
196            </manifest>
197        </jar>
198    </target>
199
200    <!--
201         Make javax.servlet.jar.
202         If with-libtomcat8-java or with-libtomcat9-java but not with-libjetty9-java, we don't do this.
203         copyTomcatLib1 dependency to set the with-libtomcat-java variable.
204     -->
205    <target name="copyJettylib2" depends="extractJettylib, copyTomcatLib1" unless="${with-libtomcat-java}" >
206        <jar destfile="jettylib/javax.servlet.jar" duplicate="preserve" filesetmanifest="mergewithoutmain" >
207            <!-- all versions - Servlet API -->
208            <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" />
209
210          <!--
211            Jetty version - see below for why we don't use this one
212            <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" />
213           -->
214
215            <!-- Apache in Jetty package version -->
216            <!-- Also includes org.apache.*, this is copied into jasper-runtime.jar below -->
217            <!-- In Debian packages they are found in /usr/share/java/tomcat8-servlet-api.jar in the libtomcat8-java package -->
218            <!-- javax/servlet/jsp/resources are dups of those in apache-jsp jar -->
219          <!--
220            <zipfileset includes="javax/**/*" src="${jetty.base}/lib/apache-jsp/org.mortbay.jasper.apache-jsp-8.0.33.jar"/>
221            <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" />
222           -->
223
224            <!-- Apache package version -->
225            <zipfileset excludes="META-INF/LICENSE META-INF/NOTICE" src="${tomcat.lib}/jsp-api.jar"/>
226            <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" />
227        </jar>
228      <!--
229        <delete file="jetty.tar" />
230        <delete dir="${jetty.base}" />
231      -->
232    </target>
233
234    <!-- Copy jetty-apache-jsp.jar -->
235    <!-- ONLY if with-libtomcat8-java but NOT with-libjetty9-java (wheezy/jessie configuration) -->
236    <!-- If neither with-libtomcat8-java nor with-libjetty9-java, it's merged into jasper-runtime.jar in the copyTomcatLib2 target below -->
237    <target name="copyJettylib3" depends="extractJettylib, copyTomcatLib1" if="${with-libtomcat-without-libjetty}" >
238            <copy preservelastmodified="true" file="${jetty.base}/lib/apache-jsp/org.eclipse.jetty.apache-jsp-${jetty.ver}.jar" tofile="jettylib/jetty-apache-jsp.jar" />
239    </target>
240
241    <!-- Tomcat.
242         The glassfish jars bundled in Jetty 6 are way too old.
243         For compatibility with very old I2P installations where the classpath
244         was set individually in wrapper.config, we rename and combine the jars as follows:
245         jasper.jar : jasper-runtime.jar
246         jasper-el.jar + el-api.jar : commons-el.jar
247         tomcat-juli.jar : Add to jasper-runtime.jar
248         empty jar : jasper-compiler.jar
249         Also, take NOTICE and LICENSE out of each one, we bundle those separately.
250
251         Not as of Jetty 8 (using from Jetty):
252         servlet-api.jar + jsp-api.jar : javax.servlet.jar
253         If we go to Tomcat 7:
254         tomcat-api.jar + tomcat-util.jar: Add to javax.servlet.jar (as of Tomcat 7 / Jetty 8)
255     -->
256    <target name="copyTomcatLib" depends="mkJettylibdir, copyTomcatLib1, copyTomcatLib2, copyTomcatLib3" />
257
258    <target name="copyTomcatLib1" >
259        <condition property="with-libtomcat-java" >
260            <or>
261                <istrue value="${with-libtomcat6-java}" />
262                <istrue value="${with-libtomcat7-java}" />
263                <istrue value="${with-libtomcat8-java}" />
264                <istrue value="${with-libtomcat9-java}" />
265            </or>
266        </condition>
267        <condition property="with-libtomcat-without-libjetty" >
268            <and>
269                <istrue value="${with-libtomcat-java}" />
270                <not>
271                    <istrue value="${with-libjetty9-java}" />
272                </not>
273            </and>
274        </condition>
275    </target>
276
277
278    <!-- Make commons-el.jar and jasper-runtime.jar -->
279    <target name="copyTomcatLib2" unless="${with-libtomcat-java}" >
280        <!-- EL API and compiler libs.
281             Tomcat 6 has EL 2.1.
282             Tomcat 7 / libservlet3.0 has EL 2.2.
283             Jetty 9 / Tomcat 8 / libservlet3.1 has EL 3.0.
284             According to http://stackoverflow.com/questions/7202686/differences-between-el-2-1-and-2-2
285             2.2 is backwards-compatible with 2.1.
286         -->
287        <!-- the javax.el API, AND the com.sun.el parser -->
288        <!-- actually from jetty9, not tomcat8... this will fail unless we have the jetty files also -->
289        <jar destfile="jettylib/commons-el.jar" duplicate="preserve" filesetmanifest="mergewithoutmain">
290          <!--
291            Jetty version
292            <zipfileset src="${jetty.base}/lib/jsp/javax.el-3.0.0.jar"/>
293           -->
294
295            <!-- Apache in Jetty package version -->
296          <!--
297            <zipfileset src="${jetty.base}/lib/apache-jsp/org.mortbay.jasper.apache-el-${tomcat.ver}.jar"/>
298           -->
299
300            <!-- Apache package version -->
301            <zipfileset excludes="META-INF/LICENSE META-INF/NOTICE" src="${tomcat.lib}/el-api.jar"/>
302            <zipfileset excludes="META-INF/LICENSE META-INF/NOTICE" src="${tomcat.lib}/jasper-el.jar"/>
303        </jar>
304
305        <!-- actually from jetty9, not tomcat8... this will fail unless we have the jetty files also -->
306        <jar destfile="jettylib/jasper-runtime.jar" duplicate="preserve" filesetmanifest="mergewithoutmain" >
307          <!--
308            Jetty version
309            <zipfileset src="${jetty.base}/lib/jsp/javax.servlet.jsp-2.3.2.jar"/>
310            To be included in jasper-runtime.jar?
311            Server complains "NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet" even with this included (but it still works).
312            The following file has the class, but /usr/share/java/jetty8-jsp.jar is empty
313            We don't use this one, because we want to be consistent with Debian builds that
314            must use Apache (aka libtomcat8).
315            <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" />
316           -->
317
318            <!-- For both Apache in Jetty package and Apache package versions -->
319            <!-- required Jetty initializer (see RouterConsoleRunner) -->
320            <zipfileset src="${jetty.base}/lib/apache-jsp/org.eclipse.jetty.apache-jsp-${jetty.ver}.jar"/>
321
322            <!-- Apache in Jetty package version -->
323            <!-- Also includes javax.servlet.jsp.*, this is copied into javax.servlet.jar above -->
324          <!--
325            <zipfileset src="${jetty.base}/lib/apache-jsp/org.mortbay.jasper.apache-jsp-${jetty.ver}.jar"/>
326           -->
327
328            <!-- Apache package version -->
329            <!-- we match what was bundled in the Jetty package version -->
330            <!-- except we need compat/ as of 8.5.29 or JspC fails in the jar scan -->
331            <zipfileset excludes="META-INF/LICENSE META-INF/NOTICE" src="${tomcat.lib}/jasper.jar"/>
332            <zipfileset excludes="META-INF/LICENSE META-INF/NOTICE" src="${tomcat.lib}/tomcat-api.jar"/>
333            <zipfileset includes="org/apache/juli/logging/**/*" src="${tomcat.bin}/tomcat-juli.jar"/>
334            <zipfileset excludes="META-INF/LICENSE META-INF/NOTICE org/apache/tomcat/util/codec/ org/apache/tomcat/util/threads/" src="${tomcat.lib}/tomcat-util.jar"/>
335            <zipfileset excludes="META-INF/LICENSE META-INF/NOTICE" src="${tomcat.lib}/tomcat-util-scan.jar"/>
336        </jar>
337
338        <jar destfile="jettylib/commons-logging.jar" update="true" >
339            <manifest>
340                <attribute name="Note" value="Intentionally empty" />
341            </manifest>
342        </jar>
343    </target>
344
345    <target name="copyTomcatLib3" unless="${with-libtomcat-java}" >
346        <jar destfile="jettylib/jasper-compiler.jar" >
347            <manifest>
348                <attribute name="Note" value="Intentionally empty" />
349            </manifest>
350        </jar>
351    </target>
352
353    <target name="build" depends="jar" />
354
355    <target name="builddep" />
356
357    <condition property="depend.available">
358        <typefound name="depend" />
359    </condition>
360
361    <target name="depend" if="depend.available">
362        <depend
363            cache="../../build"
364            srcdir="./java/src" 
365            destdir="./build/obj" >
366            <classpath>
367                <pathelement location="../../core/java/build/i2p.jar" />
368                <pathelement location="./jettylib/org.mortbay.jetty.jar" />
369                <pathelement location="./jettylib/jasper-runtime.jar" />
370                <pathelement location="./jettylib/javax.servlet.jar" />
371                <pathelement location="./jettylib/jetty-deploy.jar" />
372                <pathelement location="./jettylib/jetty-http.jar" />
373                <pathelement location="./jettylib/jetty-io.jar" />
374                <pathelement location="./jettylib/jetty-security.jar" />
375                <pathelement location="./jettylib/jetty-servlet.jar" />
376                <pathelement location="./jettylib/jetty-util.jar" />
377                <pathelement location="./jettylib/jetty-webapp.jar" />
378                <pathelement location="./jettylib/jetty-xml.jar" />
379            </classpath>
380        </depend>
381    </target>
382
383    <target name="compile" depends="builddep, ensureJettylib, depend" >
384        <mkdir dir="./build" />
385        <mkdir dir="./build/obj" />
386        <javac 
387            srcdir="./java/src" 
388            debug="true" deprecation="on" source="${javac.version}" target="${javac.version}" 
389            destdir="./build/obj" 
390            includeAntRuntime="false" >
391            <classpath>
392                <pathelement location="../../core/java/build/i2p.jar" />
393                <pathelement location="./jettylib/jasper-runtime.jar" />
394                <pathelement location="./jettylib/javax.servlet.jar" />
395                <pathelement location="./jettylib/jetty-deploy.jar" />
396                <pathelement location="./jettylib/jetty-http.jar" />
397                <pathelement location="./jettylib/jetty-io.jar" />
398                <pathelement location="./jettylib/jetty-security.jar" />
399                <pathelement location="./jettylib/jetty-servlet.jar" />
400                <pathelement location="./jettylib/jetty-util.jar" />
401                <pathelement location="./jettylib/jetty-webapp.jar" />
402                <pathelement location="./jettylib/jetty-xml.jar" />
403                <pathelement location="./jettylib/org.mortbay.jetty.jar" />
404                <!-- following jar only present for debian builds -->
405                <pathelement location="./jettylib/tomcat-api.jar" />
406            </classpath>
407            <compilerarg line="${javac.compilerargs}" />
408        </javac>
409    </target>
410
411    <target name="listChangedFiles" depends="jarUpToDate" if="shouldListChanges" >
412        <exec executable="mtn" outputproperty="workspace.changes" errorproperty="mtn.error2" failifexecutionfails="false" >
413            <arg value="list" />
414            <arg value="changed" />
415            <arg value="." />
416        </exec>
417        <!-- \n in an attribute value generates an invalid manifest -->
418        <exec executable="tr" inputstring="${workspace.changes}" outputproperty="workspace.changes.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
419            <arg value="-s" />
420            <arg value="[:space:]" />
421            <arg value="," />
422        </exec>
423    </target>
424
425    <!-- With Jetty 5 we replaced classes in the jar, but with Jetty 6 we
426         put our stuff in its own jar so we can work with standard Jetty 6 packages
427      -->
428    <target name="jar" depends="compile, jarUpToDate, listChangedFiles" unless="jar.uptodate" >
429        <!-- set if unset -->
430        <property name="workspace.changes.tr" value="" />
431        <copy todir="build/obj" file="resources/log4j.properties" />
432        <jar destfile="./jettylib/jetty-i2p.jar" basedir="./build/obj" includes="**/*.class log4j.properties" >
433            <manifest>
434                <attribute name="Built-By" value="${build.built-by}" />
435                <attribute name="Build-Date" value="${build.timestamp}" />
436                <attribute name="Base-Revision" value="${workspace.version}" />
437                <!-- needed by JettyStart for pre-0.7.5 wrapper.config -->
438                <attribute name="${manifest.classpath.name}" value="jetty-deploy.jar jetty-xml.jar" />
439                <attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
440                <attribute name="X-Compile-Source-JDK" value="${javac.version}" />
441                <attribute name="X-Compile-Target-JDK" value="${javac.version}" />
442            </manifest>
443        </jar>
444    </target>   
445
446    <target name="jarUpToDate">
447        <uptodate property="jar.uptodate" targetfile="jettylib/jetty-i2p.jar" >
448            <srcfiles dir= "build/obj" includes="**/*.class" />
449        </uptodate>
450        <condition property="shouldListChanges" >
451            <and>
452                <not>
453                    <isset property="jar.uptodate" />
454                </not>
455                <isset property="mtn.available" />
456            </and>
457        </condition>
458    </target>   
459
460    <!-- empty, uncomment below if needed -->
461    <target name="buildPatches" unless="${with-libjetty9-java}" />
462<!--
463    <target name="buildPatches" depends="jarPatches" unless="${with-libjetty9-java}" />
464
465    <target name="compilePatches" unless="${with-libjetty9-java}" >
466        <mkdir dir="./build" />
467        <mkdir dir="./build/objPatches" />
468        <javac
469            srcdir="./patches/jetty-util/src/main/java"
470            debug="true" deprecation="on" source="${javac.version}" target="${javac.version}"
471            destdir="./build/objPatches"
472            includeAntRuntime="false"
473            classpath="" >
474            <compilerarg line="${javac.compilerargs}" />
475        </javac>
476    </target>
477
478    <target name="jarPatches" depends="compilePatches, jarPatchesUpToDate" unless="jarPatches.uptodate" >
479        <jar destfile="./build/jetty-util-patch.jar" basedir="./build/objPatches" includes="**/*.class" >
480        </jar>
481    </target>   
482
483    <target name="jarPatchesUpToDate" >
484        <condition property="jarPatches.uptodate" >
485            <or>
486                <equals arg1="${with-libjetty9-java}" arg2="true" />
487                <uptodate property="jarPatches.uptodate" targetfile="jettylib/jetty-i2p.jar" >
488                    <srcfiles dir= "build/objPatches" includes="**/*.class" />
489                </uptodate>
490            </or>
491        </condition>
492    </target>   
493-->
494
495    <target name="clean" >
496        <delete dir="./build" />
497        <delete file="${verified.filename}" />
498    </target>   
499    <target name="cleandep" depends="clean" />
500    <target name="distclean" depends="clean">
501        <delete dir="./jettylib" />
502      <!--
503        <echo message="Not actually deleting the jetty libs (since they're so large)" />
504       -->
505    </target>
506    <target name="reallyclean" depends="distclean">
507    </target>
508    <target name="totallyclean" depends="clean">
509        <delete dir="./jettylib" />
510        <delete file="${jetty.filename}" />
511    </target>
512    <target name="javadoc" >
513        <available property="jetty.zip.available" file="${jetty.filename}" type="file" />
514        <available property="jetty.zip.javadocExtracted" file="build/javadoc" type="dir" />
515        <ant target="fetchJettylib" />
516        <ant target="verifyJettylib" />
517        <ant target="extractJavadoc" />
518    </target>
519    <target name="extractJavadoc" unless="jetty.zip.javadocExtracted" >
520        <mkdir dir="./build" />
521        <mkdir dir="./build/javadoc" />
522        <unzip src="${jetty.filename}" dest="./build/javadoc" >
523            <patternset>
524                <include name="${jetty.base}/javadoc/" />
525            </patternset>
526            <mapper type="glob" from="${jetty.base}/javadoc/*" to="javadoc/*" />
527        </unzip>
528    </target>
529
530    <!-- for Maven Central -->
531    <target name="servletJar" depends="compile" >
532        <!-- set if unset -->
533        <jar destfile="./build/servlet-i2p-${release.number}.jar" basedir="./build/obj" includes="net/i2p/servlet/filters/*.class" >
534            <manifest>
535                <attribute name="Specification-Title" value="I2P Servlet classes" />
536                <attribute name="Specification-Version" value="${release.number}" />
537                <attribute name="Specification-Vendor" value="The I2P Project https://geti2p.net/" />
538                <attribute name="Implementation-Title" value="I2P Java Servlet classes" />
539                <attribute name="Implementation-Version" value="${full.version}" />
540                <attribute name="Implementation-Vendor" value="The I2P Project https://geti2p.net/" />
541                <attribute name="Built-By" value="${build.built-by}" />
542                <attribute name="Build-Date" value="${build.timestamp}" />
543                <attribute name="Base-Revision" value="${workspace.version}" />
544                <attribute name="X-Compile-Source-JDK" value="${javac.version}" />
545                <attribute name="X-Compile-Target-JDK" value="${javac.version}" />
546            </manifest>
547        </jar>
548    </target>   
549
550    <target name="servletJavadoc">
551        <mkdir dir="./build" />
552        <mkdir dir="./build/servlet-i2p-javadoc" />
553        <javadoc access="package"
554            source="${javac.version}"
555            destdir="./build/servlet-i2p-javadoc"
556            packagenames="*"
557            use="true"
558            splitindex="true"
559            failonerror="true"
560            additionalparam="-notimestamp"
561            doctitle="I2P Javadocs for Release ${release.number} Build ${i2p.build.number}${build.extra}"
562            windowtitle="I2P Anonymous Network - Java Documentation - Version ${release.number}">
563            <group title="Jetty Utilities" packages="*" />
564            <sourcepath>
565                <pathelement location="./java/src" />
566            </sourcepath>
567            <classpath>
568                <pathelement location="../../core/java/build/i2p.jar" />
569                <pathelement location="./jettylib/org.mortbay.jetty.jar" />
570                <pathelement location="./jettylib/javax.servlet.jar" />
571                <pathelement location="./jettylib/jasper-runtime.jar" />
572                <pathelement location="./jettylib/jetty-deploy.jar" />
573                <pathelement location="./jettylib/jetty-http.jar" />
574                <pathelement location="./jettylib/jetty-io.jar" />
575                <pathelement location="./jettylib/jetty-security.jar" />
576                <pathelement location="./jettylib/jetty-servlet.jar" />
577                <pathelement location="./jettylib/jetty-util.jar" />
578                <pathelement location="./jettylib/jetty-webapp.jar" />
579                <pathelement location="./jettylib/jetty-xml.jar" />
580                <!-- following are only for debian builds -->
581                <pathelement location="../../core/java/build/libintl.jar" />
582                <pathelement location="../../core/java/build/gnu-getopt.jar" />
583                <pathelement location="../../core/java/build/json-simple.jar" />
584                <pathelement location="./jettylib/tomcat-api.jar" />
585            </classpath>
586            <!-- These variables are stored in build.properties.
587                  End-users can override by creating the file override.properties -->
588            <link offline="true" href="${javasedocs.url}" packagelistLoc="../../installer/resources/package-lists/java/" />
589            <link offline="true" href="${javaeedocs.url}" packagelistLoc="../../installer/resources/package-lists/javaee/" />
590            <link offline="true" href="${jettydocs.url}" packagelistLoc="../../installer/resources/package-lists/jetty/" />
591            <link offline="true" href="${wrapperdocs.url}" packagelistLoc="../../installer/resources/package-lists/wrapper/" />
592        </javadoc>
593    </target>
594
595    <target name="servletJavadocJar" depends="servletJavadoc">
596        <jar jarfile="./build/servlet-i2p-${release.number}-javadoc.jar">
597            <fileset dir="./build/servlet-i2p-javadoc" />
598        </jar>
599    </target>
600
601    <target name="servletSourcesJar">
602        <jar jarfile="./build/servlet-i2p-${release.number}-sources.jar">
603            <fileset dir="./java/src" includes="net/i2p/servlet/filters/**" />
604        </jar>
605    </target>
606
607</project>
Note: See TracBrowser for help on using the repository browser.