source: apps/jetty/build.xml @ 6606c83

Last change on this file since 6606c83 was 6606c83, checked in by complication <complication@…>, 12 years ago

2008-03-09 Complication

  • Give the Jetty build file ability to ask permission before downloading the Jetty archive from the web, and to verify its SHA1 + MD5 hashes. Adjust the main build file in accordance with this change.
  • Improve the release checklist.
  • Property mode set to 100644
File size: 4.0 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://mesh.dl.sourceforge.net/sourceforge/jetty/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="ensureJettylib" />
84    <target name="builddep" />
85    <target name="compile" />
86    <target name="jar" />
87    <target name="clean" />
88    <target name="cleandep" depends="clean" />
89    <target name="distclean" depends="clean">
90        <echo message="Not actually deleting the jetty libs (since they're so large)" />
91    </target>
92</project>
Note: See TracBrowser for help on using the repository browser.