Files
i2p.itoopie/apps/pants/pbuilds/jetty/pbuild.xml
smeghead 293ceaee93 2005-02-10 smeghead
* Initial check-in of Pants, a new utility to help us manage our 3rd-party
      dependencies (Fortuna, Jetty, Java Service Wrapper, etc.). Some parts of
      Pants are still non-functional at this time so don't mess with it yet
      unless you want to potentially mangle your working copy of CVS.
2005-02-11 02:44:47 +00:00

90 lines
3.8 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="all" name="jetty">
<!-- make this generic, place variables in properties file -->
<target name="all" depends="build"
description="Run the build target" />
<target name="assignProperties" if="group.0">
<property name="latest.jetty.version" value="${group.1}" />
<available property="jetty.package.available" file="jetty-${latest.jetty.version}.zip" />
<available property="jetty.package.unpacked.available" file="jettypkg/jetty-${latest.jetty.version}" />
<echo message="Properties assigned" />
</target>
<target name="build" depends="init, unpackJettyPackage" if="latest.jetty.version"
description="Download latest Jetty package and copy needed libs to jettylib/">
<property name="unpack.dir" value="jettypkg/jetty-${latest.jetty.version}" />
<copy todir="jettylib" overwrite="true" file="${unpack.dir}/ext/ant.jar" />
<copy todir="jettylib" overwrite="true" file="${unpack.dir}/ext/jasper-compiler.jar" />
<copy todir="jettylib" overwrite="true" file="${unpack.dir}/ext/jasper-runtime.jar" />
<copy todir="jettylib" overwrite="true" file="${unpack.dir}/ext/xercesImpl.jar" />
<copy todir="jettylib" overwrite="true" file="${unpack.dir}/ext/xml-apis.jar" />
<copy todir="jettylib" overwrite="true" file="${unpack.dir}/extra/lib/org.mortbay.jetty-jdk1.2.jar" />
<copy todir="jettylib" overwrite="true" file="${unpack.dir}/lib/javax.servlet.jar" />
<copy todir="jettylib" overwrite="true" file="${unpack.dir}/lib/org.mortbay.jetty.jar" />
<copy todir="jettylib" overwrite="true">
<fileset dir="${unpack.dir}/ext" includes="xmlParserAPIs*.jar" />
</copy>
</target>
<target name="builddep"
description="Build the custom helper Ant task for this buildfile">
<mkdir dir="java/build"/>
<javac srcdir="./java/src" source="1.3" target="1.3" deprecation="on" destdir="./java/build" />
</target>
<target name="clean"
description="Remove temp files and zip only; jettypkg/ requires manual deletion">
<echo message="Not actually deleting the Jetty package directory since it's so large" />
<delete>
<fileset dir="." includes="*.zip jettytemp.html parsed.temp" />
</delete>
</target>
<target name="cleandep"
description="Remove custom helper Ant task">
<delete dir="java/build" />
</target>
<target name="compile" />
<target name="distclean" depends="clean"
description="Remove temp files, zip and jettylib/ contents" >
<delete>
<fileset dir="jettylib" includes="*.jar"/>
</delete>
</target>
<target name="fetchJettyPackage" if="latest.jetty.version" unless="jetty.package.available">
<echo message="The Jetty libs are not necessary for using I2P, but are used by some" />
<echo message="applications on top of I2P such as the routerconsole." />
<get src="http://mesh.dl.sourceforge.net/sourceforge/jetty/jetty-${latest.jetty.version}.zip" verbose="true" dest="jetty-${latest.jetty.version}.zip" />
</target>
<target name="init" depends="builddep">
<echo message="Checking SourceForge for latest Jetty version....." />
<get src="http://sourceforge.net/projects/jetty/" dest="jettytemp.html" verbose="true" />
<taskdef name="match" classname="net.i2p.pants.MatchTask" classpath="../../lib/pants.jar" />
<match input="jettytemp.html"
output="parsed.temp"
regex="Stable.+?Jetty-(.+?)&lt;/A&gt;"
/>
<loadproperties srcFile="parsed.temp" />
<antcall target="assignProperties" />
</target>
<target name="jar" />
<target name="showlatest" depends="init"
description="Display latest version number for Jetty">
<echo message="Latest Jetty version: ${latest.jetty.version}" />
</target>
<target name="unpackJettyPackage" depends="fetchJettyPackage" if="latest.jetty.version" unless="jetty.package.unpacked.available">
<mkdir dir="jettypkg" />
<unzip src="jetty-${latest.jetty.version}.zip" dest="jettypkg" />
</target>
</project>