Ignore:
Timestamp:
Mar 8, 2008 8:37:45 PM (12 years ago)
Author:
complication <complication@…>
Branches:
master
Children:
b1beb46c
Parents:
cffcbe5
Message:

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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/jetty/build.xml

    rcffcbe5 r6606c83  
    11<?xml version="1.0" encoding="UTF-8"?>
    22<project basedir="." default="all" name="jetty">
    3        
     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
    49    <target name="all" depends="build" />
    5     <target name="fetchJettylib" >
    6         <available property="jetty.zip.available" file="jetty-5.1.12.zip" type="file" />
     10
     11    <target name="ensureJettylib" >
     12        <available property="jetty.zip.available" file="${jetty.filename}" type="file" />
    713        <available property="jetty.zip.extracted" file="jettylib" type="dir" />
    8         <ant target="doFetchJettylib" />
    9         <ant target="doExtractJettylib" />
     14        <ant target="fetchJettylib" />
     15        <ant target="verifyJettylib" />
     16        <ant target="extractJettylib" />
    1017    </target>
    11     <target name="doFetchJettylib" unless="jetty.zip.available" >
    12         <echo message="The libraries contained within the fetched file are from Jetty's 5.1.12" />
    13         <echo message="distribution (http://jetty.mortbay.org/).  These are not " />
    14         <echo message="necessary for using I2P, but are used by some applications on top of I2P," />
    15         <echo message="such as the routerconsole." />
    16         <get src="http://mesh.dl.sourceforge.net/sourceforge/jetty/jetty-5.1.12.zip" verbose="true" dest="jetty-5.1.12.zip" />
     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}" />
    1742    </target>
    18     <target name="doExtractJettylib" unless="jetty.zip.extracted" >
    19         <ant target="doExtract" />
     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>
    2058    </target>
    21     <target name="doExtract">
    22         <unzip src="jetty-5.1.12.zip" dest="." />
     59
     60    <target name="extractJettylib" unless="jetty.zip.extracted" >
     61        <unzip src="${jetty.filename}" dest="." />
    2362        <mkdir dir="jettylib" />
    2463        <copy todir="jettylib">
     
    3170                <include name="ant.jar" />
    3271                <include name="commons-el.jar" />
    33                 <include name="commons-logging.jar" />
     72                <include name="commons-logging.jar" />
    3473                <include name="jasper-compiler.jar" />
    3574                <include name="jasper-runtime.jar" />
     
    4180        <delete dir="jetty-5.1.12" />
    4281    </target>
    43     <target name="build" depends="fetchJettylib" />
     82
     83    <target name="build" depends="ensureJettylib" />
    4484    <target name="builddep" />
    4585    <target name="compile" />
Note: See TracChangeset for help on using the changeset viewer.