source: build.xml @ 18119890

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

unbundle jbigi.jar, create at build time

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