Files
i2p.i2p/apps/jetty/build.xml

324 lines
16 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="all" name="jetty">
<property name="jetty.ver" value="8.1.14.v20131031" />
2012-11-21 18:05:50 +00:00
<property name="jetty.base" value="jetty-distribution-${jetty.ver}" />
<property name="jetty.sha1" value="a6690261a822157c82fcc6327d05ac8c7dfed0a3" />
<property name="jetty.filename" value="${jetty.base}.zip" />
2012-11-21 18:05:50 +00:00
<property name="jetty.url" value="http://download.eclipse.org/jetty/${jetty.ver}/dist/${jetty.filename}" />
<property name="verified.filename" value="verified.txt" />
<property name="javac.compilerargs" value="" />
2014-02-21 13:59:27 +00:00
<property name="javac.version" value="1.6" />
<property name="tomcat.lib" value="apache-tomcat-deployer/lib" />
<target name="all" depends="build" />
<!--
- We now check in the jars we need to ${jetty.base}, so
- fetchJettylib, verifyJettylib, and extractJettylib are not used unless
- updating to a new Jetty version by changing ${jetty.ver} and ${jetty.sha1} above.
-->
<target name="ensureJettylib" >
<available property="jetty.zip.extracted" file="${jetty.base}" type="dir" />
<condition property="jetty.zip.available" >
<or>
<istrue value="${jetty.zip.extracted}" />
<available file="${jetty.filename}" type="file" />
</or>
</condition>
<ant target="copyJettylib" />
2004-08-01 06:46:59 +00:00
</target>
<!--
<target name="ensureJettylib" depends="extractJettylib" />
-->
<target name="fetchJettylib" unless="jetty.zip.available" >
<echo message="It seems that you don't have '${jetty.filename}' deployed." />
<echo message="The build script can download this file for you automatically," />
<echo message="or alternatively you can obtain it manually from:" />
<echo message="${jetty.url}" />
<echo message="" />
<echo message="The libraries contained in the fetched file provide the Jetty web server" />
<echo message="(http://jetty.mortbay.org/). They are not absolutely necessary" />
<echo message="but strongly recommended, since they are used by some applications" />
<echo message="on top of I2P, like the router console." />
<echo message="" />
2010-06-14 17:29:23 +00:00
<echo message="Even if you deploy the Jetty archive manually into directory apps/jetty/," />
<echo message="the build script will still attempt to verify its checksums, which must be:" />
<echo message="SHA1 ${jetty.sha1}" />
<echo message="" />
<input message="Download Jetty archive automatically?" validargs="y,n" addproperty="jetty.download" />
<fail message="Aborting as requested. Please deploy the Jetty archive manually." >
<condition>
<equals arg1="${jetty.download}" arg2="n"/>
</condition>
</fail>
<get src="${jetty.url}" verbose="true" dest="${jetty.filename}" />
</target>
2010-01-31 20:26:57 +00:00
<condition property="verified.already" >
<or>
<istrue value="${jetty.zip.extracted}" />
<and>
<available file="${jetty.filename}" />
<uptodate property="foo.bar.baz" srcfile="${jetty.filename}" targetfile="${verified.filename}" />
</and>
</or>
2010-01-31 20:26:57 +00:00
</condition>
<target name="verifyJettylib" depends="fetchJettylib" unless="verified.already" >
<condition property="jetty.zip.verified" >
<checksum file="${jetty.filename}" algorithm="SHA" property="${jetty.sha1}" />
</condition>
2010-01-31 05:06:50 +00:00
<fail message="Jetty archive does not match its checksum!" >
<condition>
<not>
<istrue value="${jetty.zip.verified}" />
</not>
</condition>
</fail>
<touch file="${verified.filename}" />
2005-02-16 jrandom * (Merged the 0.5-pre branch back into CVS HEAD) * Replaced the old tunnel routing crypto with the one specified in router/doc/tunnel-alt.html, including updates to the web console to view and tweak it. * Provide the means for routers to reject tunnel requests with a wider range of responses: probabalistic rejection, due to approaching overload transient rejection, due to temporary overload bandwidth rejection, due to persistent bandwidth overload critical rejection, due to general router fault (or imminent shutdown) The different responses are factored into the profiles accordingly. * Replaced the old I2CP tunnel related options (tunnels.depthInbound, etc) with a series of new properties, relevent to the new tunnel routing code: inbound.nickname (used on the console) inbound.quantity (# of tunnels to use in any leaseSets) inbound.backupQuantity (# of tunnels to keep in the ready) inbound.length (# of remote peers in the tunnel) inbound.lengthVariance (if > 0, permute the length by adding a random # up to the variance. if < 0, permute the length by adding or subtracting a random # up to the variance) outbound.* (same as the inbound, except for the, uh, outbound tunnels in that client's pool) There are other options, and more will be added later, but the above are the most relevent ones. * Replaced Jetty 4.2.21 with Jetty 5.1.2 * Compress all profile data on disk. * Adjust the reseeding functionality to work even when the JVM's http proxy is set. * Enable a poor-man's interactive-flow in the streaming lib by choking the max window size. * Reduced the default streaming lib max message size to 16KB (though still configurable by the user), also doubling the default maximum window size. * Replaced the RouterIdentity in a Lease with its SHA256 hash. * Reduced the overall I2NP message checksum from a full 32 byte SHA256 to the first byte of the SHA256. * Added a new "netId" flag to let routers drop references to other routers who we won't be able to talk to. * Extended the timestamper to get a second (or third) opinion whenever it wants to actually adjust the clock offset. * Replaced that kludge of a timestamp I2NP message with a full blown DateMessage. * Substantial memory optimizations within the router and the SDK to reduce GC churn. Client apps and the streaming libs have not been tuned, however. * More bugfixes thank you can shake a stick at. 2005-02-13 jrandom * Updated jbigi source to handle 64bit CPUs. The bundled jbigi.jar still only contains 32bit versions, so build your own, placing libjbigi.so in your install dir if necessary. (thanks mule!) * Added support for libjbigi-$os-athlon64 to NativeBigInteger and CPUID (thanks spaetz!)
2005-02-16 22:23:47 +00:00
</target>
<target name="extractJettylib" depends="verifyJettylib" unless="jetty.zip.extracted" >
<!-- for .tgz -->
<!--
2010-01-31 05:06:50 +00:00
<gunzip src="${jetty.filename}" dest="jetty.tar" />
<untar src="jetty.tar" dest="." />
-->
<!-- for .zip -->
<unzip src="${jetty.filename}" dest="." />
</target>
<target name="copyJettylib" depends="extractJettylib" >
2005-02-16 jrandom * (Merged the 0.5-pre branch back into CVS HEAD) * Replaced the old tunnel routing crypto with the one specified in router/doc/tunnel-alt.html, including updates to the web console to view and tweak it. * Provide the means for routers to reject tunnel requests with a wider range of responses: probabalistic rejection, due to approaching overload transient rejection, due to temporary overload bandwidth rejection, due to persistent bandwidth overload critical rejection, due to general router fault (or imminent shutdown) The different responses are factored into the profiles accordingly. * Replaced the old I2CP tunnel related options (tunnels.depthInbound, etc) with a series of new properties, relevent to the new tunnel routing code: inbound.nickname (used on the console) inbound.quantity (# of tunnels to use in any leaseSets) inbound.backupQuantity (# of tunnels to keep in the ready) inbound.length (# of remote peers in the tunnel) inbound.lengthVariance (if > 0, permute the length by adding a random # up to the variance. if < 0, permute the length by adding or subtracting a random # up to the variance) outbound.* (same as the inbound, except for the, uh, outbound tunnels in that client's pool) There are other options, and more will be added later, but the above are the most relevent ones. * Replaced Jetty 4.2.21 with Jetty 5.1.2 * Compress all profile data on disk. * Adjust the reseeding functionality to work even when the JVM's http proxy is set. * Enable a poor-man's interactive-flow in the streaming lib by choking the max window size. * Reduced the default streaming lib max message size to 16KB (though still configurable by the user), also doubling the default maximum window size. * Replaced the RouterIdentity in a Lease with its SHA256 hash. * Reduced the overall I2NP message checksum from a full 32 byte SHA256 to the first byte of the SHA256. * Added a new "netId" flag to let routers drop references to other routers who we won't be able to talk to. * Extended the timestamper to get a second (or third) opinion whenever it wants to actually adjust the clock offset. * Replaced that kludge of a timestamp I2NP message with a full blown DateMessage. * Substantial memory optimizations within the router and the SDK to reduce GC churn. Client apps and the streaming libs have not been tuned, however. * More bugfixes thank you can shake a stick at. 2005-02-13 jrandom * Updated jbigi source to handle 64bit CPUs. The bundled jbigi.jar still only contains 32bit versions, so build your own, placing libjbigi.so in your install dir if necessary. (thanks mule!) * Added support for libjbigi-$os-athlon64 to NativeBigInteger and CPUID (thanks spaetz!)
2005-02-16 22:23:47 +00:00
<mkdir dir="jettylib" />
<!-- We copy everything to names without the version numbers so we
can update them later. Where there was something similar in Jetty 5/6,
we use the same names so they will overwrite the Jetty 5/6 jar on upgrade.
Otherwise we use the same name as the symlink in Ubuntu /usr/share/java.
Reasons for inclusion:
start.jar: Needed for clients.config startup of eepsites
jetty-util-xxx.jar: LifeCycle (base class for stuff), URIUtil (used in i2psnark)
jetty-deploy, -http, -io, -security, -servlet, -webapp: All split out from main server jar in Jetty 7
jetty-continuation-xxx.jar: Needed? Useful?
jetty-servlets-xxx.jar: Needed for CGI for eepsite
jetty-sslengine-xxx.jar: Old Jetty 6, now a dummy
jetty-java5-threadpool-xxx.jar: Old Jetty 6, now a dummy
jetty-rewrite-handler: Not used by I2P, but only 20KB and could be useful for eepsites
2012-01-14 22:20:39 +00:00
jetty-management: Not used by I2P, but only 34KB and could be useful for eepsites, and we bundled it with Jetty 5
javax.servlet.jsp-2.2.0.v201112011158.jar: Required API
servlet-api-3.0.jar: Required API
All of these are available in the Ubuntu packages libjetty-java and libjetty-extra-java
-->
<copy preservelastmodified="true" file="${jetty.base}/start.jar" tofile="jettylib/jetty-start.jar" />
2012-11-21 18:05:50 +00:00
<copy file="${jetty.base}/lib/jetty-server-${jetty.ver}.jar" tofile="jettylib/org.mortbay.jetty.jar" />
<copy preservelastmodified="true" file="${jetty.base}/lib/jetty-continuation-${jetty.ver}.jar" tofile="jettylib/jetty-continuation.jar" />
<copy preservelastmodified="true" file="${jetty.base}/lib/jetty-deploy-${jetty.ver}.jar" tofile="jettylib/jetty-deploy.jar" />
<copy preservelastmodified="true" file="${jetty.base}/lib/jetty-http-${jetty.ver}.jar" tofile="jettylib/jetty-http.jar" />
<copy preservelastmodified="true" file="${jetty.base}/lib/jetty-io-${jetty.ver}.jar" tofile="jettylib/jetty-io.jar" />
<copy preservelastmodified="true" file="${jetty.base}/lib/jetty-jmx-${jetty.ver}.jar" tofile="jettylib/org.mortbay.jmx.jar" />
<copy preservelastmodified="true" file="${jetty.base}/lib/jetty-rewrite-${jetty.ver}.jar" tofile="jettylib/jetty-rewrite-handler.jar" />
<copy preservelastmodified="true" file="${jetty.base}/lib/jetty-security-${jetty.ver}.jar" tofile="jettylib/jetty-security.jar" />
<copy preservelastmodified="true" file="${jetty.base}/lib/jetty-servlet-${jetty.ver}.jar" tofile="jettylib/jetty-servlet.jar" />
<copy preservelastmodified="true" file="${jetty.base}/lib/jetty-servlets-${jetty.ver}.jar" tofile="jettylib/jetty-servlets.jar" />
<copy preservelastmodified="true" file="${jetty.base}/lib/jetty-util-${jetty.ver}.jar" tofile="jettylib/jetty-util.jar" />
2012-11-21 18:05:50 +00:00
<copy preservelastmodified="true" file="${jetty.base}/lib/jetty-webapp-${jetty.ver}.jar" tofile="jettylib/jetty-webapp.jar" />
<copy preservelastmodified="true" file="${jetty.base}/lib/jetty-xml-${jetty.ver}.jar" tofile="jettylib/jetty-xml.jar" />
<jar destfile="jettylib/jetty-java5-threadpool.jar" >
<manifest>
<attribute name="Note" value="Intentionally empty" />
</manifest>
</jar>
<jar destfile="jettylib/jetty-sslengine.jar" >
<manifest>
<attribute name="Note" value="Intentionally empty" />
</manifest>
</jar>
<jar destfile="jettylib/javax.servlet.jar" duplicate="preserve" filesetmanifest="mergewithoutmain" >
<zipfileset excludes="about.html about_files about_files/* META-INF/ECLIPSEF.* META-INF/eclipse.inf plugin.properties" src="${jetty.base}/lib/servlet-api-3.0.jar" />
<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-2.2.0.v201112011158.jar" />
</jar>
<!--
<delete file="jetty.tar" />
2010-01-31 05:06:50 +00:00
<delete dir="${jetty.base}" />
-->
<!-- commons-logging.jar not in Jetty 6 but we have it in launch4j so copy it over,
needed for old plugins and things. We add tomcat-juli below.
-->
<jar destfile="jettylib/commons-logging.jar" filesetmanifest="mergewithoutmain" >
<zipfileset excludes="META-INF/LICENSE.txt META-INF/NOTICE.txt" src="../../installer/lib/launch4j/lib/commons-logging.jar" />
</jar>
<ant target="copyTomcatLib" />
</target>
<!-- Tomcat.
The glassfish jars bundled in Jetty 6 are way too old.
For compatibility with very old I2P installations where the classpath
was set individually in wrapper.config, we rename and combine the jars as follows:
jasper.jar : jasper-runtime.jar
jasper-el.jar + el-api.jar : commons-el.jar
tomcat-juli.jar : Add to commons-logging.jar
empty jar : jasper-compiler.jar
2012-01-10 20:17:35 +00:00
Also, take NOTICE and LICENSE out of each one, we bundle those separately.
Not as of Jetty 8 (using from Jetty):
servlet-api.jar + jsp-api.jar : javax.servlet.jar
If we go to Tomcat 7:
tomcat-api.jar + tomcat-util.jar: Add to javax.servlet.jar (as of Tomcat 7 / Jetty 8)
-->
<target name="copyTomcatLib" >
<jar destfile="jettylib/jasper-runtime.jar" filesetmanifest="merge" >
2012-01-10 20:17:35 +00:00
<zipfileset excludes="META-INF/LICENSE META-INF/NOTICE" src="${tomcat.lib}/jasper.jar" />
</jar>
<jar destfile="jettylib/commons-el.jar" duplicate="preserve" filesetmanifest="merge" >
2012-01-10 20:17:35 +00:00
<zipfileset excludes="META-INF/LICENSE META-INF/NOTICE" src="${tomcat.lib}/jasper-el.jar" />
<zipfileset excludes="META-INF/**/*" src="${tomcat.lib}/el-api.jar" />
</jar>
<!--
<jar destfile="jettylib/javax.servlet.jar" duplicate="preserve" filesetmanifest="mergewithoutmain" >
2012-01-10 20:17:35 +00:00
<zipfileset excludes="META-INF/LICENSE META-INF/NOTICE" src="${tomcat.lib}/servlet-api.jar" />
<zipfileset excludes="META-INF/**/*" src="${tomcat.lib}/jsp-api.jar" />
<zipfileset excludes="META-INF/LICENSE META-INF/NOTICE" src="${tomcat.lib}/tomcat-api.jar" />
<zipfileset excludes="META-INF/LICENSE META-INF/NOTICE" src="${tomcat.lib}/tomcat-util.jar" />
</jar>
-->
<!-- Ant bug, don't set update and filesetmanifest or the update doesn't happen,
Their bug tracker claims fixed in 1.8.0 but broken for me in 1.8.1
-->
<jar destfile="jettylib/commons-logging.jar" update="true" >
2012-01-10 20:17:35 +00:00
<zipfileset excludes="META-INF/LICENSE META-INF/NOTICE" src="${tomcat.lib}/tomcat-juli.jar" />
</jar>
<jar destfile="jettylib/jasper-compiler.jar" >
<manifest>
<attribute name="Note" value="Intentionally empty" />
</manifest>
</jar>
</target>
<target name="build" depends="jar" />
<target name="builddep" />
2012-11-21 18:05:50 +00:00
<condition property="depend.available">
<typefound name="depend" />
</condition>
<target name="depend" if="depend.available">
<depend
cache="../../build"
srcdir="./java/src"
destdir="./build/obj" >
<classpath>
<pathelement location="../../../core/java/build/i2p.jar" />
<pathelement location="./jettylib/commons-logging.jar" />
<pathelement location="./jettylib/org.mortbay.jetty.jar" />
<pathelement location="./jettylib/javax.servlet.jar" />
<pathelement location="./jettylib/jetty-http.jar" />
<pathelement location="./jettylib/jetty-io.jar" />
<pathelement location="./jettylib/jetty-security.jar" />
<pathelement location="./jettylib/jetty-util.jar" />
<pathelement location="./jettylib/jetty-xml.jar" />
</classpath>
</depend>
</target>
<target name="compile" depends="builddep, ensureJettylib, depend" >
<mkdir dir="./build" />
<mkdir dir="./build/obj" />
<javac
srcdir="./java/src"
2014-02-21 13:59:27 +00:00
debug="true" deprecation="on" source="${javac.version}" target="${javac.version}"
destdir="./build/obj"
includeAntRuntime="false"
classpath="../../core/java/build/i2p.jar:./jettylib/commons-logging.jar:./jettylib/javax.servlet.jar:./jettylib/org.mortbay.jetty.jar:./jettylib/jetty-http.jar:./jettylib/jetty-io.jar:./jettylib/jetty-security.jar:./jettylib/jetty-util.jar:./jettylib/jetty-xml.jar" >
<compilerarg line="${javac.compilerargs}" />
</javac>
</target>
<target name="listChangedFiles" depends="jarUpToDate" if="shouldListChanges" >
<exec executable="mtn" outputproperty="workspace.changes" errorproperty="mtn.error2" failifexecutionfails="false" >
<arg value="list" />
<arg value="changed" />
<arg value="." />
</exec>
<!-- \n in an attribute value generates an invalid manifest -->
<exec executable="tr" inputstring="${workspace.changes}" outputproperty="workspace.changes.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
<arg value="-s" />
<arg value="[:space:]" />
<arg value="," />
</exec>
</target>
<!-- With Jetty 5 we replaced classes in the jar, but with Jetty 6 we
put our stuff in its own jar so we can work with standard Jetty 6 packages
-->
<target name="jar" depends="compile, jarUpToDate, listChangedFiles" unless="jar.uptodate" >
<!-- set if unset -->
<property name="workspace.changes.tr" value="" />
<!-- old jetty 5 classes blow up the build if you forgot to do distclean -->
<delete dir="build/obj/org" />
2011-12-30 21:58:16 +00:00
<copy todir="build/obj" file="resources/log4j.properties" />
<jar destfile="./jettylib/jetty-i2p.jar" basedir="./build/obj" includes="**/*.class log4j.properties" >
<manifest>
<attribute name="Built-By" value="${build.built-by}" />
<attribute name="Build-Date" value="${build.timestamp}" />
<attribute name="Base-Revision" value="${workspace.version}" />
<!-- needed by JettyStart for pre-0.7.5 wrapper.config -->
<attribute name="Class-Path" value="jetty-deploy.jar jetty-xml.jar" />
<attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
</manifest>
</jar>
</target>
<target name="jarUpToDate">
2011-12-23 15:41:05 +00:00
<uptodate property="jar.uptodate" targetfile="jettylib/jetty-i2p.jar" >
<srcfiles dir= "build/obj" includes="**/*.class" />
</uptodate>
<condition property="shouldListChanges" >
<and>
<not>
<isset property="jar.uptodate" />
</not>
<isset property="mtn.available" />
</and>
</condition>
</target>
<target name="clean" >
<delete dir="./build" />
<delete file="${verified.filename}" />
</target>
<target name="cleandep" depends="clean" />
<target name="distclean" depends="clean">
<delete dir="./jettylib" />
<!--
<echo message="Not actually deleting the jetty libs (since they're so large)" />
-->
</target>
2009-08-15 19:51:13 +00:00
<target name="reallyclean" depends="distclean">
</target>
<target name="totallyclean" depends="clean">
<delete dir="./jettylib" />
<delete file="${jetty.filename}" />
</target>
<target name="javadoc" >
<available property="jetty.zip.available" file="${jetty.filename}" type="file" />
<available property="jetty.zip.javadocExtracted" file="build/javadoc" type="dir" />
<ant target="fetchJettylib" />
<ant target="verifyJettylib" />
<ant target="extractJavadoc" />
</target>
<target name="extractJavadoc" unless="jetty.zip.javadocExtracted" >
<mkdir dir="./build" />
<mkdir dir="./build/javadoc" />
<unzip src="${jetty.filename}" dest="./build/javadoc" >
<patternset>
2010-01-31 05:06:50 +00:00
<include name="${jetty.base}/javadoc/" />
</patternset>
2010-01-31 05:06:50 +00:00
<mapper type="glob" from="${jetty.base}/javadoc/*" to="javadoc/*" />
</unzip>
</target>
</project>