source: build.xml @ 0bef852

Last change on this file since 0bef852 was 0bef852, checked in by zzz <zzz@…>, 11 years ago

try to automate the release process

  • Property mode set to 100644
File size: 36.5 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<project basedir="." default="all" name="i2p">
3   
4    <!-- Things you might want to change -->
5    <!-- This keeps gcj a lot quieter -->
6    <!--
7        <property name="javac.compilerargs" value="-warn:-unchecked,raw,unused,serial" />
8    -->
9
10    <!-- You probably don't want to change anything from here down -->
11    <target name="all" >
12        <echo message="Useful targets: " />
13        <echo message="  pkg:       distclean then package everything up (installer, clean tarball, update tarball)" />
14        <echo message="  dist:      pkg and javadoc" />
15        <echo message="  installer: build the GUI installer" />
16        <echo message="  tarball:   tar the full install into i2p.tar.bz2 (extracts to build a new clean install)" />
17        <echo message="  updater:   tar the built i2p specific files into an i2pupdate.zip (extracts safely over existing installs)" />
18        <echo message="  updaterWithJetty:   tar the built i2p specific files and jetty into an i2pupdate.zip (extracts safely over existing installs)" />
19        <echo message="  updaterWithJettyFixes: updater including local jetty patches" />
20        <echo message="  updaterWithGeoIP: updater including GeoIP Files" />
21        <echo message="  updaterWithJettyFixesAndGeoIP" />
22        <echo message="  updaterSmall:   updater with the essentials only - no SAM, i2psnark, SusiMail, SusiDNS, news.xml, or history.txt" />
23        <echo message="  updaterRouter:  updater with the i2p.jar and router.jar only" />
24        <echo message="  distclean: clean up all derived files" />
25        <echo message="  syndie:    generate a standalone syndie install" />
26        <echo message="  i2psnark:  generate a standalone i2psnark install" />
27        <echo message="  javadoc:   generate javadoc for the entire project into ./build/javadoc" />
28        <echo message="  slackpkg:  generate Slackware packages in ./Slackware/i2p and ./Slackware/i2p-base" />
29        <echo message="  debianhowto: instructions on building Debian packages" />
30        <echo message="  updaterWithDesktopgui: tar the built files and desktopgui in an i2pupdate.zip" />
31        <echo message="  pkgWithDesktopgui: distclean then package everything up with the desktopgui" />
32        <echo message="  distWithDesktopgui: pkgWithDesktopgui and javadoc" />
33        <echo message="  distcleanWithDesktopgui: clean up all derived files (including desktopgui files)" />
34    </target>
35    <target name="debianhowto">
36        <echo message="To build debian packages, you must run dpkg-buildpackage as root in the source directory. It will then run ant for you. dpkg-buildpackage is found in the 'dpkg-dev' package. Also it should work fine to use the 'fakeroot' package with dpkg-buildpackage, if you don't want to run as root. Please read 'man dpkg-buildpackage' before building any packages yourself." />
37    </target>
38    <target name="dist" depends="pkg, javadoc">
39    </target>
40    <target name="build" depends="build2">
41        <!-- so we don't build standalone for the updater -->
42        <!-- This builds apps/i2psnark/java/i2psnark-standalone.zip,
43          -   which we don't distribute anywhere...
44        <ant dir="apps/i2psnark/java/" target="standalone" />
45        -->
46    </target>
47    <target name="build2" depends="builddep, jar, buildWEB" />
48    <target name="buildSmall" depends="builddepSmall, jarSmall, buildWEB" />
49    <target name="buildclean" depends="distclean, build" />
50    <target name="builddep" depends="builddepSmall">
51        <!-- build *everything* here, but only once -->
52        <ant dir="apps/BOB/" target="jar" />
53        <ant dir="apps/sam/java/" target="jar" />
54        <ant dir="apps/susimail/" target="war" />
55        <ant dir="apps/susidns/src" target="all" />
56        <ant dir="apps/i2psnark/java/" target="war" />
57    </target>
58    <target name="builddepSmall">
59        <ant dir="core/java/" target="jar" />
60        <ant dir="router/java/" target="jar" />
61        <ant dir="apps/ministreaming/java/" target="jar" />
62        <ant dir="apps/streaming/java/" target="jar" />
63        <ant dir="apps/i2ptunnel/java/" target="jar" />
64        <ant dir="apps/systray/java/" target="jar" />
65        <ant dir="apps/routerconsole/java/" target="jar" />
66        <ant dir="apps/addressbook/" target="war" />
67    </target>
68    <target name="buildrouter">
69        <ant dir="core/java/" target="jar" />
70        <ant dir="router/java/" target="jar" />
71        <copy file="core/java/build/i2p.jar" todir="build/" />
72        <copy file="router/java/build/router.jar" todir="build/" />
73    </target>
74    <target name="buildWEB">
75        <ant dir="apps/jetty" target="ensureJettylib" />
76        <ant dir="apps/routerconsole/java" target="build" />
77        <copy file="apps/routerconsole/java/build/routerconsole.jar" todir="build/" />
78        <copy file="apps/routerconsole/java/build/routerconsole.war" todir="build/" />
79        <copy file="apps/jetty/jettylib/org.mortbay.jetty.jar" todir="build/" />
80        <copy file="apps/jetty/jettylib/jasper-compiler.jar" todir="build/" />
81        <copy file="apps/jetty/jettylib/jasper-runtime.jar" todir="build/" />
82        <copy file="apps/jetty/jettylib/commons-logging.jar" todir="build/" />
83        <copy file="apps/jetty/jettylib/commons-el.jar" todir="build/" />
84        <copy file="apps/jetty/jettylib/javax.servlet.jar" todir="build/" />
85    </target>
86    <target name="buildexe">
87        <condition property="noExe">
88            <os arch="x86_64" />
89        </condition>
90        <condition property="noExe">
91            <os arch="ppc" />
92        </condition>
93        <condition property="noExe">
94            <os arch="amd64" />
95        </condition>
96        <condition property="noExe">
97           <not>
98            <or>
99             <os name="Linux" />
100             <os family="windows" />
101            </or>
102           </not>
103        </condition>
104        <ant target="doBuildEXE" />
105    </target>
106    <target name="doBuildEXE" unless="noExe">
107        <jar destfile="./build/launchi2p.jar">
108            <manifest>
109             <attribute name="Main-Class" value="net.i2p.router.RouterLaunch" />
110             <attribute name="Class-Path" value="lib/i2p.jar lib/router.jar lib/jbigi.jar lib/BOB.jar lib/sam.jar lib/mstreaming.jar lib/streaming.jar lib/routerconsole.jar lib/i2ptunnel.jar lib/org.mortbay.jetty.jar lib/javax.servlet.jar lib/jasper-compiler.jar lib/jasper-runtime.jar lib/commons-logging.jar lib/commons-el.jar lib/wrapper.jar lib/systray.jar lib/systray4j.jar" />
111            </manifest>
112        </jar>
113        <!-- now the standalone launcher exe -->
114        <taskdef name="launch4j"
115                 classname="net.sf.launch4j.ant.Launch4jTask"
116                 classpath="${basedir}/installer/lib/launch4j/launch4j.jar:${basedir}/installer/lib/launch4j/lib/xstream.jar" />
117        <launch4j configFile="./installer/i2pstandalone.xml" />
118        <!-- thazzit -->
119    </target>
120    <target name="compile" />
121    <target name="jar" depends="jarSmall" >
122        <copy file="apps/BOB/dist/BOB.jar" todir="build/" />
123        <copy file="apps/sam/java/build/sam.jar" todir="build/" />
124        <copy file="apps/susimail/susimail.war" todir="build/" />
125        <copy file="apps/susidns/src/susidns.war" todir="build/" />
126        <copy file="apps/i2psnark/i2psnark.war" todir="build/" />
127        <copy file="apps/i2psnark/java/build/i2psnark.jar" todir="build/" />
128    </target>
129    <target name="jarSmall" depends="compile" >
130        <copy file="core/java/build/i2p.jar" todir="build/" />
131        <copy file="router/java/build/router.jar" todir="build/" />
132        <copy file="apps/ministreaming/java/build/mstreaming.jar" todir="build/" />
133        <copy file="apps/streaming/java/build/streaming.jar" todir="build/" />
134        <copy file="apps/i2ptunnel/java/build/i2ptunnel.jar" todir="build/" />
135        <copy file="apps/i2ptunnel/java/build/i2ptunnel.war" todir="build/" />
136        <copy file="apps/systray/java/build/systray.jar" todir="build/" />
137        <copy file="installer/lib/jbigi/jbigi.jar" todir="build" />
138        <copy file="apps/addressbook/dist/addressbook.war" todir="build/" />
139    </target>
140    <target name="javadoc">
141        <mkdir dir="./build" />
142        <mkdir dir="./build/javadoc" />
143        <javadoc access="package" 
144            destdir="./build/javadoc" 
145            packagenames="*" 
146            use="true" 
147            group="SDK net.i2p:net.i2p.*:net.i2p.client:net.i2p.client.*:freenet.support.CPUInformation,
148                   Streaming net.i2p.client.streaming,
149                   BOB net.i2p.BOB,
150                   SAM net.i2p.sam:net.i2p.sam.client,
151                   RouterConsole net.i2p.router.web,
152                   Router net.i2p.router:net.i2p.router.*:net.i2p.data.i2np,
153                   Systray net.i2p.apps.systray,
154                   I2PTunnel net.i2p.i2ptunnel:net.i2p.i2ptunnel.*"
155            splitindex="true" 
156            windowtitle="I2P">
157            <sourcepath>
158                <pathelement location="core/java/src" />
159                <!--<pathelement location="core/java/test" />-->
160                <pathelement location="router/java/src" />
161                <!--<pathelement location="router/java/test" />-->
162                <pathelement location="apps/ministreaming/java/src" />
163                <pathelement location="apps/streaming/java/src" />
164                <pathelement location="apps/i2ptunnel/java/src" />
165                <pathelement location="apps/systray/java/src" />
166                <pathelement location="apps/routerconsole/java/src" />
167                <pathelement location="apps/addressbook/java/src" />
168                <pathelement location="apps/i2psnark/java/src" />
169                <pathelement location="apps/sam/java/src" />
170                <pathelement location="apps/BOB/src" />
171            </sourcepath>
172            <classpath>
173                <pathelement location="apps/jetty/jettylib/org.mortbay.jetty.jar" />
174                <pathelement location="apps/jetty/jettylib/javax.servlet.jar" />
175                <pathelement location="apps/systray/java/lib/systray4j.jar" />
176                <pathelement location="apps/jrobin/jrobin-1.4.0.jar" />
177                <pathelement location="installer/lib/wrapper/win32/wrapper.jar" />
178                <pathelement location="core/lib/junit.jar" />               
179            </classpath>
180        </javadoc>
181    </target>
182    <target name="clean" depends="pkgclean" >
183        <delete dir="./build" />
184        <delete file="i2pinstall.exe" failonerror="false" quiet="true" />       
185        <delete file="i2p.exe" failonerror="false" quiet="true" />
186        <delete file="syndie-standalone.zip" failonerror="false" quiet="true" />
187        <delete file="i2psnark-standalone.zip" failonerror="false" quiet="true" />
188    </target>
189    <target name="distclean" depends="clean">
190        <ant dir="core/java/" target="distclean" />
191        <ant dir="router/java/" target="distclean" />
192        <ant dir="apps/ministreaming/java/" target="distclean" />
193        <ant dir="apps/streaming/java/" target="distclean" />
194        <ant dir="apps/i2ptunnel/java/" target="distclean" />
195        <ant dir="apps/sam/java/" target="distclean" />
196        <ant dir="apps/BOB" target="clean" />
197        <ant dir="apps/routerconsole/java/" target="distclean" />
198        <ant dir="apps/addressbook/" target="distclean" />
199        <ant dir="apps/susimail/" target="distclean" />
200        <ant dir="apps/susidns/src/" target="distclean" />
201        <ant dir="apps/systray/java/" target="distclean" />
202        <ant dir="apps/i2psnark/java/" target="distclean" />
203        <delete>
204            <fileset dir="." includes="**/*.class" />
205            <fileset dir="." includes="**/*.java~" />
206        </delete>
207    </target>
208    <target name="pkg" depends="distclean, updaterWithJettyFixes, preppkg, installer" />
209    <target name="pkgclean" depends="deletepkg-temp">
210        <delete>
211            <fileset dir="." includes="i2p.tar.bz2 install.jar i2pupdate.zip" />
212        </delete>
213    </target>
214    <target name="preppkg" depends="build, buildexe, preplicenses, prepconsoleDocs">
215        <copy file="build/i2p.jar" todir="pkg-temp/lib/" />
216        <copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
217        <copy file="build/jasper-compiler.jar" todir="pkg-temp/lib/" />
218        <copy file="build/jasper-runtime.jar" todir="pkg-temp/lib/" />
219        <copy file="build/commons-logging.jar" todir="pkg-temp/lib/" />
220        <copy file="build/commons-el.jar" todir="pkg-temp/lib/" />
221        <copy file="build/javax.servlet.jar" todir="pkg-temp/lib/" />
222        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
223        <copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
224        <copy file="build/streaming.jar" todir="pkg-temp/lib/" />
225        <copy file="build/org.mortbay.jetty.jar" todir="pkg-temp/lib/" />
226        <copy file="build/router.jar" todir="pkg-temp/lib/" />
227        <copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
228        <copy file="build/sam.jar" todir="pkg-temp/lib/" />
229        <copy file="build/BOB.jar" todir="pkg-temp/lib/" />
230        <copy file="build/systray.jar" todir="pkg-temp/lib" />
231        <!-- <copy file="build/sucker.jar" todir="pkg-temp/lib" /> -->
232        <copy file="build/i2psnark.jar" todir="pkg-temp/lib/" />
233        <copy file="i2p.exe" todir="pkg-temp/" failonerror="false" />
234        <copy file="installer/resources/runplain.sh" todir="pkg-temp/" />
235        <copy file="apps/systray/java/lib/systray4j.jar" todir="pkg-temp/lib" />
236        <copy file="apps/systray/java/lib/systray4j.dll" todir="pkg-temp/lib" />
237        <copy file="apps/systray/java/resources/iggy.ico" todir="pkg-temp/icons" />
238        <copy file="apps/systray/java/resources/iggy.xpm" todir="pkg-temp/icons" />
239        <copy file="build/i2ptunnel.war" todir="pkg-temp/webapps/" />
240        <copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
241        <copy file="build/addressbook.war" todir="pkg-temp/webapps/" />
242        <copy file="build/susimail.war" todir="pkg-temp/webapps/" />
243        <copy file="build/susidns.war" todir="pkg-temp/webapps/" />
244        <!-- <copy file="build/syndie.war" todir="pkg-temp/webapps/" /> -->
245        <copy file="build/i2psnark.war" todir="pkg-temp/webapps/" />
246        <copy file="apps/i2psnark/launch-i2psnark" todir="pkg-temp/" />
247        <copy file="apps/i2psnark/jetty-i2psnark.xml" todir="pkg-temp/" />
248        <copy file="apps/i2psnark/i2psnark.config" todir="pkg-temp/" />
249        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
250        <copy file="installer/resources/clients.config" todir="pkg-temp/" />
251        <copy file="installer/resources/eepget" todir="pkg-temp/" />
252        <copy file="installer/resources/i2prouter" todir="pkg-temp/" />
253        <copy file="installer/resources/i2prouter.bat" todir="pkg-temp/" />
254        <copy file="installer/resources/fixperms.bat" todir="pkg-temp/" />
255        <copy file="installer/resources/i2ptunnel.config" todir="pkg-temp/" />
256        <!-- <copy file="installer/resources/install_i2p_service_unix" todir="pkg-temp/" /> -->
257        <copy file="installer/resources/install_i2p_service_winnt.bat" todir="pkg-temp/" />
258        <copy file="installer/resources/osid" todir="pkg-temp/" />
259        <copy file="installer/resources/postinstall.bat" todir="pkg-temp/" />
260        <copy file="installer/resources/postinstall.sh" todir="pkg-temp/" />
261        <copy file="installer/resources/systray.config" todir="pkg-temp/" />
262        <!-- <copy file="installer/resources/uninstall_i2p_service_unix" todir="pkg-temp/" /> -->
263        <copy file="installer/resources/uninstall_i2p_service_winnt.bat" todir="pkg-temp/" />
264        <copy file="installer/resources/wrapper.config" todir="pkg-temp/" />
265        <copy todir="pkg-temp/lib/wrapper/freebsd/">
266            <fileset dir="installer/lib/wrapper/freebsd/" />
267        </copy>
268        <copy todir="pkg-temp/lib/wrapper/linux/">
269            <fileset dir="installer/lib/wrapper/linux/" />
270        </copy>
271        <copy todir="pkg-temp/lib/wrapper/linux64/">
272            <fileset dir="installer/lib/wrapper/linux64/" />
273        </copy>
274        <copy todir="pkg-temp/lib/wrapper/macosx/">
275            <fileset dir="installer/lib/wrapper/macosx/" />
276        </copy>
277        <copy todir="pkg-temp/lib/wrapper/solaris/">
278            <fileset dir="installer/lib/wrapper/solaris/" />
279        </copy>
280        <copy todir="pkg-temp/lib/wrapper/win32/">
281            <fileset dir="installer/lib/wrapper/win32/" />
282        </copy>
283        <copy file="hosts.txt" todir="pkg-temp/" />
284        <copy file="INSTALL-headless.txt" todir="pkg-temp/" />
285        <copy file="history.txt" todir="pkg-temp/" />
286        <mkdir dir="pkg-temp/scripts" />
287        <copy file="apps/proxyscript/i2pProxy.pac" todir="pkg-temp/scripts/" />
288        <copy file="core/perl/i2pbench.sh" todir="pkg-temp/scripts/" />
289        <copy file="core/perl/i2ptest.sh" todir="pkg-temp/scripts/" />
290        <!-- polecat: please put your modified toolbar.html in installer/resources/toolbar.html
291             and uncomment the following -->
292        <!-- <copy file="installer/resources/toolbar.html" todir="pkg-temp/docs/" /> -->
293        <copy file="initialNews.xml" tofile="pkg-temp/docs/news.xml" />
294        <copy file="installer/resources/startconsole.html" todir="pkg-temp/docs/" />
295        <copy file="installer/resources/start.ico" todir="pkg-temp/docs/" />
296        <copy file="installer/resources/console.ico" todir="pkg-temp/docs/" />
297        <copy file="installer/resources/uninstall.ico" todir="pkg-temp/docs/" />
298        <mkdir dir="pkg-temp/docs/themes/" />
299        <copy todir="pkg-temp/docs/themes/" >
300          <fileset dir="installer/resources/themes/" />
301        </copy>
302        <mkdir dir="pkg-temp/eepsite" />
303        <mkdir dir="pkg-temp/eepsite/webapps" />
304        <mkdir dir="pkg-temp/eepsite/logs" />
305        <mkdir dir="pkg-temp/eepsite/docroot" />
306        <mkdir dir="pkg-temp/eepsite/cgi-bin" />
307        <copy file="installer/resources/eepsite_index.html" tofile="pkg-temp/eepsite/docroot/index.html" />
308        <copy file="installer/resources/eepsite_index_de.html" tofile="pkg-temp/eepsite/docroot/index_de.html" />
309        <copy file="installer/resources/eepsite.css" todir="pkg-temp/eepsite/docroot/" />
310        <copy file="installer/resources/robots.txt" todir="pkg-temp/eepsite/docroot/" />
311        <copy file="installer/resources/themes/console/images/favicon.ico" tofile="pkg-temp/eepsite/docroot/favicon.ico" />
312        <copy file="installer/resources/jetty.xml" tofile="pkg-temp/eepsite/jetty.xml" />
313    </target>
314    <target name="preplicenses">
315        <copy file="LICENSE.txt" todir="pkg-temp/" />
316        <copy todir="pkg-temp/licenses/" >
317          <fileset dir="licenses/" />
318        </copy>
319        <copy file="installer/lib/launch4j/lib/foxtrot.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-Foxtrot.txt" />
320        <copy file="installer/lib/launch4j/lib/JGoodies.Forms.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-JGoodies-Forms.txt" />
321        <copy file="installer/lib/launch4j/lib/JGoodies.Looks.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-JGoodies-Looks.txt" />
322        <copy file="installer/lib/launch4j/lib/XStream.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-XStream.txt" />
323    </target>
324    <target name="prepthemeupdates">
325        <!-- CSS now in docs/, not in the .war; just in case anybody is using defCon1 -->
326        <copy file="installer/resources/themes/console/defCon1/console.css" todir="pkg-temp/docs/themes/console/defCon1/" />
327        <!-- Add extricated I2PSnark css here, for now -->
328        <copy file="installer/resources/themes/console/snark.css" todir="pkg-temp/docs/themes/console/" />
329        <!-- these files now in docs/, not in the .war -->
330        <!-- No need to copy these individually, we're copying the whole dir below..
331        <copy file="installer/resources/themes/console/images/favicon.ico" todir="pkg-temp/docs/themes/console/images/" />
332        <copy file="installer/resources/themes/console/images/i2plogo.png" todir="pkg-temp/docs/themes/console/images/" />
333        -->
334        <!-- Since the logo moved, we have to update the error pages -->
335        <copy todir="pkg-temp/docs/" >
336          <fileset dir="installer/resources/" includes="*-header.ht" />
337        </copy>
338        <!-- make a "classic" theme -->
339        <copy todir="pkg-temp/docs/themes/console/classic/" >
340            <fileset  dir="installer/resources/themes/console/classic/" />
341        </copy>
342        <!-- Add dark theme -->
343        <copy todir="pkg-temp/docs/themes/console/dark/" >
344            <fileset  dir="installer/resources/themes/console/dark/" />
345        </copy>
346        <!-- Add light theme -->
347        <copy todir="pkg-temp/docs/themes/console/light/" >
348            <fileset  dir="installer/resources/themes/console/light/" />
349        </copy>
350        <!-- Add shared images.. these are subject to flux and change! -->
351        <copy todir="pkg-temp/docs/themes/console/images/" >
352            <fileset  dir="installer/resources/themes/console/images/" />
353        </copy>         
354        <copy todir="pkg-temp/docs/" >
355          <fileset dir="." includes="readme*.html" />
356        </copy>
357    </target>
358
359    <!-- this is no longer required, izpack 4.3.0 supports headless installs with java -jar i2pinstall.exe -console -->
360    <target name="tarball" depends="preppkg">
361        <tar compression="bzip2" destfile="i2p.tar.bz2">
362            <tarfileset dir="pkg-temp" includes="**/*" prefix="i2p" />
363        </tar>
364    </target>
365    <target name="deletepkg-temp">
366        <delete dir="pkg-temp" />
367    </target>
368    <target name="prepconsoleDocs" depends="prepgeoupdate">
369        <copy todir="pkg-temp/docs/" >
370          <fileset dir="." includes="readme*.html" />
371          <fileset dir="installer/resources/" includes="*-header.ht" />
372        </copy>
373    </target>
374    <target name="consoleDocs" depends="deletepkg-temp, prepconsoleDocs">
375        <zip destfile="docs.zip" basedir="pkg-temp" whenempty="fail" />
376    </target>
377    <target name="updater" depends="prepupdate, preplicenses, zipit" />
378    <target name="updaterWithGeoIP" depends="prepupdate, prepgeoupdate, preplicenses, zipit" />
379    <target name="updaterWithJetty" depends="prepjupdate, preplicenses, zipit" />
380    <target name="updaterWithJettyFixes" depends="prepjupdatefixes, preplicenses, zipit" />
381    <target name="updaterWithJettyFixesAndGeoIP" depends="prepjupdatefixes, prepgeoupdate, preplicenses, zipit" />
382    <target name="updaterSmall" depends="prepupdateSmall, zipit" />
383    <target name="updaterRouter" depends="prepupdateRouter, zipit" />
384    <target name="zipit">
385        <zip destfile="i2pupdate.zip" basedir="pkg-temp" whenempty="fail" />
386    </target>
387    <target name="updateTest" depends="prepupdate">
388        <ant dir="core/java/" target="jarTest" />   
389        <copy file="core/java/build/i2ptest.jar" todir="pkg-temp/lib" />
390        <zip destfile="i2pupdate.zip" basedir="pkg-temp" />
391    </target>
392    <target name="prepupdate" depends="build2, prepupdateSmall">
393        <copy file="build/BOB.jar" todir="pkg-temp/lib/" />
394        <copy file="build/sam.jar" todir="pkg-temp/lib/" />
395        <copy file="build/i2psnark.jar" todir="pkg-temp/lib" />
396        <!-- include systray changes in 0.7.5 -->
397        <copy file="build/systray.jar" todir="pkg-temp/lib/" />
398        <copy file="build/susimail.war" todir="pkg-temp/webapps/" />
399        <copy file="build/susidns.war" todir="pkg-temp/webapps/" />
400        <copy file="build/i2psnark.war" todir="pkg-temp/webapps/" />
401        <copy file="history.txt" todir="pkg-temp/" />
402        <copy file="news.xml" todir="pkg-temp/docs/" />
403    </target>
404    <target name="prepupdateSmall" depends="buildSmall, prepupdateRouter, prepthemeupdates">
405        <copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
406        <copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
407        <copy file="build/streaming.jar" todir="pkg-temp/lib/" />
408        <copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
409        <copy file="build/i2ptunnel.war" todir="pkg-temp/webapps/" />
410        <copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
411        <copy file="build/addressbook.war" todir="pkg-temp/webapps/" />
412        <!-- New readme_*.html files - For one release only -->
413        <copy file="readme_zh.html" todir="pkg-temp/docs/" />
414    </target>
415    <target name="prepupdateRouter" depends="buildrouter, deletepkg-temp">
416        <copy file="build/i2p.jar" todir="pkg-temp/lib/" />
417        <copy file="build/router.jar" todir="pkg-temp/lib/" />
418    </target>
419    <target name="prepgeoupdate">
420        <copy file="installer/resources/geoip.txt" todir="pkg-temp/geoip/" />
421        <copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
422        <copy todir="pkg-temp/docs/icons/flags" >
423          <fileset dir="installer/resources/icons/flags" />
424        </copy>
425    </target>
426    <target name="prepjupdate" depends="prepupdate, buildWEB">
427        <copy file="build/jasper-compiler.jar" todir="pkg-temp/lib/" />
428        <copy file="build/jasper-runtime.jar" todir="pkg-temp/lib/" />
429        <copy file="build/commons-logging.jar" todir="pkg-temp/lib/" />
430        <copy file="build/commons-el.jar" todir="pkg-temp/lib/" />
431        <copy file="build/javax.servlet.jar" todir="pkg-temp/lib/" />
432        <copy file="build/org.mortbay.jetty.jar" todir="pkg-temp/lib/" />
433    </target>
434    <target name="prepjupdatefixes" depends="prepupdate, buildWEB">
435        <copy file="build/org.mortbay.jetty.jar" todir="pkg-temp/lib/" />
436    </target>
437    <target name="installer" depends="preppkg">
438        <taskdef name="izpack" classpath="${basedir}/installer/lib/izpack/standalone-compiler.jar" classname="com.izforge.izpack.ant.IzPackTask" />
439        <mkdir dir="pkg-temp/installer" />
440        <jar destfile="./pkg-temp/installer/copy.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Copy.class net/i2p/util/FileUtil.class">
441            <manifest><attribute name="Main-Class" value="net.i2p.util.Copy" /></manifest>
442        </jar>
443        <jar destfile="./pkg-temp/installer/delete.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Delete.class net/i2p/util/FileUtil.class">
444            <manifest><attribute name="Main-Class" value="net.i2p.util.Delete" /></manifest>
445        </jar>
446        <jar destfile="./pkg-temp/installer/exec.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Exec.class">
447            <manifest><attribute name="Main-Class" value="net.i2p.util.Exec" /></manifest>
448        </jar>
449        <izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
450
451        <ant target="installerexe" />
452    </target>
453    <target name="installerexe">
454        <condition property="noExe">
455            <os arch="x86_64" />
456        </condition>
457        <condition property="noExe">
458            <os arch="amd64" />
459        </condition>
460        <condition property="noExe">
461           <not>
462            <or>
463             <os name="Linux" />
464             <os family="windows" />
465            </or>
466           </not>
467        </condition>
468        <ant target="doInstallerEXE" />
469    </target>
470    <target name="doInstallerEXE" unless="noExe">
471        <!-- now the installer exe -->
472        <taskdef name="launch4j"
473                 classname="net.sf.launch4j.ant.Launch4jTask"
474                 classpath="${basedir}/installer/lib/launch4j/launch4j.jar:${basedir}/installer/lib/launch4j/lib/xstream.jar" />
475        <launch4j configFile="./installer/i2pinstaller.xml" />
476        <launch4j configFile="./installer/i2pstandalone.xml" />
477        <!-- thazzit -->
478    </target>
479    <target name="test">
480        <ant dir="core/java/" target="test" />
481    </target>
482    <target name="junit.report">
483        <ant dir="core/java/" target="junit.report" />
484    </target>
485    <target name="clover.report">
486        <ant dir="core/java/" target="clover.report" />
487    </target>
488    <target name="test.report" depends="junit.report, clover.report"/>
489    <target name="fulltest">
490                <ant dir="core/java/" target="fulltest" />
491                <ant dir="router/java/" target="fulltest" />
492    </target>
493    <target name="fullclovertest">
494                <ant dir="core/java/" target="fullclovertest" />
495                <ant dir="router/java/" target="fullclovertest" />
496    </target>
497    <target name="syndie" >
498        <ant dir="apps/syndie/java/" target="standalone" />
499        <copy file="apps/syndie/java/syndie-standalone.zip" todir="." />
500    </target>
501    <target name="i2psnark">
502        <ant dir="apps/i2psnark/java" target="standalone" />
503        <copy file="apps/i2psnark/java/i2psnark-standalone.zip" todir="." />
504    </target>
505    <target name="slackpkg">
506        <echo message="Building Slackware package." />
507        <ant dir="Slackware/i2p/" target="slackpkg" />
508        <ant dir="Slackware/i2p-base/" target="slackpkg" />
509    </target>
510    <target name="findbugs" depends="build2">
511        <echo message="Starting findbugs, this will take a while..." />
512        <exec executable="nice">
513            <arg value="findbugs"/>
514            <arg value="-textui"/>
515            <arg value="-projectName"/>
516            <arg value="i2p"/>
517            <arg value="-sortByClass"/>
518            <arg value="-xml"/>
519            <arg value="-output"/>
520            <arg value="findbugs.xml"/>
521            <arg value="-auxclasspath"/>
522            <arg value="build/commons-el.jar:build/commons-logging.jar:build/jasper-compiler.jar:build/jasper-runtime.jar:build/javax.servlet.jar:build/org.mortbay.jetty.jar:apps/jrobin/jrobin-1.4.0.jar:apps/systray/java/lib/systray4j.jar:installer/lib/wrapper/linux/wrapper.jar"/>
523            <arg value="-sourcepath"/>
524            <arg value="apps/BOB/src/:apps/addressbook/java/src/:apps/i2psnark/java/src/:apps/i2ptunnel/java/src/:apps/ministreaming/java/src/:apps/routerconsole/java/src/:apps/sam/java/src/:apps/streaming/java/src/:apps/susidns/src/java/src/:apps/susimail/src/src/:apps/systray/java/src/:core/java/src/:router/java/src/"/>
525            <!-- start of the files to be analyzed -->
526            <arg value="build/BOB.jar"/>
527            <arg value="build/addressbook.war"/>
528            <arg value="build/i2p.jar"/>
529            <arg value="build/i2psnark.jar"/>
530            <arg value="build/i2psnark.war"/>
531            <arg value="build/i2ptunnel.jar"/>
532            <arg value="build/i2ptunnel.war"/>
533            <arg value="build/jbigi.jar"/>
534            <arg value="build/mstreaming.jar"/>
535            <arg value="build/router.jar/"/>
536            <!-- use the class files rather than the jar for routerconsole so we don't analyze jrobin -->
537            <arg value="apps/routerconsole/java/build/obj/"/>
538            <arg value="build/sam.jar"/>
539            <arg value="build/streaming.jar"/>
540            <arg value="build/susidns.war"/>
541            <arg value="build/susimail.war"/>
542            <arg value="build/systray.jar"/>
543        </exec>
544        <echo message="Findbugs output stored in findbugs.xml" />
545    </target>
546    <target name="buildWithDesktopgui" depends="buildrouter,builddepSmall">
547        <ant dir="apps/desktopgui" target="build_jar" />
548    </target>
549    <target name="preppkgWithDesktopgui" depends="buildWithDesktopgui,preppkg">
550        <copy file="apps/desktopgui/dist/desktopgui.jar" todir="pkg-temp/lib/" />
551        <copy file="apps/desktopgui/lib/swing-worker.jar" todir="pkg-temp/lib/" />
552        <copy file="apps/desktopgui/lib/appframework.jar" todir="pkg-temp/lib/" />
553        <mkdir dir="pkg-temp/desktopgui/resources/" />
554        <copy todir="pkg-temp/desktopgui/resources/">
555            <fileset dir="apps/desktopgui/desktopgui/resources/" />
556        </copy>
557    </target>
558    <target name="installerWithDesktopgui" depends="preppkgWithDesktopgui,installer" />
559    <target name="prepupdateWithDesktopgui" depends="buildWithDesktopgui,prepupdate">
560        <copy file="apps/desktopgui/dist/desktopgui.jar" todir="pkg-temp/lib/" />
561        <copy file="apps/desktopgui/lib/swing-worker.jar" todir="pkg-temp/lib/" />
562        <copy file="apps/desktopgui/lib/appframework.jar" todir="pkg-temp/lib/" />
563        <mkdir dir="pkg-temp/desktopgui/resources/" />
564        <copy todir="pkg-temp/desktopgui/resources/">
565            <fileset dir="apps/desktopgui/desktopgui/resources/" />
566        </copy>
567    </target>
568    <target name="updaterWithDesktopgui" depends="prepupdateWithDesktopgui,updater" />
569    <target name="pkgWithDesktopgui" depends="distclean, updaterWithDesktopgui, installerWithDesktopgui, preppkg" />
570    <target name="distWithDesktopgui" depends="pkgWithDesktopgui, javadoc" />
571    <target name="distcleanWithDesktopgui" depends="distclean">
572        <ant dir="apps/desktopgui" target="build_clean" />
573    </target>
574    <target name="release" depends="pkg">
575        <echo message="================================================================" />
576        <echo message="Did you update these files?" />
577        <exec executable="ls">
578            <arg value="-l" />
579            <arg value="history.txt" />
580            <arg value="initialNews.xml" />
581            <arg value="installer/install.xml" />
582            <arg value="news.xml" />
583            <arg value="core/java/src/net/i2p/CoreVersion.java" />
584            <arg value="router/java/src/net/i2p/router/RouterVersion.java" />
585        </exec>
586        <echo message="Everything is checked in, right?" />
587        <input message="Enter new version number:" addproperty="release.number" />
588        <fail message="You must enter a version number." >
589            <condition>
590                <equals arg1="${release.number}" arg2=""/>
591            </condition>
592        </fail>
593        <copy file="i2pupdate.zip" tofile="i2pupdate_${release.number}.zip" />
594        <copy file="i2pinstall.exe" tofile="i2pinstall_${release.number}.exe" />
595        <delete file="i2pupdate.sud" failonerror="false" />
596        <input message="Enter private signing key file:" addproperty="release.privkey" />
597        <fail message="You must enter a path." >
598            <condition>
599                <equals arg1="${release.privkey}" arg2=""/>
600            </condition>
601        </fail>
602        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
603            <classpath>
604                <pathelement location="build/i2p.jar" />
605            </classpath>
606            <arg value="sign" />
607            <arg value="i2pupdate.zip" />
608            <arg value="i2pupdate.sud" />
609            <arg value="${release.privkey}" />
610            <arg value="${release.number}" />
611        </java>
612        <fail message="i2pupdate.sud generation failed!" >
613            <condition>
614                <length file="i2pupdate.sud" when="lt" length="1000000" />
615            </condition>
616        </fail>
617        <echo message="Verify version and VALID signature:" />
618        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
619            <classpath>
620                <pathelement location="build/i2p.jar" />
621            </classpath>
622            <arg value="verifysig" />
623            <arg value="i2pupdate.sud" />
624        </java>
625        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
626            <classpath>
627                <pathelement location="build/i2p.jar" />
628            </classpath>
629            <arg value="showversion" />
630            <arg value="i2pupdate.sud" />
631        </java>
632        <!-- will this use the monotonerc file in the current workspace? -->
633        <echo message="Checking out fresh copy into ../i2p-${release-number} for tarballing:" />
634        <exec executable="mtn">
635            <arg value="co" />
636            <arg value="-b" />
637            <arg value="i2p.i2p" />
638            <arg value="../i2p-${release.number}/" />
639        </exec>
640        <exec executable="tar">
641            <arg value="cjf" />
642            <arg value="i2psource_${release.number}.tar.bz2" />
643            <arg value="-C" />
644            <arg value=".." />
645            <arg value="--exclude" />
646            <arg value="i2p-${release.number}/_MTN/" />
647            <arg value="i2p-${release.number}/" />
648        </exec>
649        <echo message="Sign the files:" />
650        <exec executable="gpg">
651            <arg value="-b" />
652            <arg value="i2pinstall_${release.number}.exe" />
653        </exec>
654        <exec executable="gpg">
655            <arg value="-b" />
656            <arg value="i2psource_${release.number}.tar.bz2" />
657        </exec>
658        <exec executable="gpg">
659            <arg value="-b" />
660            <arg value="i2pupdate_${release.number}.zip" />
661        </exec>
662        <echo message="File sizes:" />
663        <exec executable="ls">
664            <arg value="-l" />
665            <arg value="i2pinstall_${release.number}.exe" />
666            <arg value="i2psource_${release.number}.tar.bz2" />
667            <arg value="i2pupdate_${release.number}.zip" />
668            <arg value="i2pupdate.sud" />
669            <arg value="i2pinstall_${release.number}.exe.sig" />
670            <arg value="i2psource_${release.number}.tar.bz2.sig" />
671            <arg value="i2pupdate_${release.number}.zip.sig" />
672        </exec>
673        <echo message="SHA256 sums:" />
674        <exec executable="sha256sum">
675            <arg value="i2pinstall_${release.number}.exe" />
676            <arg value="i2psource_${release.number}.tar.bz2" />
677            <arg value="i2pupdate_${release.number}.zip" />
678            <arg value="i2pupdate.sud" />
679        </exec>
680        <echo message="Don't forget to mtn tag h: i2p-${release-number}" />
681    </target>
682</project>
Note: See TracBrowser for help on using the repository browser.