source: build.xml @ 37fc448

Last change on this file since 37fc448 was 37fc448, checked in by mathiasdm <mathiasdm@…>, 10 years ago

propagate from branch 'i2p.i2p' (head dbe319d674d6a6a53491762262978f53caaaa58a)

to branch 'i2p.i2p.mathiasdm.desktopgui' (head fced1e04334ef1c18bc6ae8a31984e627310b14c)

  • Property mode set to 100644
File size: 54.7 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    <!-- Additional classpath. No longer required; we find pack200 classes at runtime.
10         See core/java/src/net/i2p/util/FileUtil.java for more info.
11    -->
12    <!--
13        <property name="javac.classpath" value="/PATH/TO/pack200.jar" />
14    -->
15
16    <!-- You probably don't want to change anything from here down -->
17    <target name="help" depends="all" />
18    <target name="all" >
19        <echo message="Useful targets: " />
20        <echo message="  pkg:       distclean then package everything up (installer, clean tarball, update tarball)" />
21        <echo message="  dist:      pkg and javadoc" />
22        <echo message="  installer: build the GUI installer" />
23        <echo message="  tarball:   tar the full install into i2p.tar.bz2 (extracts to build a new clean install)" />
24        <echo message="  updater:   Package the built files in i2pupdate.zip (extracts safely over existing installs)" />
25        <echo message="  updater200: Updater compressed with pack200 (creates i2pupdate200.zip, 60% smaller)" />
26        <echo message="  updaterWithJavadoc: updater including the javadocs, for display in the console" />
27        <echo message="  updaterWithJetty: Updater including Jetty" />
28        <echo message="  updaterWithJettyFixes: updater including local jetty patches" />
29        <echo message="  updaterWithGeoIP: updater including GeoIP Files" />
30        <echo message="  updaterWithJettyFixesAndGeoIP" />
31        <echo message="  updaterSmall:   updater with the essentials only - no SAM, i2psnark, SusiMail, SusiDNS, news.xml, or history.txt" />
32        <echo message="  updaterRouter:  updater with the i2p.jar and router.jar only" />
33        <echo message="  distclean: clean up all derived files" />
34        <echo message="  syndie:    generate a standalone syndie install" />
35        <echo message="  desktopgui: generate a standalone desktopgui install" />
36        <echo message="  i2psnark:  generate a standalone i2psnark install" />
37        <echo message="  justBOB:  generate a standalone BOB-one.jar" />
38        <echo message="  javadoc:   generate javadoc for the entire project into ./build/javadoc" />
39        <echo message="  slackpkg:  generate Slackware packages in ./Slackware/i2p and ./Slackware/i2p-base" />
40        <echo message="  debianhowto: instructions on building Debian packages" />
41        <echo message="  debian: generate Debian packages in ./debian/packages" />
42        <echo message="          (libc6-i686 and libc6-amd64 required, ant>=1.8 required)" />
43        <echo message="  debianrepo: build a Debian repository (reprepro required)" />
44        <echo message="  poupdate: update the .po files for translators" />
45    </target>
46    <target name="debianhowto">
47        <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." />
48    </target>
49    <target name="dist" depends="pkg, javadoc">
50    </target>
51    <target name="build" depends="build2">
52        <!-- so we don't build standalone for the updater -->
53        <!-- This builds apps/i2psnark/java/i2psnark-standalone.zip,
54          -   which we don't distribute anywhere...
55        <ant dir="apps/i2psnark/java/" target="standalone" />
56        -->
57    </target>
58    <target name="build2" depends="builddep, jar, buildWEB" />
59    <target name="buildSmall" depends="builddepSmall, jarSmall, buildWEB" />
60    <target name="buildclean" depends="distclean, build" />
61
62    <target name="builddep" depends="builddepSmall, buildBOB, buildSAM, buildSusiMail, buildSusiDNS, buildI2PSnark" />
63
64    <target name="builddepSmall" depends="buildrouter, buildSystray, buildDesktopGui, buildRouterConsole, buildStreaming, buildI2PTunnel, buildAddressbook" />
65
66    <!-- start of buildX, one for each sub-build.xml.
67         Do not put ant tasks in the sub-build.xmls anymore,
68         so the build will go faster.
69      -->
70
71    <!-- TODO remove I2PTunnel dependency in BOB -->
72    <target name="buildBOB" depends="buildStreaming, buildI2PTunnel" >
73        <ant dir="apps/BOB/" target="jar" />
74    </target>
75
76    <target name="buildSAM" depends="buildStreaming" >
77        <ant dir="apps/sam/java/" target="jar" />
78    </target>
79
80    <target name="buildSusiMail" depends="buildCore, buildJetty" >
81        <ant dir="apps/susimail/" target="war" />
82    </target>
83
84    <target name="buildSusiDNS" depends="buildCore, buildJetty" >
85        <ant dir="apps/susidns/src" target="all" />
86    </target>
87
88    <target name="buildI2PSnark" depends="buildStreaming, buildJetty" >
89        <ant dir="apps/i2psnark/java/" target="war" />
90    </target>
91
92    <target name="buildAddressbook" depends="buildCore, buildJetty" >
93        <ant dir="apps/addressbook/" target="war" />
94    </target>
95
96    <target name="buildI2PTunnel" depends="buildStreaming, buildJetty" >
97        <ant dir="apps/i2ptunnel/java/" target="build" />
98    </target>
99
100    <target name="buildDesktopGui" depends="buildCore, buildrouter" >
101        <ant dir="apps/desktopgui" target="jar" />
102    </target>
103
104    <target name="buildRouterConsole" depends="buildrouter, buildSystray, buildDesktopGui, buildJetty" >
105        <ant dir="apps/routerconsole/java/" target="jar" />
106    </target>
107
108    <target name="buildJetty" >
109        <ant dir="apps/jetty" target="build" />
110    </target>
111
112    <target name="buildSystray" depends="buildCore" >
113        <ant dir="apps/systray/java/" target="jar" />
114    </target>
115
116    <target name="buildStreaming" depends="buildMinistreaming" >
117        <ant dir="apps/streaming/java/" target="jar" />
118    </target>
119
120    <target name="buildMinistreaming" depends="buildCore" >
121        <ant dir="apps/ministreaming/java/" target="jar" />
122    </target>
123
124    <target name="buildRouter" depends="buildrouter" />
125    <target name="buildrouter" depends="buildCore" >
126        <ant dir="router/java/" target="jar" />
127        <copy file="router/java/build/router.jar" todir="build/" />
128    </target>
129
130    <target name="buildCore" >
131        <ant dir="core/java/" target="jar" />
132        <copy file="core/java/build/i2p.jar" todir="build/" />
133    </target>
134
135    <!-- end of sub-build.xml targets -->
136
137    <target name="buildWEB" depends="buildRouterConsole" >
138        <copy file="apps/routerconsole/java/build/routerconsole.jar" todir="build/" />
139        <copy file="apps/routerconsole/java/build/routerconsole.war" todir="build/" />
140        <copy file="apps/jetty/jettylib/org.mortbay.jetty.jar" todir="build/" />
141        <copy file="apps/jetty/jettylib/jasper-compiler.jar" todir="build/" />
142        <copy file="apps/jetty/jettylib/jasper-runtime.jar" todir="build/" />
143        <copy file="apps/jetty/jettylib/commons-logging.jar" todir="build/" />
144        <copy file="apps/jetty/jettylib/commons-el.jar" todir="build/" />
145        <copy file="apps/jetty/jettylib/javax.servlet.jar" todir="build/" />
146    </target>
147
148    <target name="buildexe">
149        <condition property="noExe">
150            <os arch="x86_64" />
151        </condition>
152        <condition property="noExe">
153            <os arch="ppc" />
154        </condition>
155        <condition property="noExe">
156            <os arch="amd64" />
157        </condition>
158        <condition property="noExe">
159           <not>
160            <or>
161             <os name="Linux" />
162             <os family="windows" />
163            </or>
164           </not>
165        </condition>
166        <ant target="doBuildEXE" />
167    </target>
168    <target name="doBuildEXE" unless="noExe">
169        <jar destfile="./build/launchi2p.jar">
170            <manifest>
171             <attribute name="Main-Class" value="net.i2p.router.RouterLaunch" />
172             <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 lib/desktopgui.jar" />
173            </manifest>
174        </jar>
175        <!-- now the standalone launcher exe -->
176        <taskdef name="launch4j"
177                 classname="net.sf.launch4j.ant.Launch4jTask"
178                 classpath="${basedir}/installer/lib/launch4j/launch4j.jar:${basedir}/installer/lib/launch4j/lib/xstream.jar" />
179        <launch4j configFile="./installer/i2pstandalone.xml" />
180        <!-- thazzit -->
181    </target>
182    <target name="compile" />
183    <target name="jar" depends="jarSmall" >
184        <copy file="apps/BOB/dist/BOB.jar" todir="build/" />
185        <copy file="apps/sam/java/build/sam.jar" todir="build/" />
186        <copy file="apps/susimail/susimail.war" todir="build/" />
187        <copy file="apps/susidns/src/susidns.war" todir="build/" />
188        <copy file="apps/i2psnark/i2psnark.war" todir="build/" />
189        <copy file="apps/i2psnark/java/build/i2psnark.jar" todir="build/" />
190    </target>
191    <target name="jarSmall" depends="compile" >
192        <copy file="core/java/build/i2p.jar" todir="build/" />
193        <copy file="router/java/build/router.jar" todir="build/" />
194        <copy file="apps/ministreaming/java/build/mstreaming.jar" todir="build/" />
195        <copy file="apps/streaming/java/build/streaming.jar" todir="build/" />
196        <copy file="apps/i2ptunnel/java/build/i2ptunnel.jar" todir="build/" />
197        <copy file="apps/i2ptunnel/java/build/i2ptunnel.war" todir="build/" />
198        <copy file="apps/systray/java/build/systray.jar" todir="build/" />
199        <copy file="apps/desktopgui/dist/desktopgui.jar" todir="build/" />
200        <copy file="installer/lib/jbigi/jbigi.jar" todir="build" />
201        <copy file="apps/addressbook/dist/addressbook.war" todir="build/" />
202    </target>
203    <!-- the apps need to compile the jsps to poupdate -->
204    <target name="poupdate" depends="buildRouter, buildStreaming, buildSystray, buildJetty" >
205        <ant dir="apps/routerconsole/java/" target="poupdate" />
206        <ant dir="apps/i2psnark/java/" target="poupdate" />
207        <ant dir="apps/i2ptunnel/java/" target="poupdate" />
208        <ant dir="apps/susidns/src/" target="poupdate" />
209        <ant dir="apps/desktopgui" target="poupdate" />
210    </target>
211    <target name="javadoc">
212        <ant dir="apps/jetty" target="ensureJettylib" />
213        <mkdir dir="./build" />
214        <mkdir dir="./build/javadoc" />
215        <!-- get release and build version numbers -->
216        <exec executable="grep" outputproperty="versionLine" >
217            <arg value="public final static String VERSION" />
218            <arg value="core/java/src/net/i2p/CoreVersion.java" />
219        </exec>
220        <exec executable="cut" inputstring="${versionLine}" outputproperty="release.number" >
221            <arg value="-f2" />
222            <arg value="-d&quot;" />
223        </exec>
224        <exec executable="grep" outputproperty="buildLine" >
225            <arg value="public final static long BUILD" />
226            <arg value="router/java/src/net/i2p/router/RouterVersion.java" />
227        </exec>
228        <exec executable="cut" inputstring="${buildLine}" outputproperty="build.temp" >
229            <arg value="-f2" />
230            <arg value="-d=" />
231        </exec>
232        <exec executable="cut" inputstring="${build.temp}" outputproperty="build.number" >
233            <arg value="-f1" />
234            <arg value="-d;" />
235        </exec>
236        <javadoc access="package" 
237            destdir="./build/javadoc" 
238            packagenames="*" 
239            use="true" 
240            splitindex="true" 
241            doctitle="I2P Javadocs for Release ${release.number} Build ${build.number}"
242            windowtitle="I2P Anonymous Network - Java Documentation - Version ${release.number}">
243            <group title="Core SDK (i2p.jar)" packages="net.i2p:net.i2p.*:net.i2p.client:net.i2p.client.*:net.i2p.internal:net.i2p.internal.*:freenet.support.CPUInformation:org.bouncycastle.crypto:org.bouncycastle.crypto.*:gnu.crypto.*:gnu.gettext:org.xlattice.crypto.filters:com.nettgryppa.security" />
244            <group title="Streaming Library" packages="net.i2p.client.streaming" />
245            <group title="Router" packages="net.i2p.router:net.i2p.router.*:net.i2p.data.i2np:org.cybergarage.*:org.freenetproject" />
246            <group title="Router Console" packages="net.i2p.router.web" />
247            <group title="Addressbook Application" packages="net.i2p.addressbook" />
248            <group title="BOB Bridge" packages="net.i2p.BOB" />
249            <group title="I2PSnark Application" packages="org.klomp.snark:org.klomp.snark.*" />
250            <group title="I2PTunnel Application" packages="net.i2p.i2ptunnel:net.i2p.i2ptunnel.*" />
251            <group title="SAM Bridge" packages="net.i2p.sam:net.i2p.sam.client" />
252            <group title="SusiDNS Application" packages="i2p.susi.dns" />
253            <group title="SusiMail Application" packages="i2p.susi.webmail:i2p.susi.webmail.*:i2p.susi.debug:i2p.susi.util" />
254            <group title="Systray Application" packages="net.i2p.apps.systray" />
255            <group title="Desktopgui Application" packages="net.i2p.desktopgui.*" />
256            <sourcepath>
257                <pathelement location="core/java/src" />
258                <!--<pathelement location="core/java/test" />-->
259                <pathelement location="router/java/src" />
260                <!--<pathelement location="router/java/test" />-->
261                <pathelement location="apps/ministreaming/java/src" />
262                <pathelement location="apps/streaming/java/src" />
263                <pathelement location="apps/i2ptunnel/java/src" />
264                <pathelement location="apps/systray/java/src" />
265                <pathelement location="apps/desktopgui/src" />
266                <pathelement location="apps/routerconsole/java/src" />
267                <pathelement location="apps/addressbook/java/src" />
268                <pathelement location="apps/i2psnark/java/src" />
269                <pathelement location="apps/sam/java/src" />
270                <pathelement location="apps/BOB/src" />
271                <pathelement location="apps/susidns/src/java/src" />
272                <pathelement location="apps/susimail/src/src" />
273            </sourcepath>
274            <classpath>
275                <pathelement location="apps/jetty/jettylib/org.mortbay.jetty.jar" />
276                <pathelement location="apps/jetty/jettylib/javax.servlet.jar" />
277                <pathelement location="apps/systray/java/lib/systray4j.jar" />
278                <pathelement location="apps/jrobin/jrobin-1.4.0.jar" />
279                <pathelement location="installer/lib/wrapper/win32/wrapper.jar" />
280                <pathelement location="core/lib/junit.jar" />               
281            </classpath>
282            <link offline="true" href="http://download.oracle.com/javase/6/docs/api/" packagelistLoc="installer/resources/package-lists/java/" />
283            <link offline="true" href="http://docs.i2p2.de/jetty/javadoc/" packagelistLoc="installer/resources/package-lists/jetty/" />
284            <link offline="true" href="http://docs.i2p2.de/jrobin/javadoc/" packagelistLoc="installer/resources/package-lists/jrobin/" />
285        </javadoc>
286    </target>
287    <target name="clean" depends="pkgclean" >
288        <delete dir="./build" />
289        <delete file="i2pinstall.exe" failonerror="false" quiet="true" />       
290        <delete file="i2p.exe" failonerror="false" quiet="true" />
291        <delete file="syndie-standalone.zip" failonerror="false" quiet="true" />
292        <delete file="i2psnark-standalone.zip" failonerror="false" quiet="true" />
293        <delete file="BOB-one.jar" failonerror="false" quiet="true" /> 
294        <delete dir="debian/tmp" />
295        <delete dir="debian/db" />
296        <delete file="debian/files" />
297        <delete file="debian/build" />
298        <delete file="debian/substvars"/>
299    </target>
300    <target name="distclean" depends="clean">
301        <delete includeemptydirs="true" failonerror="false" >
302            <fileset dir="debian/packages" followSymlinks="false" />
303        </delete>
304        <delete dir="debian/repo" />
305        <ant dir="core/java/" target="distclean" />
306        <ant dir="router/java/" target="distclean" />
307        <ant dir="apps/ministreaming/java/" target="distclean" />
308        <ant dir="apps/streaming/java/" target="distclean" />
309        <ant dir="apps/i2ptunnel/java/" target="distclean" />
310        <ant dir="apps/sam/java/" target="distclean" />
311        <ant dir="apps/BOB" target="clean" />
312        <ant dir="apps/desktopgui" target="clean" />
313        <ant dir="apps/routerconsole/java/" target="distclean" />
314        <ant dir="apps/addressbook/" target="distclean" />
315        <ant dir="apps/susimail/" target="distclean" />
316        <ant dir="apps/susidns/src/" target="distclean" />
317        <ant dir="apps/systray/java/" target="distclean" />
318        <ant dir="apps/i2psnark/java/" target="distclean" />
319        <ant dir="apps/jetty/" target="distclean" />
320        <!--
321                NOTE! We need to turn off the default excludes for these
322                patterns to work.
323                These are the defaultexcludes in Ant as seen on
324                http://ant.apache.org/manual/CoreTasks/defaultexcludes.html
325                     **/*~
326                     **/#*#
327                     **/.#*
328                     **/%*%
329                     **/._*
330                     **/CVS
331                     **/CVS/**
332                     **/.cvsignore
333                     **/SCCS
334                     **/SCCS/**
335                     **/vssver.scc
336                     **/.svn
337                     **/.svn/**
338                     **/.DS_Store
339                The only recourse is to remove the offending ones.
340                We do this here, as we only need one change, and then put it
341                back after we are done with it.
342        -->
343        <defaultexcludes remove="**/*~"/>
344
345        <delete>
346            <fileset dir="." includes="**/*.class **/*.java~ **/*.txt~ **/*.xml~ **/*.sh~ **/*.SlackBuild~" />
347            <!--
348                Less common, but they pollute my workspace here, so we
349                might as well nuke these as well. Are there any others?
350               
351                !!??? Why don't we just nuke "**/*~" ???!!
352
353                ++Sponge
354            -->
355        </delete>
356        <!--
357                Now we put the defaults back
358        -->
359        <defaultexcludes default="true"/>
360    </target>
361
362    <target name="pkg" depends="distclean, updater, preppkg, installer" />
363
364    <target name="pkgclean" depends="deletepkg-temp">
365        <delete>
366            <fileset dir="." includes="i2p.tar.bz2 install.jar i2pupdate.zip i2pupdate200.zip" />
367        </delete>
368    </target>
369
370    <target name="preppkg" depends="preppkg-linux, preppkg-windows">
371        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
372        <copy todir="pkg-temp/lib/wrapper/freebsd/">
373            <fileset dir="installer/lib/wrapper/freebsd/" />
374        </copy>
375        <copy todir="pkg-temp/lib/wrapper/macosx/">
376            <fileset dir="installer/lib/wrapper/macosx/" />
377        </copy>
378        <copy todir="pkg-temp/lib/wrapper/solaris/">
379            <fileset dir="installer/lib/wrapper/solaris/" />
380        </copy>
381    </target>
382
383    <target name="preppkg-windows" depends="preppkg-base, buildexe">
384        <copy file="i2p.exe" todir="pkg-temp/" failonerror="false" />
385        <copy file="apps/systray/java/lib/systray4j.dll" todir="pkg-temp/lib" />
386        <copy file="apps/systray/java/resources/iggy.ico" todir="pkg-temp/icons" />
387        <copy file="apps/systray/java/resources/iggy.xpm" todir="pkg-temp/icons" />
388        <copy file="installer/resources/eepget.bat" todir="pkg-temp/" />
389        <copy file="installer/resources/i2prouter.bat" todir="pkg-temp/" />
390        <copy file="installer/resources/fixperms.bat" todir="pkg-temp/" />
391        <copy file="installer/resources/install_i2p_service_winnt.bat" todir="pkg-temp/" />
392        <copy file="installer/resources/postinstall.bat" todir="pkg-temp/" />
393        <copy file="installer/resources/uninstall_i2p_service_winnt.bat" todir="pkg-temp/" />
394        <copy todir="pkg-temp/lib/wrapper/win32/">
395            <fileset dir="installer/lib/wrapper/win32/" />
396        </copy>
397    </target>
398
399    <!-- only what is needed for debian, etc. -->
400    <target name="preppkg-linux-only" depends="preppkg-linux">
401        <!-- rip the non-linux stuff out of jbigi.jar -->
402        <mkdir dir="tmpextract" />
403        <unjar src="build/jbigi.jar" dest="tmpextract/" />
404        <jar destfile="pkg-temp/lib/jbigi.jar" >
405            <fileset dir="tmpextract/" includes="*linux*" />
406        </jar>
407        <delete dir="tmpextract/" />
408    </target>
409
410    <target name="preppkg-linux" depends="preppkg-base">
411        <copy file="installer/resources/runplain.sh" todir="pkg-temp/" />
412        <copy file="apps/i2psnark/launch-i2psnark" todir="pkg-temp/" />
413        <copy file="installer/resources/eepget" todir="pkg-temp/" />
414        <copy file="installer/resources/i2prouter" todir="pkg-temp/" />
415        <copy file="installer/resources/osid" todir="pkg-temp/" />
416        <copy file="installer/resources/postinstall.sh" todir="pkg-temp/" />
417        <copy todir="pkg-temp/man/">
418            <fileset dir="installer/resources/man/" />
419        </copy>
420        <copy todir="pkg-temp/lib/wrapper/linux/">
421            <fileset dir="installer/lib/wrapper/linux/" />
422        </copy>
423        <copy todir="pkg-temp/lib/wrapper/linux64/">
424            <fileset dir="installer/lib/wrapper/linux64/" />
425        </copy>
426    </target>
427
428    <target name="preppkg-base" depends="build, preplicenses, prepConsoleDocs, prepthemeupdates, prepCertificates">
429        <!-- if updater200 was run previously, it left *.pack files in pkg-temp -->
430        <delete>
431            <fileset dir="pkg-temp" includes="**/*.jar.pack **/*.war.pack" />
432        </delete>
433        <copy file="build/i2p.jar" todir="pkg-temp/lib/" />
434        <copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
435        <copy file="build/jasper-compiler.jar" todir="pkg-temp/lib/" />
436        <copy file="build/jasper-runtime.jar" todir="pkg-temp/lib/" />
437        <copy file="build/commons-logging.jar" todir="pkg-temp/lib/" />
438        <copy file="build/commons-el.jar" todir="pkg-temp/lib/" />
439        <copy file="build/javax.servlet.jar" todir="pkg-temp/lib/" />
440        <copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
441        <copy file="build/streaming.jar" todir="pkg-temp/lib/" />
442        <copy file="build/org.mortbay.jetty.jar" todir="pkg-temp/lib/" />
443        <copy file="build/router.jar" todir="pkg-temp/lib/" />
444        <copy file="build/desktopgui.jar" todir="pkg-temp/lib/" />
445        <copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
446        <!-- pulled out of routerconsole.jar in 0.7.12; name without version so we can overwrite if we upgrade  -->
447        <copy file="apps/jrobin/jrobin-1.4.0.jar" tofile="pkg-temp/lib/jrobin.jar" />
448        <copy file="build/sam.jar" todir="pkg-temp/lib/" />
449        <copy file="build/BOB.jar" todir="pkg-temp/lib/" />
450        <copy file="build/systray.jar" todir="pkg-temp/lib" />
451        <copy file="build/i2psnark.jar" todir="pkg-temp/lib/" />
452        <copy file="apps/systray/java/lib/systray4j.jar" todir="pkg-temp/lib" />
453        <copy file="build/i2ptunnel.war" todir="pkg-temp/webapps/" />
454        <copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
455        <copy file="build/addressbook.war" todir="pkg-temp/webapps/" />
456        <copy file="build/susimail.war" todir="pkg-temp/webapps/" />
457        <copy file="build/susidns.war" todir="pkg-temp/webapps/" />
458        <copy file="apps/susidns/src/WEB-INF/lib/jstl.jar" todir="pkg-temp/lib/" />
459        <copy file="apps/susidns/src/WEB-INF/lib/standard.jar" todir="pkg-temp/lib/" />
460        <copy file="build/i2psnark.war" todir="pkg-temp/webapps/" />
461        <copy file="apps/i2psnark/jetty-i2psnark.xml" todir="pkg-temp/" />
462        <copy file="apps/i2psnark/i2psnark.config" todir="pkg-temp/" />
463        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
464        <copy file="installer/resources/clients.config" todir="pkg-temp/" />
465        <copy file="installer/resources/i2ptunnel.config" todir="pkg-temp/" />
466        <copy file="installer/resources/systray.config" todir="pkg-temp/" />
467        <copy file="installer/resources/wrapper.config" todir="pkg-temp/" />
468        <copy file="installer/resources/hosts.txt" todir="pkg-temp/" />
469        <copy file="INSTALL-headless.txt" todir="pkg-temp/" />
470        <!-- overwrite the truncated history put in by the updater -->
471        <copy file="history.txt" todir="pkg-temp/" overwrite="true" />
472        <mkdir dir="pkg-temp/scripts" />
473        <copy file="apps/proxyscript/i2pProxy.pac" todir="pkg-temp/scripts/" />
474        <copy file="installer/resources/startconsole.html" todir="pkg-temp/docs/" />
475        <copy file="installer/resources/start.ico" todir="pkg-temp/docs/" />
476        <copy file="installer/resources/console.ico" todir="pkg-temp/docs/" />
477        <copy file="installer/resources/uninstall.ico" todir="pkg-temp/docs/" />
478        <!-- Eepsite stuff here -->
479        <mkdir dir="pkg-temp/eepsite" />
480        <mkdir dir="pkg-temp/eepsite/webapps" />
481        <mkdir dir="pkg-temp/eepsite/logs" />
482        <mkdir dir="pkg-temp/eepsite/cgi-bin" />
483        <mkdir dir="pkg-temp/eepsite/docroot" />
484        <mkdir dir="pkg-temp/eepsite/docroot/help" />
485        <mkdir dir="pkg-temp/eepsite/docroot/help/lib" />
486        <copy todir="pkg-temp/eepsite/docroot/" >
487            <fileset dir="installer/resources/eepsite.help/"  includes="robots.txt index.html help/pagetemplate.html help/index*.html **/*.png **/*.css" />
488        </copy>
489        <copy file="installer/resources/themes/console/images/favicon.ico" tofile="pkg-temp/eepsite/docroot/favicon.ico" />
490        <copy file="installer/resources/jetty.xml" tofile="pkg-temp/eepsite/jetty.xml" />
491    </target>
492
493    <target name="preplicenses">
494        <copy file="LICENSE.txt" todir="pkg-temp/" />
495        <copy todir="pkg-temp/licenses/" >
496          <fileset dir="licenses/" />
497        </copy>
498        <!--
499              The license in launch4j/ is a BSD license for launch4j
500              The license in launch4j/head is a MIT license for the code that is actually wrapped around the jars
501              So we include the MIT one in our binary package
502         -->
503        <copy file="installer/lib/launch4j/head/LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-Launch4j.txt" />
504        <!--  Not sure if these are used or should be included -->
505        <copy file="installer/lib/launch4j/lib/foxtrot.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-Foxtrot.txt" />
506        <copy file="installer/lib/launch4j/lib/JGoodies.Forms.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-JGoodies-Forms.txt" />
507        <copy file="installer/lib/launch4j/lib/JGoodies.Looks.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-JGoodies-Looks.txt" />
508        <copy file="installer/lib/launch4j/lib/XStream.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-XStream.txt" />
509    </target>
510
511    <target name="prepthemeupdates">
512        <copy todir="pkg-temp/docs/themes/" >
513            <fileset dir="installer/resources/themes/" />
514        </copy>
515    </target>
516
517    <!-- SSL Certs -->
518    <target name="prepCertificates">
519        <copy todir="pkg-temp/certificates/" >
520          <fileset dir="installer/resources/certificates/" />
521        </copy>
522    </target>
523
524    <!-- this is no longer required, izpack 4.3.0 supports headless installs with java -jar i2pinstall.exe -console -->
525    <target name="tarball" depends="preppkg">
526        <tar compression="bzip2" destfile="i2p.tar.bz2">
527            <tarfileset dir="pkg-temp" includes="**/*" prefix="i2p" />
528        </tar>
529    </target>
530
531    <target name="deletepkg-temp">
532        <delete dir="pkg-temp" />
533    </target>
534
535    <!-- readme and proxy error page files, initialNews.xml files, GeoIP files, and flag icons -->
536    <target name="prepConsoleDocs" depends="prepConsoleDocUpdates, prepgeoupdate" >
537        <copy todir="pkg-temp/docs/initialNews/">
538          <fileset dir="installer/resources/initialNews/" />
539        </copy>
540    </target>
541
542    <!-- readme and proxy error page files -->
543    <target name="prepConsoleDocUpdates">
544        <copy todir="pkg-temp/docs/" >
545          <fileset dir="installer/resources/readme/" includes="readme*.html" />
546          <fileset dir="installer/resources/proxy/" includes="*.ht" />
547        </copy>
548    </target>
549
550    <target name="consoleDocs" depends="deletepkg-temp, prepConsoleDocs">
551        <zip destfile="docs.zip" basedir="pkg-temp" whenempty="fail" />
552    </target>
553
554    <target name="copyJavadoc" depends="javadoc">
555        <copy todir="pkg-temp/docs/javadoc" >
556          <fileset dir="build/javadoc/" />
557        </copy>
558    </target>
559
560    <target name="updater200" depends="prepupdate, preplicenses, pack200, zipit200" />
561    <target name="updater200WithJettyFixes" depends="prepjupdatefixes, preplicenses, pack200, zipit200" />
562    <target name="updater" depends="prepupdate, preplicenses, zipit" />
563    <target name="updaterWithJavadoc" depends="prepupdate, preplicenses, copyJavadoc, zipit" />
564    <target name="updaterWithGeoIP" depends="prepupdate, prepgeoupdate, preplicenses, zipit" />
565    <target name="updaterWithJetty" depends="prepjupdate, preplicenses, zipit" />
566    <target name="updaterWithJettyFixes" depends="prepjupdatefixes, preplicenses, zipit" />
567    <target name="updaterWithJettyFixesAndGeoIP" depends="prepjupdatefixes, prepgeoupdate, preplicenses, zipit" />
568    <target name="updaterSmall" depends="prepupdateSmall, zipit" />
569    <target name="updaterRouter" depends="prepupdateRouter, zipit" />
570    <target name="zipit">
571        <zip destfile="i2pupdate.zip" basedir="pkg-temp" whenempty="fail" />
572       <!-- just a test, makes almost no difference
573        <tar destfile="i2pupdate.tgz" basedir="pkg-temp" compression="gzip" />
574        <tar destfile="i2pupdate.tbz" basedir="pkg-temp" compression="bzip2" />
575       -->
576    </target>
577    <target name="zipit200">
578        <zip destfile="i2pupdate200.zip" basedir="pkg-temp" whenempty="fail" />
579    </target>
580
581    <target name="pack200">
582<!-- *nix here -->
583        <exec executable="sh" osfamily="unix" failonerror="true">
584            <arg value="-c" />
585            <arg value="for i in pkg-temp/lib/*.jar pkg-temp/webapps/*war; do echo pack200 $i; mv $i $i.jar; pack200 -g $i.pack $i.jar; rm -f $i.jar; done" />
586        </exec>
587        <exec executable="sh" osfamily="mac" failonerror="true">
588            <arg value="-c" />
589            <!-- pack200 will only pack to a .pack file, and only from a .jar file, so we put another .jar on the end -->
590            <arg value="for i in pkg-temp/lib/*.jar pkg-temp/webapps/*war; do echo pack200 $i; mv $i $i.jar; pack200 -g $i.pack $i.jar; rm -f $i.jar; done" />
591        </exec>
592<!-- windoz here : i admit, i hate escaped symbols in xml, indeed = =! -->
593                <exec executable="cmd" osfamily="windows" failonerror="true">
594                        <arg value="/c" />
595                        <arg value="for %i in (pkg-temp\webapps\*.war) do move %i %i.jar &amp;&amp; pack200 -g pkg-temp\webapps\%~ni.war.pack %i.jar &amp;&amp; del %i.jar" />
596        </exec>
597                <exec executable="cmd" osfamily="windows" failonerror="true">
598                        <arg value="/c" />
599                        <arg value="for %i in (pkg-temp\lib\*.jar) do move %i %i.jar &amp;&amp; pack200 -g pkg-temp\lib\%~ni.jar.pack %i.jar &amp;&amp; del %i.jar" />
600        </exec>
601    </target>
602
603    <target name="updateTest" depends="prepupdate">
604        <ant dir="core/java/" target="jarTest" />   
605        <copy file="core/java/build/i2ptest.jar" todir="pkg-temp/lib" />
606        <zip destfile="i2pupdate.zip" basedir="pkg-temp" />
607    </target>
608
609    <target name="prepupdate" depends="build2, prepupdateSmall, prepConsoleDocUpdates, prepCertificates">
610        <copy file="build/BOB.jar" todir="pkg-temp/lib/" />
611        <copy file="build/sam.jar" todir="pkg-temp/lib/" />
612        <copy file="build/i2psnark.jar" todir="pkg-temp/lib" />
613        <!-- include systray changes in 0.7.5 -->
614        <copy file="build/systray.jar" todir="pkg-temp/lib/" />
615        <copy file="build/desktopgui.jar" todir="pkg-temp/lib/" />
616        <copy file="build/susimail.war" todir="pkg-temp/webapps/" />
617        <copy file="build/susidns.war" todir="pkg-temp/webapps/" />
618        <!-- as of 0.7.12; someday, we can remove these from the updater -->
619        <copy file="apps/susidns/src/WEB-INF/lib/jstl.jar" todir="pkg-temp/lib/" />
620        <copy file="apps/susidns/src/WEB-INF/lib/standard.jar" todir="pkg-temp/lib/" />
621        <copy file="build/i2psnark.war" todir="pkg-temp/webapps/" />
622        <copy file="history.txt" todir="pkg-temp/" />
623        <!-- the following overwrites history.txt on unix to shrink the update file -->
624        <exec executable="head" osfamily="unix" failifexecutionfails="true" output="pkg-temp/history.txt">
625            <arg value="-n" />
626            <arg value="1500" />
627            <arg value="history.txt" />
628        </exec>
629        <exec executable="echo" osfamily="unix" failifexecutionfails="true" output="pkg-temp/history.txt" append="true">
630            <arg value="EARLIER HISTORY IS AVAILABLE IN THE SOURCE PACKAGE" />
631        </exec>
632      <!-- May be pointless now, people with split directories will never see this,
633           and for flat installs we don't want to overwrite news more recent than the update package.
634        <copy file="installer/resources/news.xml" todir="pkg-temp/docs/" />
635       -->
636    </target>
637
638    <target name="prepupdateSmall" depends="buildSmall, prepupdateRouter, prepthemeupdates">
639        <copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
640        <copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
641        <copy file="build/streaming.jar" todir="pkg-temp/lib/" />
642        <copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
643        <!-- pulled out of routerconsole.jar in 0.7.12, someday we can take out of updater -->
644        <!-- name without version so we can overwrite if we upgrade  -->
645        <copy file="apps/jrobin/jrobin-1.4.0.jar" tofile="pkg-temp/lib/jrobin.jar" />
646        <copy file="build/i2ptunnel.war" todir="pkg-temp/webapps/" />
647        <copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
648        <copy file="build/addressbook.war" todir="pkg-temp/webapps/" />
649        <!-- decapitalized the file in 0.7.8 -->
650       <copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
651    </target>
652
653    <target name="prepupdateRouter" depends="buildrouter, deletepkg-temp">
654        <copy file="build/i2p.jar" todir="pkg-temp/lib/" />
655        <copy file="build/router.jar" todir="pkg-temp/lib/" />
656    </target>
657
658    <!-- GeoIP files and flag icons -->
659    <target name="prepgeoupdate">
660        <copy file="installer/resources/geoip.txt" todir="pkg-temp/geoip/" />
661        <copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
662        <copy todir="pkg-temp/docs/icons/flags" >
663          <fileset dir="installer/resources/icons/flags" />
664        </copy>
665    </target>
666
667    <target name="prepjupdate" depends="prepupdate, buildWEB">
668        <copy file="build/jasper-compiler.jar" todir="pkg-temp/lib/" />
669        <copy file="build/jasper-runtime.jar" todir="pkg-temp/lib/" />
670        <copy file="build/commons-logging.jar" todir="pkg-temp/lib/" />
671        <copy file="build/commons-el.jar" todir="pkg-temp/lib/" />
672        <copy file="build/javax.servlet.jar" todir="pkg-temp/lib/" />
673        <copy file="build/org.mortbay.jetty.jar" todir="pkg-temp/lib/" />
674    </target>
675    <target name="prepjupdatefixes" depends="prepupdate, buildWEB">
676        <copy file="build/org.mortbay.jetty.jar" todir="pkg-temp/lib/" />
677    </target>
678    <target name="installer" depends="preppkg">
679        <taskdef name="izpack" classpath="${basedir}/installer/lib/izpack/standalone-compiler.jar" classname="com.izforge.izpack.ant.IzPackTask" />
680        <mkdir dir="pkg-temp/installer" />
681        <jar destfile="./pkg-temp/installer/copy.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Copy.class net/i2p/util/FileUtil.class">
682            <manifest><attribute name="Main-Class" value="net.i2p.util.Copy" /></manifest>
683        </jar>
684        <jar destfile="./pkg-temp/installer/delete.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Delete.class net/i2p/util/FileUtil.class">
685            <manifest><attribute name="Main-Class" value="net.i2p.util.Delete" /></manifest>
686        </jar>
687        <jar destfile="./pkg-temp/installer/exec.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Exec.class">
688            <manifest><attribute name="Main-Class" value="net.i2p.util.Exec" /></manifest>
689        </jar>
690        <!--
691          Force 1.5 pack200 output
692          Doesnt work!
693          http://jira.codehaus.org/browse/IZPACK-404
694          http://forums.sun.com/thread.jspa?threadID=773439
695          http://bfo.co.uk/blog/2010/05/13/combining_ant_jar_signatures_and_pack200.html
696        <property name="com.sun.java.util.jar.pack.package.majver" value="150" />
697        <property name="com.sun.java.util.jar.pack.package.minver" value="7" />
698        -->
699        <izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
700
701        <ant target="installerexe" />
702    </target>
703    <target name="installerexe">
704        <condition property="noExe">
705            <os arch="x86_64" />
706        </condition>
707        <condition property="noExe">
708            <os arch="amd64" />
709        </condition>
710        <condition property="noExe">
711           <not>
712            <or>
713             <os name="Linux" />
714             <os family="windows" />
715            </or>
716           </not>
717        </condition>
718        <ant target="doInstallerEXE" />
719    </target>
720    <target name="doInstallerEXE" unless="noExe">
721        <!-- now the installer exe -->
722        <taskdef name="launch4j"
723                 classname="net.sf.launch4j.ant.Launch4jTask"
724                 classpath="${basedir}/installer/lib/launch4j/launch4j.jar:${basedir}/installer/lib/launch4j/lib/xstream.jar" />
725        <launch4j configFile="./installer/i2pinstaller.xml" />
726        <launch4j configFile="./installer/i2pstandalone.xml" />
727        <!-- thazzit -->
728    </target>
729    <target name="test">
730        <ant dir="core/java/" target="test" />
731    </target>
732    <target name="junit.report">
733        <ant dir="core/java/" target="junit.report" />
734    </target>
735    <target name="clover.report">
736        <ant dir="core/java/" target="clover.report" />
737    </target>
738    <target name="test.report" depends="junit.report, clover.report"/>
739    <target name="fulltest">
740                <ant dir="core/java/" target="fulltest" />
741                <ant dir="router/java/" target="fulltest" />
742    </target>
743    <target name="fullclovertest">
744                <ant dir="core/java/" target="fullclovertest" />
745                <ant dir="router/java/" target="fullclovertest" />
746    </target>
747    <target name="syndie" >
748        <ant dir="apps/syndie/java/" target="standalone" />
749        <copy file="apps/syndie/java/syndie-standalone.zip" todir="." />
750    </target>
751    <target name="i2psnark">
752        <ant dir="apps/i2psnark/java" target="standalone" />
753        <copy file="apps/i2psnark/java/i2psnark-standalone.zip" todir="." />
754    </target>
755    <target name="slackpkg">
756        <echo message="Building Slackware package." />
757        <ant dir="Slackware/i2p/" target="slackpkg" />
758        <ant dir="Slackware/i2p-base/" target="slackpkg" />
759    </target>
760    <target name="justBOB" depends="builddepSmall">
761        <ant dir="apps/BOB/" target="onejar" />
762        <copy file="apps/BOB/dist/BOB-one.jar" todir="." />
763    </target>
764    <target name="findbugs" depends="build2">
765        <echo message="Starting findbugs, this will take a while..." />
766        <exec executable="nice" failonerror="true">
767            <arg value="findbugs"/>
768            <arg value="-textui"/>
769            <arg value="-projectName"/>
770            <arg value="i2p"/>
771            <arg value="-sortByClass"/>
772            <arg value="-xml"/>
773            <arg value="-output"/>
774            <arg value="i2p.fba"/>
775            <arg value="-auxclasspath"/>
776            <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:apps/susidns/src/WEB-INF/lib/standard.jar:apps/susidns/src/WEB-INF/lib/jstl.jar:apps/jrobin/jrobin-1.4.0.jar"/>
777            <arg value="-sourcepath"/>
778            <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/"/>
779            <!-- start of the files to be analyzed -->
780            <arg value="build/BOB.jar"/>
781            <arg value="build/addressbook.war"/>
782            <arg value="build/i2p.jar"/>
783            <arg value="build/i2psnark.jar"/>
784            <arg value="build/i2psnark.war"/>
785            <arg value="build/i2ptunnel.jar"/>
786            <arg value="build/i2ptunnel.war"/>
787            <arg value="build/jbigi.jar"/>
788            <arg value="build/mstreaming.jar"/>
789            <arg value="build/router.jar/"/>
790            <arg value="build/desktopgui.jar"/>
791            <arg value="build/routerconsole.jar"/>
792            <arg value="build/routerconsole.war"/>
793            <arg value="build/sam.jar"/>
794            <arg value="build/streaming.jar"/>
795            <arg value="build/susidns.war"/>
796            <arg value="build/susimail.war"/>
797            <arg value="build/systray.jar"/>
798        </exec>
799        <echo message="Findbugs output stored in i2p.fba" />
800        <echo message="Now run: findbugs i2p.fba" />
801    </target>
802
803    <!-- this is the same dependency as pkg, but with updater200 in the middle,
804         since preppkg puts too much stuff in pkg-temp -->
805    <target name="release" depends="distclean, updater, updater200, preppkg, installer" >
806        <echo message="================================================================" />
807        <echo message="Did you update these files?" />
808        <exec executable="ls" failonerror="true">
809            <arg value="-l" />
810            <arg value="history.txt" />
811            <arg value="installer/install.xml" />
812            <arg value="installer/resources/news.xml" />
813            <arg value="core/java/src/net/i2p/CoreVersion.java" />
814            <arg value="router/java/src/net/i2p/router/RouterVersion.java" />
815        </exec>
816        <echo message="Everything is checked in, right? Let's be sure:" />
817        <exec executable="mtn" failonerror="true">
818            <arg value="st" />
819        </exec>
820        <echo message="If there are any modified files above, stop now!" />
821        <!-- get release version number -->
822        <exec executable="grep" outputproperty="versionLine" failonerror="true" >
823            <arg value="public final static String VERSION" />
824            <arg value="core/java/src/net/i2p/CoreVersion.java" />
825        </exec>
826        <exec executable="cut" inputstring="${versionLine}" outputproperty="release.number" failonerror="true" >
827            <arg value="-f2" />
828            <arg value="-d&quot;" />
829        </exec>
830        <echo message="New version number is ${release.number}" />
831        <copy file="i2pupdate.zip" tofile="i2pupdate_${release.number}.zip" />
832        <copy file="i2pinstall.exe" tofile="i2pinstall_${release.number}.exe" />
833        <delete file="i2pupdate.sud" failonerror="false" />
834        <delete file="i2pupdate.su2" failonerror="false" />
835        <input message="Enter private signing key file:" addproperty="release.privkey" />
836        <fail message="You must enter a path." >
837            <condition>
838                <equals arg1="${release.privkey}" arg2=""/>
839            </condition>
840        </fail>
841        <echo message="Key file is ${release.privkey}" />
842        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
843            <classpath>
844                <pathelement location="build/i2p.jar" />
845            </classpath>
846            <arg value="sign" />
847            <arg value="i2pupdate.zip" />
848            <arg value="i2pupdate.sud" />
849            <arg value="${release.privkey}" />
850            <arg value="${release.number}" />
851        </java>
852        <echo message="Verify version and VALID signature:" />
853        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
854            <classpath>
855                <pathelement location="build/i2p.jar" />
856            </classpath>
857            <arg value="verifysig" />
858            <arg value="i2pupdate.sud" />
859        </java>
860        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
861            <classpath>
862                <pathelement location="build/i2p.jar" />
863            </classpath>
864            <arg value="showversion" />
865            <arg value="i2pupdate.sud" />
866        </java>
867        <!-- now build and verify the packed sud from the packed zip -->
868        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
869            <classpath>
870                <pathelement location="build/i2p.jar" />
871            </classpath>
872            <arg value="sign" />
873            <arg value="i2pupdate200.zip" />
874            <arg value="i2pupdate.su2" />
875            <arg value="${release.privkey}" />
876            <arg value="${release.number}" />
877        </java>
878        <echo message="Verify version and VALID signature:" />
879        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
880            <classpath>
881                <pathelement location="build/i2p.jar" />
882            </classpath>
883            <arg value="verifysig" />
884            <arg value="i2pupdate.su2" />
885        </java>
886        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
887            <classpath>
888                <pathelement location="build/i2p.jar" />
889            </classpath>
890            <arg value="showversion" />
891            <arg value="i2pupdate.su2" />
892        </java>
893        <!-- will this use the monotonerc file in the current workspace? -->
894        <echo message="Checking out fresh copy into ../i2p-${release.number} for tarballing:" />
895        <delete dir="../i2p-${release.number}" />
896        <exec executable="mtn" failonerror="true">
897            <arg value="co" />
898            <arg value="-b" />
899            <arg value="i2p.i2p" />
900            <!-- w: is the revision of the current workspace -->
901            <arg value="-r" />
902            <arg value="w:" />
903            <arg value="../i2p-${release.number}/" />
904        </exec>
905        <exec executable="tar" failonerror="true">
906            <arg value="cjf" />
907            <arg value="i2psource_${release.number}.tar.bz2" />
908            <arg value="-C" />
909            <arg value=".." />
910            <arg value="--exclude" />
911            <arg value="i2p-${release.number}/_MTN*" />
912            <arg value="i2p-${release.number}/" />
913        </exec>
914        <echo message="Sign the files:" />
915        <delete file="i2pinstall_${release.number}.exe.sig" />
916        <delete file="i2psource_${release.number}.tar.bz2.sig" />
917        <delete file="i2pupdate_${release.number}.zip.sig" />
918        <exec executable="gpg" failonerror="true">
919            <arg value="-b" />
920            <arg value="i2pinstall_${release.number}.exe" />
921        </exec>
922        <exec executable="gpg" failonerror="true">
923            <arg value="-b" />
924            <arg value="i2psource_${release.number}.tar.bz2" />
925        </exec>
926        <exec executable="gpg" failonerror="true">
927            <arg value="-b" />
928            <arg value="i2pupdate_${release.number}.zip" />
929        </exec>
930        <echo message="File sizes:" />
931        <exec executable="ls" failonerror="true">
932            <arg value="-l" />
933            <arg value="i2pinstall_${release.number}.exe" />
934            <arg value="i2psource_${release.number}.tar.bz2" />
935            <arg value="i2pupdate_${release.number}.zip" />
936            <arg value="i2pupdate.su2" />
937            <arg value="i2pupdate.sud" />
938            <arg value="i2pinstall_${release.number}.exe.sig" />
939            <arg value="i2psource_${release.number}.tar.bz2.sig" />
940            <arg value="i2pupdate_${release.number}.zip.sig" />
941        </exec>
942        <echo message="SHA256 sums:" />
943        <exec executable="sha256sum" failonerror="true">
944            <arg value="i2pinstall_${release.number}.exe" />
945            <arg value="i2psource_${release.number}.tar.bz2" />
946            <arg value="i2pupdate_${release.number}.zip" />
947            <arg value="i2pupdate.su2" />
948            <arg value="i2pupdate.sud" />
949        </exec>
950        <echo message="Don't forget to mtn tag w: i2p-${release.number}" />
951        <echo message="... and mtn cert t:i2p-${release.number} branch i2p.i2p.release" />
952    </target>
953
954    <target name="debian" depends="distclean, debian-source, debian-binary" />
955
956    <target name="debian-binary">
957        <echo message="Did you update the version in these files?" />
958        <exec executable="ls" failonerror="true">
959            <arg value="-l" />
960            <arg value="debian/changelog" />
961        </exec>
962        <echo message="====================" />
963        <!-- bundle the 20MB jetty 5 lib since there probably isn't a deb for it -->
964        <ant dir="apps/jetty" target="ensureJettylib" />
965       
966        <exec dir="debian" executable="./buildpackage.sh" failonerror="true">
967            <arg value="i386" />
968        </exec>
969        <exec dir="debian" executable="./buildpackage.sh" failonerror="true">
970            <arg value="amd64" />
971        </exec>
972    </target>
973    <target name="debian-source">
974        <!-- bundle the 20MB jetty 5 lib since there probably isn't a deb for it -->
975        <ant dir="apps/jetty" target="ensureJettylib" />
976        <echo message="Did you update the version in these files?" />
977        <exec executable="ls" failonerror="true">
978            <arg value="-l" />
979            <arg value="debian/changelog" />
980        </exec>
981        <echo message="====================" />
982        <exec dir="debian" executable="./buildpackage.sh" failonerror="true">
983            <arg value="source" />
984        </exec>
985    </target>
986    <target name="debianrepo" depends="debian">
987        <exec dir="debian" executable="./makerepo.sh" failonerror="true"/>
988    </target>
989
990<!-- the following are appened to help build barebone portable version,
991     none of the above is modified for this purpose -->
992        <target name = "pkg-portable-clean">
993                <delete dir="build/" />
994                <delete dir="pkg-temp/" />
995                <delete>
996                        <fileset dir="." includes="portable-**.zip**" />
997                </delete>
998        </target>
999<!-- build a portable archive -->
1000
1001<!-- *0* Since we simply pack all files in folder "build/" into our archieve,
1002                we need to make sure its small, with NO redundent jars or wars.
1003                thus cleaning is required before each build-->
1004        <target name="buildSmallOnly" depends="pkg-portable-clean,buildSmall"/>
1005<!-- *1* preparing the jars by OS dependent de-bloating -->
1006        <target name="preppkg-portable-win32-jbigi" depends="buildSmallOnly">
1007                <!-- rip the non-windows stuff out of jbigi.jar -->
1008                <mkdir dir="tmpextract" />
1009                <unjar src="build/jbigi.jar" dest="tmpextract/" />
1010                <jar destfile="build/jbigi.jar" >
1011                        <fileset dir="tmpextract/" includes="*windows*" />
1012                </jar>
1013                <delete dir="tmpextract/" />
1014        </target>
1015        <target name="preppkg-portable-linux-jbigi"  depends="buildSmallOnly">
1016                <!-- rip the non-linux stuff out of jbigi.jar -->
1017                <mkdir dir="tmpextract" />
1018                <unjar src="build/jbigi.jar" dest="tmpextract/" />
1019                <jar destfile="build/jbigi.jar" >
1020                        <fileset dir="tmpextract/" includes="*linux*" />
1021                </jar>
1022                <delete dir="tmpextract/" />
1023        </target>
1024
1025<!-- *2* os independent procedure  -->
1026        <target name="preppkg-portable-basic" >
1027                <mkdir dir="pkg-temp" />
1028                        <!-- non OS dependent configurations only, dont add *nux/win stuff here -->
1029                        <copy todir="pkg-temp">
1030                                <fileset dir="installer/resources/portable/configs/" />
1031                        </copy>
1032                        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
1033                        <copy file="installer/resources/hosts.txt" todir="pkg-temp/" />
1034                        <copy file="installer/resources/readme.license.txt" todir="pkg-temp/" />
1035                <mkdir dir="pkg-temp/addressbook" />
1036                        <copy file="apps/addressbook/subscriptions.txt" todir="pkg-temp/addressbook/" />
1037                        <copy file="apps/addressbook/myhosts.txt"  todir="pkg-temp/addressbook/" />
1038                        <!-- config.txt is in installer/resources/portable -->
1039                <mkdir dir="pkg-temp/docs" />
1040                        <copy file="installer/resources/initialNews.xml" tofile="pkg-temp/docs/news.xml" overwrite="true" />
1041                        <copy file="installer/resources/readme/readme.html" tofile="pkg-temp/docs/readme.html" />
1042                        <copy file="installer/resources/startconsole.html" todir="pkg-temp/docs/" />
1043                        <copy file="installer/resources/start.ico" todir="pkg-temp/docs/" />
1044                        <copy file="installer/resources/console.ico" todir="pkg-temp/docs/" />
1045                        <!-- HTTP Header files, english only,
1046                                if you need a different lang do it in a seperate target -->
1047                        <copy todir="pkg-temp/docs/" >
1048                                <fileset dir="installer/resources/proxy/"  includes="**-header.ht" />
1049                        </copy>
1050                        <!-- Theme light only -->
1051                        <copy todir="pkg-temp/docs/themes/console/light/" overwrite="true" >
1052                                <fileset dir="installer/resources/themes/console/light/" includes="**.css" />
1053                        </copy>
1054                        <copy file="installer/resources/themes/console/light/console_big.css" todir="portable/docs/themes/console/light/" />
1055                        <copy todir="pkg-temp/docs/themes/console/images/" >
1056                                <fileset dir="installer/resources/themes/console/images/" />
1057                        </copy>
1058                        <!-- FLAGs for language icon (not for ip)-->
1059                        <copy todir="pkg-temp/docs/icons/flags" >
1060                                <fileset dir="installer/resources/icons/flags/" includes="cn.png,de.png,fr.png,nl.png,ru.png,se.png,us.png" />
1061                        </copy>
1062                <mkdir dir="pkg-temp/webapps" />
1063                        <copy todir="pkg-temp/webapps/">
1064                                <fileset dir="build/" includes="**.war" />
1065                        </copy>
1066                <mkdir dir="pkg-temp/lib" />
1067                        <copy todir ="pkg-temp/lib/" >
1068                                <fileset dir="build/" includes="**.jar" />
1069                        </copy>
1070                        <!-- 3rd party jars from apps/  -->
1071                                <!-- jrobin - without jobin , you lost graph and get a lot error entry in logs -->
1072                        <copy file="apps/jrobin/jrobin-1.4.0.jar" tofile="pkg-temp/lib/jrobin.jar" />
1073        </target>
1074<!-- *3* os dependent procedure/commands -->
1075        <target name = "preppkg-portable-win32" depends="preppkg-portable-win32-jbigi,preppkg-portable-basic">
1076                        <!-- systray4.j  - why do we need trayicons for portable version ? dependency hardcoded in console -->
1077                <copy file="apps/systray/java/lib/systray4j.dll" todir="pkg-temp/lib" />
1078                <copy file="apps/systray/java/lib/systray4j.jar" todir="pkg-temp/lib" />
1079                        <!--wrapper - dont even think about it. i2p cosumes appreantly more mem without it on win32-->
1080                <copy file="installer/lib/wrapper/win32/wrapper.dll" todir="pkg-temp/lib" />
1081                <copy file="installer/lib/wrapper/win32/wrapper.jar" todir="pkg-temp/lib" />
1082                <copy file="installer/lib/wrapper/win32/I2Psvc.exe" tofile="pkg-temp/i2psvc.ex_" />
1083                        <!--  copy the unpack/start batchfiles -->
1084                <copy todir="pkg-temp">
1085                        <fileset dir="installer/resources/portable/win32/" />
1086                </copy>
1087        </target>
1088<!-- *4* command for windows package -->
1089        <target name = "pkg-portable-win32"     depends="preppkg-portable-win32, pack200" >
1090                <!-- i need the portable\ folder in .zip so basedir is set to . -->
1091                <move file="pkg-temp" tofile="portable"/>
1092                <zip destfile="portable-win32.zip" basedir="." level="9" includes="portable\**" />
1093                <checksum file="portable-win32.zip" forceOverwrite="yes"/>
1094                <move file="portable" tofile="pkg-temp"/>
1095        </target>
1096</project>
Note: See TracBrowser for help on using the repository browser.