source: build.xml @ d70c22d7

Last change on this file since d70c22d7 was d70c22d7, checked in by zzz <zzz@…>, 16 years ago
  • systray now fully integrated into global ant build
  • removed two unneeded test files i2psystray.bat, i2psystray.sh
  • Property mode set to 100644
File size: 14.1 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<project basedir="." default="all" name="i2p">
3   
4    <target name="all" >
5        <echo message="Useful targets: " />
6        <echo message="  build:     build existing code into ./build/, but dont clean" />
7        <echo message="  javadoc:   generate javadoc for the entire project into ./build/javadoc" />
8        <echo message="  clean:     clean up the ./build/ dir" />
9        <echo message="  distclean: clean up all derived files" />
10        <echo message="  dist:      distclean, then build and javadoc (including the web app and associated libs)" />
11        <echo message="  prepGUI:   pull the LGPL and APL code for JFreeChart that we use in the GUIs" />
12        <echo message="  buildGUI:  build the heartbeat and netmonitor GUIs (must have run prepGUI already)" />
13        <echo message="  buildWEB:  build the router console web application" />
14        <echo message="  pkg:       make the tarball and installer jar (depends upon preppkg)" />
15        <echo message="  pkgclean:  delete the ./pkg-temp/ dir, tarball and installer jar" />
16        <echo message="  preppkg:   gather built files for tarball and installer" />
17        <echo message="  tarball:   tar the built files and compress with bz2 (depends upon preppkg)" />
18        <echo message="  installer: build the GUI installer (depends upon preppkg)" />
19    </target>
20    <target name="dist" depends="distclean, build, buildWEB, javadoc">
21        <delete dir="build/lib" />
22        <delete dir="build/webapps" />
23        <mkdir dir="build/lib" />
24
25        <copy file="core/java/build/i2p.jar" todir="build/lib" />
26        <copy file="router/java/build/router.jar" todir="build/lib" />
27        <copy file="apps/ministreaming/java/build/mstreaming.jar" todir="build/lib" />
28        <copy file="apps/i2ptunnel/java/build/i2ptunnel.jar" todir="build/lib" />
29        <copy file="apps/sam/java/build/sam.jar" todir="build/lib" />
30        <copy file="apps/heartbeat/java/build/heartbeat.jar" todir="build/lib" />
31        <copy file="apps/netmonitor/java/build/netmonitor.jar" todir="build/lib" />
32        <copy file="installer/java/build/fetchseeds.jar" todir="build/lib" />
33        <tar compression="bzip2" destfile="build/lib.tar.bz2">
34            <tarfileset dir="build" includes="lib/*" />
35        </tar>
36
37        <delete dir="build/lib" />
38        <delete dir="build/webapps" />
39        <mkdir dir="build/lib" />
40        <mkdir dir="build/webapps" />
41
42        <copy file="apps/i2ptunnel/java/build/i2ptunnel.war" todir="build/webapps" />
43        <copy file="apps/routerconsole/java/build/routerconsole.war" todir="build/webapps" />
44        <copy file="apps/routerconsole/java/build/routerconsole.jar" todir="build/lib" />
45        <tar compression="bzip2" destfile="build/webapps.tar.bz2">
46            <tarfileset dir="build" includes="lib/* webapps/*" />
47        </tar>
48
49        <delete dir="build/lib" />
50        <delete dir="build/webapps" />
51        <mkdir dir="build/lib" />
52
53        <copy file="apps/jetty/jettylib/org.mortbay.jetty.jar" todir="build/lib" />
54        <copy file="apps/jetty/jettylib/org.mortbay.jetty-jdk1.2.jar" todir="build/lib" />
55        <copy file="apps/jetty/jettylib/ant.jar" todir="build/lib" />
56        <copy file="apps/jetty/jettylib/jasper-compiler.jar" todir="build/lib" />
57        <copy file="apps/jetty/jettylib/jasper-runtime.jar" todir="build/lib" />
58        <copy file="apps/jetty/jettylib/jnet.jar" todir="build/lib" />
59        <copy file="apps/jetty/jettylib/xercesImpl.jar" todir="build/lib" />
60        <copy file="apps/jetty/jettylib/xml-apis.jar" todir="build/lib" />
61        <copy file="apps/jetty/jettylib/javax.servlet.jar" todir="build/lib" />
62        <tar compression="bzip2" destfile="build/weblib.tar.bz2">
63            <tarfileset dir="build" includes="lib/*" />
64        </tar>
65       
66    </target>
67    <target name="build" depends="builddep, jar, buildWEB" />
68    <target name="buildclean" depends="distclean, build" />
69    <target name="builddep">
70        <!-- build *everything* here, but only once -->
71        <ant dir="core/java/" target="jar" />
72        <ant dir="router/java/" target="jar" />
73        <ant dir="apps/ministreaming/java/" target="jar" />
74        <ant dir="apps/i2ptunnel/java/" target="jar" />
75        <ant dir="apps/sam/java/" target="jar" />
76        <ant dir="apps/heartbeat/java/" target="jar" />
77        <ant dir="apps/netmonitor/java/" target="jar" />
78        <ant dir="apps/systray/java/" target="jar" />
79        <ant dir="apps/routerconsole/java/" target="jar" />
80        <ant dir="installer/java/" target="jar" />
81    </target>
82    <target name="compile" />
83    <target name="jar" depends="compile" >
84        <copy file="core/java/build/i2p.jar" todir="build/" />
85        <copy file="router/java/build/router.jar" todir="build/" />
86        <copy file="apps/ministreaming/java/build/mstreaming.jar" todir="build/" />
87        <copy file="apps/i2ptunnel/java/build/i2ptunnel.jar" todir="build/" />
88        <copy file="apps/i2ptunnel/java/build/i2ptunnel.war" todir="build/" />
89        <copy file="apps/sam/java/build/sam.jar" todir="build/" />
90        <copy file="apps/heartbeat/java/build/heartbeat.jar" todir="build/" />
91        <copy file="apps/netmonitor/java/build/netmonitor.jar" todir="build/" />
92        <copy file="apps/systray/java/build/systray.jar" todir="build/" />
93        <copy file="installer/java/build/install.jar" todir="build/" />
94        <copy file="installer/java/build/guiinstall.jar" todir="build/" />
95        <copy file="installer/java/build/fetchseeds.jar" todir="build/" />
96        <copy file="installer/lib/jbigi/jbigi.jar" todir="build" />
97    </target>
98    <target name="javadoc">
99        <mkdir dir="./build" />
100        <mkdir dir="./build/javadoc" />
101        <javadoc 
102            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/systray/java/src:apps/routerconsole/java/src" 
103            classpath="apps/jetty/jettylib/org.mortbay.jetty.jar:apps/systray/java/lib/systray4j.jar:installer/lib/wrapper/win32/wrapper.jar" 
104            destdir="./build/javadoc" 
105            packagenames="*" 
106            use="true" 
107            splitindex="true" 
108            windowtitle="I2P" />
109    </target>
110    <target name="clean" depends="pkgclean" >
111        <delete dir="./build" />
112    </target>
113    <target name="distclean" depends="clean">
114        <ant dir="core/java/" target="distclean" />
115        <ant dir="router/java/" target="distclean" />
116        <ant dir="apps/ministreaming/java/" target="distclean" />
117        <ant dir="apps/i2ptunnel/java/" target="distclean" />
118        <ant dir="apps/sam/java/" target="distclean" />
119        <ant dir="apps/heartbeat/java/" target="distclean" />
120        <ant dir="apps/netmonitor/java/" target="distclean" />
121        <ant dir="apps/routerconsole/java/" target="distclean" />
122        <ant dir="apps/systray/java/" target="distclean" />
123        <ant dir="installer/java/" target="distclean" />
124        <delete>
125            <fileset dir="." includes="**/*.class" />
126            <fileset dir="." includes="**/*.java~" />
127        </delete>
128    </target>
129    <target name="distGUI" depends="clean, buildGUI">
130        <mkdir dir="build/lib" />
131        <copy file="apps/jfreechart/jfreechart-0.9.17/jfreechart-0.9.17.jar" todir="build/lib" />
132        <copy file="apps/jfreechart/jfreechart-0.9.17/lib/log4j-1.2.8.jar" todir="build/lib" />
133        <copy file="apps/jfreechart/jfreechart-0.9.17/lib/jcommon-0.9.2.jar" todir="build/lib" />
134        <copy file="apps/jfreechart/GUI-licenses.txt" todir="build/" />
135        <copy file="apps/netmonitor/java/build/netviewer.jar" todir="build/lib" />
136        <copy file="apps/heartbeat/java/build/heartbeatGUI.jar" todir="build/lib" />
137        <zip destfile="build/gui.zip" basedir="build/" includes="GUI-licenses.txt lib/*.jar" />
138    </target>
139    <target name="prepGUI">
140        <echo message="The code being fetched comes from http://www.jfree.org/jfreechart/" />
141        <echo message="It includes code licensed under the LGPL and the APL - please see" />
142        <echo message="the JFreeChart site (or the info downloaded) for source and details" />
143        <ant dir="apps/jfreechart/" target="fetchJfreechart" />
144        <ant dir="apps/jfreechart/" target="build" />
145    </target>
146    <target name="buildGUI">
147        <echo message="Building the GUIs for the heartbeat and netmonitor apps, which depend upon" />
148        <echo message="the JFreeChart and related packages.  The following will fail if you haven't" />
149        <echo message="already run 'ant prepGUI' to fetch the LGPL/APL'ed code" />
150        <ant dir="apps/heartbeat/java" target="buildGUI" />
151        <ant dir="apps/netmonitor/java" target="buildGUI" />
152        <copy file="apps/jfreechart/jfreechart-0.9.17/jfreechart-0.9.17.jar" todir="build/" />
153        <copy file="apps/jfreechart/jfreechart-0.9.17/lib/log4j-1.2.8.jar" todir="build/" />
154        <copy file="apps/jfreechart/jfreechart-0.9.17/lib/jcommon-0.9.2.jar" todir="build/" />
155        <copy file="apps/jfreechart/GUI-licenses.txt" todir="build/" />
156        <copy file="apps/netmonitor/java/build/netviewer.jar" todir="build/" />
157        <copy file="apps/heartbeat/java/build/heartbeatGUI.jar" todir="build/" />
158        <echo message="GUIs created.  You will need the following files to run them: " />
159        <echo message="jfreechart-0.9.17.jar log4j-1.2.8.jar jcommon-0.9.2.jar" />
160        <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" />
161        <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" />
162    </target>
163    <target name="prepWEB">
164        <ant dir="apps/jetty" target="fetchJettylib" />
165    </target>
166    <target name="buildWEB" depends="prepWEB" >
167        <available property="jettylib.available" file="apps/jetty/jettylib" />
168        <ant target="doBuildWEB" />
169    </target>
170    <target name="doBuildWEB" if="jettylib.available">
171        <ant dir="apps/routerconsole/java" target="build" />
172        <copy file="apps/routerconsole/java/build/routerconsole.jar" todir="build/" />
173        <copy file="apps/routerconsole/java/build/routerconsole.war" todir="build/" />
174        <copy file="apps/jetty/jettylib/org.mortbay.jetty.jar" todir="build/" />
175        <copy file="apps/jetty/jettylib/org.mortbay.jetty-jdk1.2.jar" todir="build/" />
176        <copy file="apps/jetty/jettylib/ant.jar" todir="build/" />
177        <copy file="apps/jetty/jettylib/jasper-compiler.jar" todir="build/" />
178        <copy file="apps/jetty/jettylib/jasper-runtime.jar" todir="build/" />
179        <copy file="apps/jetty/jettylib/jnet.jar" todir="build/" />
180        <copy file="apps/jetty/jettylib/xercesImpl.jar" todir="build/" />
181        <copy file="apps/jetty/jettylib/xml-apis.jar" todir="build/" />
182        <copy file="apps/jetty/jettylib/javax.servlet.jar" todir="build/" />
183        <echo message="You will need the org.*, ant.jar, jasper-*.jar, jnet.jar, xercesImpl.jar, xml-apis.jar, " />
184        <echo message="and routerconsole.jar in your router's classpath.  In addition, you will need to place the " />
185        <echo message="routerconsole.war file under your i2p install dir as webapps/routerconsole.war and will want " />
186        <echo message="to add the RouterConsoleRunner to the router's clientApp list (it must be in the router's JVM)" />
187    </target>
188    <target name="pkg" depends="tarball, installer" />
189    <target name="pkgclean">
190        <delete dir="pkg-temp" />
191        <delete>
192            <fileset dir="." includes="i2p.tar.bz2 install.jar" />
193        </delete>
194    </target>
195    <target name="preppkg" depends="build, buildWEB">
196        <copy file="build/ant.jar" todir="pkg-temp/lib/" />
197        <copy file="build/heartbeat.jar" todir="pkg-temp/lib/" />
198        <copy file="build/i2p.jar" todir="pkg-temp/lib/" />
199        <copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
200        <copy file="build/jasper-compiler.jar" todir="pkg-temp/lib/" />
201        <copy file="build/jasper-runtime.jar" todir="pkg-temp/lib/" />
202        <copy file="build/javax.servlet.jar" todir="pkg-temp/lib/" />
203        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
204        <copy file="build/jnet.jar" todir="pkg-temp/lib/" />
205        <copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
206        <copy file="build/netmonitor.jar" todir="pkg-temp/lib/" />
207        <copy file="build/org.mortbay.jetty-jdk1.2.jar" todir="pkg-temp/lib/" />
208        <copy file="build/org.mortbay.jetty.jar" todir="pkg-temp/lib/" />
209        <copy file="build/router.jar" todir="pkg-temp/lib/" />
210        <copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
211        <copy file="build/sam.jar" todir="pkg-temp/lib/" />
212        <copy file="build/systray.jar" todir="pkg-temp/lib" />
213        <copy file="apps/systray/java/lib/systray4j.jar" todir="pkg-temp/lib" />
214        <copy file="apps/systray/java/lib/systray4j.dll" todir="pkg-temp/lib" />
215        <copy file="apps/systray/java/resources/iggy.ico" todir="pkg-temp/icons" />
216        <copy file="apps/systray/java/resources/iggy.xpm" todir="pkg-temp/icons" />
217        <copy file="build/xercesImpl.jar" todir="pkg-temp/lib/" />
218        <copy file="build/xml-apis.jar" todir="pkg-temp/lib/" />
219        <copy file="build/i2ptunnel.war" todir="pkg-temp/webapps/" />
220        <copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
221        <copy file="hosts.txt" todir="pkg-temp/" />
222        <copy file="installer/resources/i2ptunnel.config" todir="pkg-temp/" />
223        <copy file="installer/resources/clients.config" todir="pkg-temp/" />
224        <copy file="readme.txt" todir="pkg-temp/" />
225    </target>
226    <target name="tarball" depends="preppkg">
227        <tar compression="bzip2" destfile="i2p.tar.bz2">
228            <tarfileset dir="pkg-temp" includes="**/*" prefix="i2p" />
229        </tar>
230    </target>
231    <taskdef name="izpack" classpath="${basedir}/installer/lib/izpack/standalone-compiler.jar" classname="com.izforge.izpack.ant.IzPackTask" />
232    <target name="installer" depends="preppkg">
233        <izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
234    </target>
235</project>
Note: See TracBrowser for help on using the repository browser.