source: build.xml @ bd78a66

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

updated build proc to conditionally fetch the jetty libs from http://dev.i2p.net/jettylib.tar.bz2
now the main ant 'dist' will build the web stuff as well (but ant 'build' wont)

  • Property mode set to 100644
File size: 8.6 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<project basedir="." default="all" name="i2p">
3    <available property="jettylib.available" file="apps/jetty/jettylib" />
4   
5    <target name="all" >
6        <echo message="Useful targets: " />
7        <echo message="  build:     build existing code into ./build/, but dont clean" />
8        <echo message="  javadoc:   generate javadoc for the entire project into ./build/javadoc" />
9        <echo message="  clean:     clean up the ./build/ dir" />
10        <echo message="  distclean: clean up all derived files" />
11        <echo message="  dist:      distclean, then build and javadoc (including the web app and associated libs)" />
12        <echo message="  prepGUI:   pull the LGPL and APL code for JFreeChart that we use in the GUIs" />
13        <echo message="  buildGUI:  build the heartbeat and netmonitor GUIs (must have run prepGUI already)" />
14        <echo message="  prepWEB:   pull down the Jetty libraries and whatever they depend on for the router console web application" />
15        <echo message="  buildWEB:  build the router console web application (depends upon prepWEB)" />
16    </target>
17    <target name="dist" depends="distclean, build, buildWEB, javadoc" />
18    <target name="build" depends="builddep, jar" />
19    <target name="buildclean" depends="distclean, build" />
20    <target name="builddep">
21        <!-- build *everything* here, but only once -->
22        <ant dir="core/java/" target="jar" />
23        <ant dir="router/java/" target="jar" />
24        <ant dir="apps/ministreaming/java/" target="jar" />
25        <ant dir="apps/i2ptunnel/java/" target="jar" />
26        <ant dir="apps/httptunnel/java/" target="jar" />
27        <ant dir="apps/phttprelay/java/" target="jar" />
28        <ant dir="apps/sam/java/" target="jar" />
29        <ant dir="apps/heartbeat/java/" target="jar" />
30        <ant dir="apps/netmonitor/java/" target="jar" />
31        <ant dir="apps/time/java/" target="jar" />
32        <ant dir="apps/routerconsole/java/" target="jar" />
33        <ant dir="installer/java/" target="jar" />
34    </target>
35    <target name="compile" />
36    <target name="jar" depends="compile" >
37        <copy file="core/java/build/i2p.jar" todir="build/" />
38        <copy file="router/java/build/router.jar" todir="build/" />
39        <copy file="apps/ministreaming/java/build/mstreaming.jar" todir="build/" />
40        <copy file="apps/i2ptunnel/java/build/i2ptunnel.jar" todir="build/" />
41        <copy file="apps/httptunnel/java/build/httptunnel.jar" todir="build/" />
42        <copy file="apps/phttprelay/java/build/phttprelay.war" todir="build/" />
43        <copy file="apps/sam/java/build/sam.jar" todir="build/" />
44        <copy file="apps/heartbeat/java/build/heartbeat.jar" todir="build/" />
45        <copy file="apps/netmonitor/java/build/netmonitor.jar" todir="build/" />
46        <copy file="apps/time/java/build/timestamper.jar" todir="build/" />
47        <copy file="installer/java/build/install.jar" todir="build/" />
48        <copy file="installer/java/build/guiinstall.jar" todir="build/" />
49        <copy file="installer/java/build/fetchseeds.jar" todir="build/" />
50    </target>
51    <target name="javadoc">
52        <mkdir dir="./build" />
53        <mkdir dir="./build/javadoc" />
54        <javadoc 
55            sourcepath="core/java/src:core/java/test:router/java/src:router/java/test:apps/ministreaming/java/src:apps/i2ptunnel/java/src:apps/httptunnel/java/src:apps/routerconsole/java/src" 
56            classpath="apps/jetty/jettylib/org.mortbay.jetty.jar" 
57            destdir="./build/javadoc" 
58            packagenames="*" 
59            use="true" 
60            splitindex="true" 
61            windowtitle="I2P" />
62    </target>
63    <target name="clean">
64        <delete dir="./build" />
65    </target>
66    <target name="distclean" depends="clean">
67        <ant dir="core/java/" target="distclean" />
68        <ant dir="router/java/" target="distclean" />
69        <ant dir="apps/ministreaming/java/" target="distclean" />
70        <ant dir="apps/i2ptunnel/java/" target="distclean" />
71        <ant dir="apps/httptunnel/java/" target="distclean" />
72        <ant dir="apps/phttprelay/java/" target="distclean" />
73        <ant dir="apps/sam/java/" target="distclean" />
74        <ant dir="apps/heartbeat/java/" target="distclean" />
75        <ant dir="apps/netmonitor/java/" target="distclean" />
76        <ant dir="apps/routerconsole/java/" target="distclean" />
77        <ant dir="apps/time/java/" target="distclean" />
78        <ant dir="installer/java/" target="distclean" />
79        <delete>
80            <fileset dir="." includes="**/*.class" />
81            <fileset dir="." includes="**/*.java~" />
82        </delete>
83    </target>
84    <target name="distGUI" depends="clean, buildGUI">
85        <mkdir dir="build/lib" />
86        <copy file="apps/jfreechart/jfreechart-0.9.17/jfreechart-0.9.17.jar" todir="build/lib" />
87        <copy file="apps/jfreechart/jfreechart-0.9.17/lib/log4j-1.2.8.jar" todir="build/lib" />
88        <copy file="apps/jfreechart/jfreechart-0.9.17/lib/jcommon-0.9.2.jar" todir="build/lib" />
89        <copy file="apps/jfreechart/GUI-licenses.txt" todir="build/" />
90        <copy file="apps/netmonitor/java/build/netviewer.jar" todir="build/lib" />
91        <copy file="apps/heartbeat/java/build/heartbeatGUI.jar" todir="build/lib" />
92        <zip destfile="build/gui.zip" basedir="build/" includes="GUI-licenses.txt lib/*.jar" />
93    </target>
94    <target name="prepGUI">
95        <echo message="The code being fetched comes from http://www.jfree.org/jfreechart/" />
96        <echo message="It includes code licensed under the LGPL and the APL - please see" />
97        <echo message="the JFreeChart site (or the info downloaded) for source and details" />
98        <ant dir="apps/jfreechart/" target="fetchJfreechart" />
99        <ant dir="apps/jfreechart/" target="build" />
100    </target>
101    <target name="buildGUI">
102        <echo message="Building the GUIs for the heartbeat and netmonitor apps, which depend upon" />
103        <echo message="the JFreeChart and related packages.  The following will fail if you haven't" />
104        <echo message="already run 'ant prepGUI' to fetch the LGPL/APL'ed code" />
105        <ant dir="apps/heartbeat/java" target="buildGUI" />
106        <ant dir="apps/netmonitor/java" target="buildGUI" />
107        <copy file="apps/jfreechart/jfreechart-0.9.17/jfreechart-0.9.17.jar" todir="build/" />
108        <copy file="apps/jfreechart/jfreechart-0.9.17/lib/log4j-1.2.8.jar" todir="build/" />
109        <copy file="apps/jfreechart/jfreechart-0.9.17/lib/jcommon-0.9.2.jar" todir="build/" />
110        <copy file="apps/jfreechart/GUI-licenses.txt" todir="build/" />
111        <copy file="apps/netmonitor/java/build/netviewer.jar" todir="build/" />
112        <copy file="apps/heartbeat/java/build/heartbeatGUI.jar" todir="build/" />
113        <echo message="GUIs created.  You will need the following files to run them: " />
114        <echo message="jfreechart-0.9.17.jar log4j-1.2.8.jar jcommon-0.9.2.jar" />
115        <echo message="To run the netmonitor GUI: java -cp jfreechart-0.9.17.jar:log4j-1.2.8.jar:jcommon-0.9.2.jar -jar netviewer.jar" />
116        <echo message="To run the heartbeat GUI: java -cp jfreechart-0.9.17.jar:log4j-1.2.8.jar:jcommon-0.9.2.jar -jar heartbeatGUI.jar" />
117    </target>
118    <target name="prepWEB">
119        <ant dir="apps/jetty" target="fetchJettylib" />
120    </target>
121    <target name="buildWEB" if="jettylib.available">
122        <ant dir="apps/routerconsole/java" target="build" />
123        <copy file="apps/routerconsole/java/build/routerconsole.jar" todir="build/" />
124        <copy file="apps/routerconsole/java/build/routerconsole.war" todir="build/" />
125        <copy file="apps/jetty/jettylib/org.mortbay.jetty.jar" todir="build/" />
126        <copy file="apps/jetty/jettylib/org.mortbay.jetty-jdk1.2.jar" todir="build/" />
127        <copy file="apps/jetty/jettylib/ant.jar" todir="build/" />
128        <copy file="apps/jetty/jettylib/jasper-compiler.jar" todir="build/" />
129        <copy file="apps/jetty/jettylib/jasper-runtime.jar" todir="build/" />
130        <copy file="apps/jetty/jettylib/jnet.jar" todir="build/" />
131        <copy file="apps/jetty/jettylib/xercesImpl.jar" todir="build/" />
132        <copy file="apps/jetty/jettylib/xml-apis.jar" todir="build/" />
133        <copy file="apps/jetty/jettylib/javax.servlet.jar" todir="build/" />
134        <echo message="You will need the org.*, ant.jar, jasper-*.jar, jnet.jar, xercesImpl.jar, xml-apis.jar, " />
135        <echo message="and routerconsole.jar in your router's classpath.  In addition, you will need to place the " />
136        <echo message="routerconsole.war file under your i2p install dir as webapps/routerconsole.war and will want " />
137        <echo message="to add the RouterConsoleRunner to the router's clientApp list (it must be in the router's JVM)" />
138    </target>
139</project>
Note: See TracBrowser for help on using the repository browser.