source: apps/jetty/build.xml @ ed443fe

Last change on this file since ed443fe was ed443fe, checked in by zzz <zzz@…>, 11 years ago

jetty 5.1.15

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