source: apps/jetty/build.xml @ 9f57be5

Last change on this file since 9f57be5 was 9f57be5, checked in by zzz <zzz@…>, 12 years ago
  • Jetty: Add a I2PRequestLog class to log request dest hash
  • Property mode set to 100644
File size: 5.4 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<project basedir="." default="all" name="jetty">
3
4    <property name="jetty.sha1" value="021164f84da7304bd1ff07c268b45aa3e0b13322" />
5    <property name="jetty.md5" value="a61adc832be6baf2678935506743cfc3" />
6    <property name="jetty.url" value="http://dist.codehaus.org/jetty/jetty-5.1.x/jetty-5.1.12.zip" />
7    <property name="jetty.filename" value="jetty-5.1.12.zip" />
8
9    <target name="all" depends="build" />
10
11    <target name="ensureJettylib" >
12        <available property="jetty.zip.available" file="${jetty.filename}" type="file" />
13        <available property="jetty.zip.extracted" file="jettylib" type="dir" />
14        <ant target="fetchJettylib" />
15        <ant target="verifyJettylib" />
16        <ant target="extractJettylib" />
17    </target>
18
19    <target name="fetchJettylib" unless="jetty.zip.available" >
20        <echo message="It seems that you don't have '${jetty.filename}' deployed." />
21        <echo message="The build script can download this file for you automatically," />
22        <echo message="or alternatively you can obtain it manually from:" />
23        <echo message="${jetty.url}" />
24        <echo message="" />
25        <echo message="The libraries contained in the fetched file provide the Jetty web server" />
26        <echo message="(http://jetty.mortbay.org/). They are not absolutely necessary" />
27        <echo message="but strongly recommended, since they are used by some applications" />
28        <echo message="on top of I2P, like the router console." />
29        <echo message="" />
30        <echo message="Even if you deploy the Jetty archive manually, the build script will" />
31        <echo message="still attempt to verify its checksums, which must be:" />
32        <echo message="SHA1 ${jetty.sha1}" />
33        <echo message="MD5 ${jetty.md5}" />
34        <echo message="" />
35        <input message="Download Jetty archive automatically?" validargs="y,n" addproperty="jetty.download" />
36        <fail message="Aborting as requested. Please deploy the Jetty archive manually." >
37            <condition>
38                <equals arg1="${jetty.download}" arg2="n"/>
39            </condition>
40        </fail>
41        <get src="${jetty.url}" verbose="true" dest="${jetty.filename}" />
42    </target>
43
44    <target name="verifyJettylib" >
45        <condition property="jetty.zip.verified" >
46            <and>
47                <checksum file="${jetty.filename}" algorithm="SHA" property="${jetty.sha1}" />
48                <checksum file="${jetty.filename}" algorithm="MD5" property="${jetty.md5}" />
49            </and>
50        </condition>
51        <fail message="Jetty archive does not match its checksums!" >
52            <condition>
53                <not>
54                    <istrue value="${jetty.zip.verified}" />
55                </not>
56            </condition>
57        </fail>
58    </target>
59
60    <target name="extractJettylib" unless="jetty.zip.extracted" >
61        <unzip src="${jetty.filename}" dest="." />
62        <mkdir dir="jettylib" />
63        <copy todir="jettylib">
64            <fileset dir="jetty-5.1.12/lib">
65                <include name="*.jar" />
66            </fileset>
67        </copy>
68        <copy todir="jettylib">
69            <fileset dir="jetty-5.1.12/ext">
70                <include name="ant.jar" />
71                <include name="commons-el.jar" />
72                <include name="commons-logging.jar" />
73                <include name="jasper-compiler.jar" />
74                <include name="jasper-runtime.jar" />
75                <include name="javax.servlet.jar" />
76                <include name="org.mortbay.jetty.jar" />
77                <include name="xercesImpl.jar" />
78            </fileset>
79        </copy>
80        <delete dir="jetty-5.1.12" />
81    </target>
82
83    <target name="build" depends="jar" />
84    <target name="builddep" />
85    <target name="compile" depends="builddep, ensureJettylib" >
86        <mkdir dir="./build" />
87        <mkdir dir="./build/obj" />
88        <javac 
89            srcdir="./java/src" 
90            debug="true" deprecation="on" source="1.5" target="1.5" 
91            destdir="./build/obj" 
92            classpath="./jettylib/commons-logging.jar:./jettylib/javax.servlet.jar:./jettylib/org.mortbay.jetty.jar" />
93    </target>
94    <target name="jar" depends="compile">
95        <jar destfile="./jettylib/org.mortbay.jetty.jar" basedir="./build/obj" includes="**/*.class" update="true" >
96        </jar>
97    </target>   
98    <target name="clean" >
99        <delete dir="./build" />
100    </target>   
101    <target name="cleandep" depends="clean" />
102    <target name="distclean" depends="clean">
103        <echo message="Not actually deleting the jetty libs (since they're so large)" />
104    </target>
105    <target name="javadoc" >
106        <available property="jetty.zip.available" file="${jetty.filename}" type="file" />
107        <available property="jetty.zip.javadocExtracted" file="build/javadoc" type="dir" />
108        <ant target="fetchJettylib" />
109        <ant target="verifyJettylib" />
110        <ant target="extractJavadoc" />
111    </target>
112    <target name="extractJavadoc" unless="jetty.zip.javadocExtracted" >
113        <mkdir dir="./build" />
114        <mkdir dir="./build/javadoc" />
115        <unzip src="${jetty.filename}" dest="./build/javadoc" >
116            <patternset>
117                <include name="jetty-5.1.12/javadoc/" />
118            </patternset>
119            <mapper type="glob" from="jetty-5.1.12/javadoc/*" to="javadoc/*" />
120        </unzip>
121    </target>
122
123</project>
Note: See TracBrowser for help on using the repository browser.