source: build.xml @ be7770e

Last change on this file since be7770e was be7770e, checked in by kytv <kytv@…>, 9 years ago

Add EXTRAVERSION to the build number, custom installers, javadocs

With this check-in I'm adding the EXTRAVERSION to our javadocs and the custom
installer targets (if EXTRAVERSION is set in RouterVersion?.java). Also,
i2pinstall*jar and i2pinstall.bz2 will be removed when ant clean is run.

  • Property mode set to 100644
File size: 76.0 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    <!-- change this to false if you don't have gettext -->
17    <property name="require.gettext" value="true" />
18    <!-- Include property files so that values can be easily overridden. Currently just useful for javadoc hosters -->
19    <property file="override.properties"/>
20    <property file="build.properties"/>
21
22    <!-- You probably don't want to change anything from here down -->
23    <target name="help" depends="all" />
24    <target name="all" >
25        <echo message="Useful targets: " />
26        <echo message="  pkg:       distclean then package everything up (installer, clean tarball, update tarball)" />
27        <echo message="  dist:      pkg and javadoc" />
28        <echo message="  installer: build the GUI installer" />
29        <echo message="  installer-freebsd: build the GUI installer (FreeBSD only)" />
30        <echo message="  installer-linux: build the GUI installer (Linux only)" />
31        <echo message="  installer-osx: build the GUI installer (OSX only)" />
32        <echo message="  installer-windows: build the GUI installer (Windows only)" />
33        <echo message="  tarball:   tar the full install into i2p.tar.bz2 (extracts to build a new clean install)" />
34        <echo message="  updater:   Package the built files in i2pupdate.zip (extracts safely over existing installs)" />
35        <echo message="  updater200: Updater compressed with pack200 (creates i2pupdate200.zip, 60% smaller)" />
36        <echo message="  updaterWithJavadoc: updater including the javadocs, for display in the console" />
37        <echo message="  updater200WithJavadoc: updater including the javadocs, for display in the console (creates i2pupdate200.zip)" />
38        <echo message="  updaterWithJetty: Updater including Jetty" />
39        <echo message="  updaterWithJettyFixes: updater including local jetty patches" />
40        <echo message="  updaterWithGeoIP: updater including GeoIP Files" />
41        <echo message="  updaterWithJettyFixesAndGeoIP" />
42        <echo message="  updaterWithJettyFixesAndJbigi" />
43        <echo message="  updaterSmall:   updater with the essentials only - no SAM, i2psnark, SusiMail, SusiDNS, news.xml, or history.txt" />
44        <echo message="  updaterRouter:  updater with the i2p.jar and router.jar only" />
45        <echo message="  distclean: clean up all derived files" />
46        <!-- <echo message="  syndie:    generate a standalone syndie install" /> -->
47        <echo message="  desktopgui: generate a standalone desktopgui install" />
48        <echo message="  i2psnark:  generate a standalone i2psnark install" />
49        <echo message="  justBOB:  generate a standalone BOB-one.jar" />
50        <echo message="  javadoc:   generate javadoc for the entire project into ./build/javadoc" />
51        <echo message="  slackpkg:  generate Slackware packages in ./Slackware/i2p and ./Slackware/i2p-base" />
52        <echo message="  debianhowto: instructions on building Debian packages" />
53        <echo message="  debian: generate Debian packages in ../" />
54        <echo message="          run &quot;ant debianhowto&quot; for instructions" />
55        <echo message="  debian-clean: rollback debian specific patches and run the &quot;distclean&quot; target (done automatically at the end of the &quot;debian&quot; target)" />
56        <!-- <echo message="  debianrepo: build a Debian repository (reprepro required)" /> -->
57        <echo message="  poupdate: update the .po files for translators" />
58        <echo message="  pkg-portable-win32:  build a minimum portable version for win32" />
59   </target>
60    <target name="debianhowto">
61            <echo message="To build debian packages, you must make sure that you have" />
62            <echo message="the necessary build-dependencies installed." />
63            <echo message="The packages required to build can be found in the file "/>
64            <echo message="&quot;debian/control&quot; in both the Build-Depends and Build-Depends-Indep fields."/>
65            <echo message="In addition to those packages, be sure to install &quot;fakeroot&quot;,"/>
66            <echo message="&quot;quilt&quot; and &quot;build-essential&quot;!" />
67            <echo message="" />
68            <echo message="The following command will install all dependencies for you:" />
69            <echo message="apt-get install debhelper ant debconf default-jdk gettext libgmp3-dev po-debconf fakeroot build-essential quilt" />
70            <echo message=" " />
71            <echo message="Once the dependencies are installed, run &quot;ant debian&quot;"/>
72            <echo message="to patch the source and build the packages." />
73    </target>
74    <target name="dist" depends="pkg, javadoc">
75    </target>
76    <target name="build" depends="build2">
77        <!-- so we don't build standalone for the updater -->
78        <!-- This builds apps/i2psnark/java/i2psnark-standalone.zip,
79          -   which we don't distribute anywhere...
80        <ant dir="apps/i2psnark/java/" target="standalone" />
81        -->
82    </target>
83    <target name="build2" depends="builddep, jar, buildWEB" />
84    <target name="buildSmall" depends="builddepSmall, jarSmall, buildWEB" />
85    <target name="buildclean" depends="distclean, build" />
86
87    <target name="builddep" depends="builddepSmall, buildBOB, buildSAM, buildSusiMail, buildSusiDNS, buildI2PSnark" />
88
89    <target name="builddepSmall" depends="buildrouter, buildSystray, buildDesktopGui, buildRouterConsole, buildStreaming, buildI2PTunnel, buildAddressbook" />
90
91    <!-- start of buildX, one for each sub-build.xml.
92         Do not put ant tasks in the sub-build.xmls anymore,
93         so the build will go faster.
94      -->
95
96    <target name="buildBOB" depends="buildStreaming" >
97        <ant dir="apps/BOB/" target="jar" />
98    </target>
99
100    <target name="buildSAM" depends="buildStreaming" >
101        <ant dir="apps/sam/java/" target="jar" />
102    </target>
103
104    <target name="buildSusiMail" depends="buildCore, buildJetty" >
105        <ant dir="apps/susimail/" target="war" />
106    </target>
107
108    <target name="buildSusiDNS" depends="buildCore, buildJetty" >
109        <ant dir="apps/susidns/src" target="all" />
110    </target>
111
112    <target name="buildI2PSnark" depends="buildStreaming, buildJetty" >
113        <ant dir="apps/i2psnark/java/" target="war" />
114    </target>
115
116    <target name="buildAddressbook" depends="buildCore, buildJetty" >
117        <ant dir="apps/addressbook/" target="war" />
118    </target>
119
120    <target name="buildI2PTunnel" depends="buildStreaming, buildJetty" >
121        <ant dir="apps/i2ptunnel/java/" target="build" />
122    </target>
123
124    <target name="buildDesktopGui" depends="buildCore, buildrouter" >
125<!--
126        <ant dir="apps/desktopgui" target="clean" />
127-->
128        <ant dir="apps/desktopgui" target="jar" />
129    </target>
130
131    <target name="buildRouterConsole" depends="buildrouter, buildSystray, buildDesktopGui, buildJetty" >
132        <ant dir="apps/routerconsole/java/" target="jar" />
133    </target>
134
135    <target name="buildJetty" depends="buildProperties" >
136        <ant dir="apps/jetty" target="build" />
137    </target>
138
139    <target name="buildSystray" depends="buildCore" >
140        <ant dir="apps/systray/java/" target="jar" />
141    </target>
142
143    <target name="buildStreaming" depends="buildMinistreaming" >
144        <ant dir="apps/streaming/java/" target="jar" />
145    </target>
146
147    <target name="buildMinistreaming" depends="buildCore" >
148        <ant dir="apps/ministreaming/java/" target="jar" />
149    </target>
150
151    <target name="buildRouter" depends="buildrouter" />
152    <target name="buildrouter" depends="buildCore" >
153        <ant dir="router/java/" target="jar" />
154        <copy file="router/java/build/router.jar" todir="build/" />
155    </target>
156
157    <target name="buildCore" depends="buildProperties" >
158        <ant dir="core/java/" target="jar" />
159        <copy file="core/java/build/i2p.jar" todir="build/" />
160    </target>
161
162    <target name="buildJrobin" depends="buildProperties" >
163        <!-- take only what we need from the jrobin jar -->
164        <jar destfile="build/jrobin.jar" >
165            <zipfileset src="apps/jrobin/jrobin-1.5.9.1.jar"
166                        excludes="org/jrobin/cmd/ org/jrobin/convertor/ org/jrobin/inspector/" />
167            <manifest>
168                <attribute name="Build-Date" value="${build.timestamp}" />
169                <attribute name="Base-Revision" value="${workspace.version}" />
170            </manifest>
171        </jar>
172    </target>
173
174    <target name="checkForMtn" >
175        <available property="mtn.available" file="_MTN" type="dir" />
176    </target>
177
178    <target name="getMtnRev" depends="checkForMtn" if="mtn.available" >
179        <exec executable="mtn" outputproperty="workspace.version" errorproperty="mtn.error1" failifexecutionfails="false" >
180            <arg value="automate" />
181            <arg value="get_base_revision_id" />
182        </exec>
183    </target>
184
185    <target name="buildProperties" depends="getMtnRev" >
186        <!-- default if not set above -->
187        <property name="workspace.version" value="unknown" />
188        <tstamp>
189            <format property="build.timestamp" pattern="yyyy-MM-dd HH:mm:ss z" timezone="UTC" locale="en" />
190        </tstamp>
191    </target>
192
193    <!-- end of sub-build.xml targets -->
194
195    <target name="buildWEB" depends="buildRouterConsole" >
196        <copy file="apps/routerconsole/java/build/routerconsole.jar" todir="build/" />
197        <copy file="apps/routerconsole/java/build/routerconsole.war" todir="build/" />
198        <copy file="apps/jetty/jettylib/org.mortbay.jetty.jar" todir="build/" />
199        <copy file="apps/jetty/jettylib/jasper-compiler.jar" todir="build/" />
200        <copy file="apps/jetty/jettylib/jasper-runtime.jar" todir="build/" />
201        <copy file="apps/jetty/jettylib/commons-logging.jar" todir="build/" />
202        <copy file="apps/jetty/jettylib/commons-el.jar" todir="build/" />
203        <copy file="apps/jetty/jettylib/javax.servlet.jar" todir="build/" />
204    </target>
205
206    <target name="buildexe">
207        <condition property="noExe">
208            <os arch="x86_64" />
209        </condition>
210        <condition property="noExe">
211            <os arch="ppc" />
212        </condition>
213        <condition property="noExe">
214            <os arch="armv5tejl" />
215        </condition>
216        <condition property="noExe">
217            <os arch="amd64" />
218        </condition>
219        <condition property="noExe">
220           <not>
221            <or>
222             <os name="Linux" />
223             <os family="windows" />
224            </or>
225           </not>
226        </condition>
227        <ant target="doBuildEXE" />
228    </target>
229
230    <taskdef name="launch4j"
231             classname="net.sf.launch4j.ant.Launch4jTask"
232             classpath="${basedir}/installer/lib/launch4j/launch4j.jar:${basedir}/installer/lib/launch4j/lib/xstream.jar" />
233
234    <target name="doBuildEXE" depends="buildProperties" unless="noExe">
235        <jar destfile="./build/launchi2p.jar">
236            <manifest>
237             <attribute name="Main-Class" value="net.i2p.router.RouterLaunch" />
238             <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" />
239             <attribute name="Build-Date" value="${build.timestamp}" />
240             <attribute name="Base-Revision" value="${workspace.version}" />
241            </manifest>
242        </jar>
243        <!-- now the standalone launcher exe -->
244        <launch4j configFile="./installer/i2pstandalone.xml" />
245        <!-- thazzit -->
246    </target>
247
248    <target name="jar" depends="jarSmall" >
249        <copy file="apps/BOB/dist/BOB.jar" todir="build/" />
250        <copy file="apps/sam/java/build/sam.jar" todir="build/" />
251        <copy file="apps/susimail/susimail.war" todir="build/" />
252        <copy file="apps/susidns/src/susidns.war" todir="build/" />
253        <copy file="apps/i2psnark/i2psnark.war" todir="build/" />
254        <copy file="apps/i2psnark/java/build/i2psnark.jar" todir="build/" />
255
256    </target>
257    <target name="jarSmall" depends="builddepSmall, buildJrobin" >
258        <copy file="core/java/build/i2p.jar" todir="build/" />
259        <copy file="router/java/build/router.jar" todir="build/" />
260        <copy file="apps/ministreaming/java/build/mstreaming.jar" todir="build/" />
261        <copy file="apps/streaming/java/build/streaming.jar" todir="build/" />
262        <copy file="apps/i2ptunnel/java/build/i2ptunnel.jar" todir="build/" />
263        <copy file="apps/i2ptunnel/java/build/i2ptunnel.war" todir="build/" />
264        <copy file="apps/systray/java/build/systray.jar" todir="build/" />
265        <copy file="apps/desktopgui/dist/desktopgui.jar" todir="build/" />
266        <copy file="apps/addressbook/dist/addressbook.war" todir="build/" />
267    </target>
268
269    <target name="jbigi-list-changes" depends="checkForMtn" if="mtn.available" >
270        <exec executable="mtn" outputproperty="workspace.changes.jbigi" errorproperty="mtn.error.jbigi" failifexecutionfails="false" >
271            <arg value="list" />
272            <arg value="changed" />
273            <arg value="installer/lib/jbigi" />
274        </exec>
275        <!-- \n in an attribute value generates an invalid manifest -->
276        <exec executable="tr" inputstring="${workspace.changes.jbigi}" outputproperty="workspace.changes.jbigi.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
277            <arg value="-s" />
278            <arg value="&quot;[:space:]&quot;" />
279            <arg value="," />
280        </exec>
281    </target>
282
283    <target name="jbigi" depends="buildProperties, jbigi-list-changes" >
284        <!-- set if unset -->
285        <property name="workspace.changes.jbigi.tr" value="" />
286        <jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
287            <fileset dir="installer/lib/jbigi" includes="*.so *.dll *.jnilib" />
288            <manifest>
289                <attribute name="Build-Date" value="${build.timestamp}" />
290                <attribute name="Base-Revision" value="${workspace.version}" />
291                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
292            </manifest>
293        </jar>
294    </target>
295   
296    <!-- Now system-specific jbigis in alphabetical order -->
297    <target name="jbigi-freebsd-only"  depends="buildProperties, jbigi-list-changes" >
298        <!-- set if unset -->
299        <property name="workspace.changes.jbigi.tr" value="" />
300        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
301            <fileset dir="installer/lib/jbigi" includes="*freebsd*.so" />
302            <manifest>
303                <attribute name="Build-Date" value="${build.timestamp}" />
304                <attribute name="Base-Revision" value="${workspace.version}" />
305                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
306            </manifest>
307        </jar>
308    </target>
309
310    <target name="jbigi-linux-only"  depends="buildProperties, jbigi-list-changes" >
311        <!-- set if unset -->
312        <property name="workspace.changes.jbigi.tr" value="" />
313        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
314            <fileset dir="installer/lib/jbigi" includes="*linux*.so" />
315            <manifest>
316                <attribute name="Build-Date" value="${build.timestamp}" />
317                <attribute name="Base-Revision" value="${workspace.version}" />
318                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
319            </manifest>
320        </jar>
321    </target>
322
323    <target name="jbigi-linux-nonx86-only"  depends="buildProperties, jbigi-list-changes" >
324        <!-- set if unset -->
325        <property name="workspace.changes.jbigi.tr" value="" />
326        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
327            <fileset dir="installer/lib/jbigi" includes="*linux-arm*.so,*linux-ppc*.so" />
328            <manifest>
329                <attribute name="Build-Date" value="${build.timestamp}" />
330                <attribute name="Base-Revision" value="${workspace.version}" />
331                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
332            </manifest>
333        </jar>
334    </target>
335
336    <target name="jbigi-osx-only"  depends="buildProperties, jbigi-list-changes" >
337        <!-- set if unset -->
338        <property name="workspace.changes.jbigi.tr" value="" />
339        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
340            <fileset dir="installer/lib/jbigi" includes="*.jnilib" />
341            <manifest>
342                <attribute name="Build-Date" value="${build.timestamp}" />
343                <attribute name="Base-Revision" value="${workspace.version}" />
344                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
345            </manifest>
346        </jar>
347    </target>
348
349    <target name="jbigi-windows-only" depends="buildProperties, jbigi-list-changes" >
350        <!-- set if unset -->
351        <property name="workspace.changes.jbigi.tr" value="" />
352        <jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
353            <fileset dir="installer/lib/jbigi" includes="*windows*.dll" />
354            <manifest>
355                <attribute name="Build-Date" value="${build.timestamp}" />
356                <attribute name="Base-Revision" value="${workspace.version}" />
357                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
358            </manifest>
359        </jar>
360    </target>
361
362    <!-- the apps need to compile the jsps to poupdate -->
363    <target name="poupdate" depends="buildRouter, buildStreaming, buildSystray, buildJetty, buildDesktopGui" >
364        <echo message="Setting environment variable LG2 to a lang code (eg: de,zh,nl etc)" />
365        <echo message=" will restrict language update to the language you specified, leaving other language untact." />
366        <ant dir="apps/routerconsole/java/" target="poupdate" />
367        <ant dir="apps/i2psnark/java/" target="poupdate" />
368        <ant dir="apps/i2ptunnel/java/" target="poupdate" />
369        <ant dir="apps/susidns/src/" target="poupdate" />
370        <ant dir="apps/susimail/" target="poupdate" />
371        <ant dir="apps/desktopgui" target="poupdate" />
372    </target>
373
374    <target name="javadoc" depends="getReleaseNumber, getBuildNumber" >
375        <ant dir="apps/jetty" target="ensureJettylib" />
376        <mkdir dir="./build" />
377        <mkdir dir="./build/javadoc" />
378        <javadoc access="package"
379            destdir="./build/javadoc"
380            packagenames="*"
381            use="true"
382            splitindex="true"
383            doctitle="I2P Javadocs for Release ${release.number} Build ${build.number}${build.extra}"
384            windowtitle="I2P Anonymous Network - Java Documentation - Version ${release.number}">
385            <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:net.metanotion:net.metanotion.*" />
386            <group title="Streaming Library" packages="net.i2p.client.streaming" />
387            <group title="Router" packages="net.i2p.router:net.i2p.router.*:net.i2p.data.i2np:org.cybergarage.*:org.freenetproject" />
388            <group title="Router Console" packages="net.i2p.router.web" />
389            <!-- apps and bridges starting here, alphabetical please -->
390            <group title="Addressbook Application" packages="net.i2p.addressbook" />
391            <group title="BOB Bridge" packages="net.i2p.BOB" />
392            <group title="Desktopgui Application" packages="net.i2p.desktopgui:net.i2p.desktopgui.*" />
393            <group title="I2PSnark Application" packages="org.klomp.snark:org.klomp.snark.*" />
394            <group title="I2PTunnel Application" packages="net.i2p.i2ptunnel:net.i2p.i2ptunnel.*" />
395            <group title="SAM Bridge" packages="net.i2p.sam:net.i2p.sam.client" />
396            <group title="SusiDNS Application" packages="i2p.susi.dns" />
397            <group title="SusiMail Application" packages="i2p.susi.webmail:i2p.susi.webmail.*:i2p.susi.debug:i2p.susi.util" />
398            <group title="Systray Application" packages="net.i2p.apps.systray" />
399            <sourcepath>
400                <pathelement location="core/java/src" />
401                <!--<pathelement location="core/java/test" />-->
402                <pathelement location="router/java/src" />
403                <!--<pathelement location="router/java/test" />-->
404                <pathelement location="apps/ministreaming/java/src" />
405                <pathelement location="apps/streaming/java/src" />
406                <pathelement location="apps/i2ptunnel/java/src" />
407                <pathelement location="apps/systray/java/src" />
408                <pathelement location="apps/desktopgui/src" />
409                <pathelement location="apps/routerconsole/java/src" />
410                <pathelement location="apps/addressbook/java/src" />
411                <pathelement location="apps/i2psnark/java/src" />
412                <pathelement location="apps/sam/java/src" />
413                <pathelement location="apps/BOB/src" />
414                <pathelement location="apps/susidns/src/java/src" />
415                <pathelement location="apps/susimail/src/src" />
416            </sourcepath>
417            <classpath>
418                <pathelement location="apps/jetty/jettylib/org.mortbay.jetty.jar" />
419                <pathelement location="apps/jetty/jettylib/javax.servlet.jar" />
420                <pathelement location="apps/systray/java/lib/systray4j.jar" />
421                <pathelement location="apps/jrobin/jrobin-1.5.9.1.jar" />
422                <pathelement location="installer/lib/wrapper/all/wrapper.jar" />
423                <pathelement location="core/lib/junit.jar" />
424            </classpath>
425            <!-- These variables are stored in build.properties.
426                 End-users can override by creating the file override.properties -->
427            <link offline="true" href="${javasedocs.url}" packagelistLoc="installer/resources/package-lists/java/" />
428            <link offline="true" href="${jettydocs.url}" packagelistLoc="installer/resources/package-lists/jetty/" />
429            <link offline="true" href="${jrobindocs.url}" packagelistLoc="installer/resources/package-lists/jrobin/" />
430            <link offline="true" href="${wrapperdocs.url}" packagelistLoc="installer/resources/package-lists/wrapper/" />
431        </javadoc>
432        <echo message="Warning, javadoc embeds timestamps in the output, run with 'TZ=UTC ant javadoc' if you plan to distribute" />
433    </target>
434
435    <target name="getReleaseNumber" >
436        <exec executable="grep" outputproperty="versionLine" failonerror="true" >
437            <arg value="public final static String VERSION" />
438            <arg value="core/java/src/net/i2p/CoreVersion.java" />
439        </exec>
440        <exec executable="cut" osfamily="unix" inputstring="${versionLine}" outputproperty="release.number" failonerror="true" >
441            <arg value="-f2" />
442            <arg value="-d&quot;" />
443        </exec>
444        <exec executable="cut" osfamily="mac" inputstring="${versionLine}" outputproperty="release.number" failonerror="true" >
445            <arg value="-f2" />
446            <arg value="-d&quot;"/>
447        </exec>
448        <exec executable="cut" osfamily="windows" inputstring="${versionLine}" outputproperty="release.number" failonerror="true" >
449            <arg value="-f2" />
450            <arg value="-d&quot;\&quot;&quot;"/>
451        </exec>
452        <echo message="Release number is ${release.number}" />
453    </target>
454
455    <target name="getBuildNumber" >
456        <exec executable="grep" outputproperty="buildLine" >
457            <arg value="public final static long BUILD" />
458            <arg value="router/java/src/net/i2p/router/RouterVersion.java" />
459        </exec>
460        <exec executable="cut" inputstring="${buildLine}" outputproperty="build.temp" failonerror="true" >
461            <arg value="-f2" />
462            <arg value="-d=" />
463        </exec>
464        <exec executable="tr" inputstring="${build.temp}" outputproperty="build.temp.tr" failonerror="true">
465            <arg value="-d" />
466            <arg value="&quot;[:space:]&quot;"/>
467        </exec>
468        <exec executable="cut" inputstring="${build.temp.tr}" outputproperty="build.number" failonerror="true" >
469            <arg value="-f1" />
470            <arg value="-d;" />
471        </exec>
472        <exec executable="awk" outputproperty="build.extra" failonerror="false">
473            <arg value="-F&quot;" />
474            <arg value="/public final static String EXTRA/{print $2}" />
475            <arg value="router/java/src/net/i2p/router/RouterVersion.java" />
476        </exec>
477        <echo message="Build number is ${build.number}${build.extra}" />
478    </target>
479
480    <target name="clean" depends="pkgclean" >
481        <delete dir="./build" />
482        <delete file="installer/lib/izpack/patches.jar" failonerror="false" quiet="true" />     
483        <delete file="i2pinstall.exe" failonerror="false" quiet="true" />       
484        <delete file="i2p.exe" failonerror="false" quiet="true" />
485        <delete file="syndie-standalone.zip" failonerror="false" quiet="true" />
486        <delete>
487            <fileset dir="." includes="i2pinstall*jar i2pinstall*bz2" />
488        </delete>
489        <delete file="i2psnark-standalone.zip" failonerror="false" quiet="true" />
490        <delete file="BOB-one.jar" failonerror="false" quiet="true" /> 
491        <delete dir="core/c/jbigi/bin" />
492        <delete dir="core/c/jbigi/lib" />
493        <delete dir="core/c/jcpuid/lib" />
494        <delete dir="debian/tmp" />
495        <delete dir="debian/db" />
496        <delete file="debian/files" />
497        <delete file="debian/build" />
498        <delete file="debian/substvars"/>
499    </target>
500
501    <target name="distclean" depends="clean">
502        <delete includeemptydirs="true" failonerror="false" >
503            <fileset dir="debian/packages" followSymlinks="false" />
504        </delete>
505        <delete dir="debian/repo" />
506        <ant dir="core/java/" target="distclean" />
507        <ant dir="router/java/" target="distclean" />
508        <ant dir="apps/ministreaming/java/" target="distclean" />
509        <ant dir="apps/streaming/java/" target="distclean" />
510        <ant dir="apps/i2ptunnel/java/" target="distclean" />
511        <ant dir="apps/sam/java/" target="distclean" />
512        <ant dir="apps/BOB" target="clean" />
513        <ant dir="apps/desktopgui" target="clean" />
514        <ant dir="apps/routerconsole/java/" target="distclean" />
515        <ant dir="apps/addressbook/" target="distclean" />
516        <ant dir="apps/susimail/" target="distclean" />
517        <ant dir="apps/susidns/src/" target="distclean" />
518        <ant dir="apps/systray/java/" target="distclean" />
519        <ant dir="apps/i2psnark/java/" target="distclean" />
520        <ant dir="apps/jetty/" target="distclean" />
521        <!--
522                NOTE! We need to turn off the default excludes for these
523                patterns to work.
524                These are the defaultexcludes in Ant as seen on
525                http://ant.apache.org/manual/CoreTasks/defaultexcludes.html
526                     **/*~
527                     **/#*#
528                     **/.#*
529                     **/%*%
530                     **/._*
531                     **/CVS
532                     **/CVS/**
533                     **/.cvsignore
534                     **/SCCS
535                     **/SCCS/**
536                     **/vssver.scc
537                     **/.svn
538                     **/.svn/**
539                     **/.DS_Store
540                The only recourse is to remove the offending ones.
541                We do this here, as we only need one change, and then put it
542                back after we are done with it.
543        -->
544        <defaultexcludes remove="**/*~"/>
545
546        <delete>
547            <fileset dir="." includes="**/*.class **/*.java~ **/*.txt~ **/*.xml~ **/*.sh~ **/*.SlackBuild~" />
548            <!--
549                Less common, but they pollute my workspace here, so we
550                might as well nuke these as well. Are there any others?
551               
552                !!??? Why don't we just nuke "**/*~" ???!!
553
554                ++Sponge
555            -->
556        </delete>
557        <!--
558                Now we put the defaults back
559        -->
560        <defaultexcludes default="true"/>
561    </target>
562
563    <target name="pkg" depends="distclean, updater, preppkg, installer" />
564
565    <target name="pkgclean" depends="deletepkg-temp">
566        <delete>
567            <fileset dir="." includes="i2p.tar.bz2 install.jar i2pupdate.zip i2pupdate200.zip" />
568        </delete>
569    </target>
570
571    <target name="preppkg" depends="preppkg-linux, preppkg-freebsd, preppkg-osx, preppkg-windows, jbigi">
572        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
573        <copy todir="pkg-temp/lib/wrapper/solaris/">
574            <fileset dir="installer/lib/wrapper/solaris/" />
575        </copy>
576    </target>
577
578    <target name="preppkg-freebsd" depends="preppkg-unix">
579        <copy todir="pkg-temp/lib/wrapper/freebsd/">
580            <fileset dir="installer/lib/wrapper/freebsd/" />
581        </copy>
582        <copy todir="pkg-temp/lib/wrapper/freebsd64/">
583            <fileset dir="installer/lib/wrapper/freebsd64" />
584        </copy>
585    </target>
586
587    <target name="preppkg-freebsd-only" depends="preppkg-freebsd, jbigi-freebsd-only" >
588        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
589        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
590    </target>
591
592    <!-- only what is needed for debian, etc. -->
593    <target name="preppkg-linux-only" depends="preppkg-linux, jbigi-linux-only" >
594        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
595        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
596    </target>
597
598    <target name="preppkg-unix" depends="preppkg-base">
599        <copy file="installer/resources/runplain.sh" todir="pkg-temp/" />
600        <!-- <copy file="apps/i2psnark/launch-i2psnark" todir="pkg-temp/" /> old feature that per zzz isn't used-->
601        <copy file="installer/resources/eepget" todir="pkg-temp/" />
602        <copy file="installer/resources/i2prouter" todir="pkg-temp/" />
603        <copy file="installer/resources/osid" todir="pkg-temp/" />
604        <copy file="installer/resources/postinstall.sh" todir="pkg-temp/" />
605        <copy todir="pkg-temp/man/">
606            <fileset dir="installer/resources/man/" />
607        </copy>
608    </target>
609
610    <target name="preppkg-linux" depends="preppkg-linux-x86,preppkg-linux-nonx86" />
611
612    <target name="preppkg-linux-x86" depends="preppkg-unix">
613        <copy todir="pkg-temp/lib/wrapper/linux/">
614            <fileset dir="installer/lib/wrapper/linux/" />
615        </copy>
616        <copy todir="pkg-temp/lib/wrapper/linux64/">
617            <fileset dir="installer/lib/wrapper/linux64/" />
618        </copy>
619    </target>
620
621    <target name="preppkg-linux-nonx86" depends="preppkg-unix">
622        <copy todir="pkg-temp/lib/wrapper/linux-armv7/">
623            <fileset dir="installer/lib/wrapper/linux-armv7/" />
624        </copy>
625        <copy todir="pkg-temp/lib/wrapper/linux-ppc/">
626            <fileset dir="installer/lib/wrapper/linux-ppc/" />
627        </copy>
628        <copy todir="pkg-temp/lib/wrapper/linux-armv5/">
629            <fileset dir="installer/lib/wrapper/linux-armv5/" />
630        </copy>
631    </target>
632
633    <target name="preppkg-osx" depends="preppkg-unix">
634        <!--<copy file="installer/resources/I2P Router Console.webloc" todir="pkg-temp/" />-->
635        <copy todir="pkg-temp/Start I2P Router.app">
636            <fileset dir="installer/resources/Start I2P Router.app" />
637        </copy>
638        <copy todir="pkg-temp/lib/wrapper/macosx/">
639            <fileset dir="installer/lib/wrapper/macosx/" />
640        </copy>
641    </target>
642
643    <target name="preppkg-osx-only" depends="preppkg-osx, jbigi-osx-only" >
644        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
645        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />     
646    </target>
647   
648    <target name="preppkg-windows" depends="preppkg-base, buildexe">
649        <copy file="i2p.exe" todir="pkg-temp/" failonerror="false" />
650        <copy file="apps/systray/java/lib/systray4j.dll" todir="pkg-temp/lib" />
651        <copy file="apps/systray/java/resources/iggy.ico" todir="pkg-temp/icons" />
652        <copy file="apps/systray/java/resources/iggy.xpm" todir="pkg-temp/icons" />
653        <copy file="installer/resources/eepget.bat" todir="pkg-temp/" />
654        <copy file="installer/resources/i2prouter.bat" todir="pkg-temp/" />
655        <copy file="installer/resources/fixperms.bat" todir="pkg-temp/" />
656        <copy file="installer/resources/fixpaths.cmd" todir="pkg-temp/" />
657        <copy file="installer/resources/install_i2p_service_winnt.bat" todir="pkg-temp/" />
658        <copy file="installer/resources/set_config_dir_for_nt_service.bat" todir="pkg-temp/" />
659        <copy file="installer/resources/uninstall_i2p_service_winnt.bat" todir="pkg-temp/" />
660        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
661        <copy todir="pkg-temp/lib/wrapper/win32/">
662            <fileset dir="installer/lib/wrapper/win32/" />
663        </copy>
664        <copy todir="pkg-temp/lib/wrapper/win64/">
665            <fileset dir="installer/lib/wrapper/win64/" />
666        </copy>
667    </target>
668
669    <target name="preppkg-windows-only" depends="preppkg-windows, jbigi-windows-only">
670        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
671        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
672    </target>
673   
674    <target name="preppkg-base" depends="build, preplicenses, prepConsoleDocs, prepthemeupdates, prepCertificates">
675        <!-- if updater200 was run previously, it left *.pack files in pkg-temp -->
676        <!-- Also remove deletelist.txt used for updater only -->
677        <delete>
678            <fileset dir="pkg-temp" includes="**/*.jar.pack **/*.war.pack deletelist.txt" />
679        </delete>
680        <copy file="build/i2p.jar" todir="pkg-temp/lib/" />
681        <copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
682        <copy file="build/jasper-compiler.jar" todir="pkg-temp/lib/" />
683        <copy file="build/jasper-runtime.jar" todir="pkg-temp/lib/" />
684        <copy file="build/commons-logging.jar" todir="pkg-temp/lib/" />
685        <copy file="build/commons-el.jar" todir="pkg-temp/lib/" />
686        <copy file="build/javax.servlet.jar" todir="pkg-temp/lib/" />
687        <copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
688        <copy file="build/streaming.jar" todir="pkg-temp/lib/" />
689        <copy file="build/org.mortbay.jetty.jar" todir="pkg-temp/lib/" />
690        <copy file="build/router.jar" todir="pkg-temp/lib/" />
691        <copy file="build/desktopgui.jar" todir="pkg-temp/lib/" />
692        <copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
693        <!-- pulled out of routerconsole.jar in 0.7.12; name without version so we can overwrite if we upgrade  -->
694        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
695        <copy file="build/sam.jar" todir="pkg-temp/lib/" />
696        <copy file="build/BOB.jar" todir="pkg-temp/lib/" />
697        <copy file="build/systray.jar" todir="pkg-temp/lib" />
698        <copy file="build/i2psnark.jar" todir="pkg-temp/lib/" />
699        <copy file="apps/systray/java/lib/systray4j.jar" todir="pkg-temp/lib" />
700        <copy file="build/i2ptunnel.war" todir="pkg-temp/webapps/" />
701        <copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
702        <copy file="build/addressbook.war" todir="pkg-temp/webapps/" />
703        <copy file="build/susimail.war" todir="pkg-temp/webapps/" />
704        <copy file="build/susidns.war" todir="pkg-temp/webapps/" />
705        <copy file="apps/susidns/src/WEB-INF/lib/jstl.jar" todir="pkg-temp/lib/" />
706        <copy file="apps/susidns/src/WEB-INF/lib/standard.jar" todir="pkg-temp/lib/" />
707        <copy file="build/i2psnark.war" todir="pkg-temp/webapps/" />
708        <!--
709             Disabling per zzz's statement on IRC: jetty-i2psnark.xml is for an obscure feature that is broken anyway,
710                                                   you can remove the file, the link, and the patch from the package
711
712                     So I'm going one further: I'm disabling it in build.xml
713                     +++kytv
714                     -->
715        <!--
716        <copy file="apps/i2psnark/jetty-i2psnark.xml" todir="pkg-temp/" />
717        -->
718        <copy file="apps/i2psnark/i2psnark.config" todir="pkg-temp/" />
719        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
720        <copy file="installer/resources/clients.config" todir="pkg-temp/" />
721        <copy file="installer/resources/i2ptunnel.config" todir="pkg-temp/" />
722        <copy file="installer/resources/systray.config" todir="pkg-temp/" />
723        <copy file="installer/resources/wrapper.config" todir="pkg-temp/" />
724        <copy file="installer/resources/hosts.txt" todir="pkg-temp/" />
725        <copy file="INSTALL-headless.txt" todir="pkg-temp/" />
726        <!-- overwrite the truncated history put in by the updater -->
727        <copy file="history.txt" todir="pkg-temp/" overwrite="true" />
728        <mkdir dir="pkg-temp/scripts" />
729        <copy file="apps/proxyscript/i2pProxy.pac" todir="pkg-temp/scripts/" />
730        <copy file="installer/resources/startconsole.html" todir="pkg-temp/docs/" />
731        <copy file="installer/resources/start.ico" todir="pkg-temp/docs/" />
732        <copy file="installer/resources/console.ico" todir="pkg-temp/docs/" />
733        <copy file="installer/resources/uninstall.ico" todir="pkg-temp/docs/" />
734        <!-- Eepsite stuff here -->
735        <mkdir dir="pkg-temp/eepsite" />
736        <mkdir dir="pkg-temp/eepsite/webapps" />
737        <mkdir dir="pkg-temp/eepsite/logs" />
738        <mkdir dir="pkg-temp/eepsite/cgi-bin" />
739        <mkdir dir="pkg-temp/eepsite/docroot" />
740        <mkdir dir="pkg-temp/eepsite/docroot/help" />
741        <mkdir dir="pkg-temp/eepsite/docroot/help/lib" />
742        <copy todir="pkg-temp/eepsite/docroot/" >
743            <fileset dir="installer/resources/eepsite.help/" />
744        </copy>
745        <copy todir="pkg-temp/eepsite/docroot/help/lib/" >
746            <fileset dir="installer/resources/icons/flags/" includes="cn.png de.png es.png fr.png ir.png it.png jp.png nl.png ru.png se.png us.png" />
747        </copy>
748        <copy file="installer/resources/themes/console/images/favicon.ico" tofile="pkg-temp/eepsite/docroot/favicon.ico" />
749        <copy file="installer/resources/jetty.xml" tofile="pkg-temp/eepsite/jetty.xml" />
750    </target>
751
752    <target name="preplicenses">
753        <copy file="LICENSE.txt" todir="pkg-temp/" />
754        <copy todir="pkg-temp/licenses/" >
755          <fileset dir="licenses/" />
756        </copy>
757        <!--
758              The license in launch4j/ is a BSD license for launch4j
759              The license in launch4j/head is a MIT license for the code that is actually wrapped around the jars
760              So we include the MIT one in our binary package
761         -->
762        <copy file="installer/lib/launch4j/head/LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-Launch4j.txt" />
763        <!--  Not sure if these are used or should be included -->
764        <copy file="installer/lib/launch4j/lib/foxtrot.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-Foxtrot.txt" />
765        <copy file="installer/lib/launch4j/lib/JGoodies.Forms.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-JGoodies-Forms.txt" />
766        <copy file="installer/lib/launch4j/lib/JGoodies.Looks.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-JGoodies-Looks.txt" />
767        <copy file="installer/lib/launch4j/lib/XStream.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-XStream.txt" />
768    </target>
769
770    <target name="prepthemeupdates">
771        <copy todir="pkg-temp/docs/themes/" >
772            <fileset dir="installer/resources/themes/" />
773        </copy>
774    </target>
775
776    <!-- SSL Certs -->
777    <target name="prepCertificates">
778        <copy todir="pkg-temp/certificates/" >
779          <fileset dir="installer/resources/certificates/" />
780        </copy>
781    </target>
782
783    <!-- this is no longer required, izpack 4.3.0 supports headless installs with java -jar i2pinstall.exe -console -->
784    <target name="tarball" depends="preppkg">
785        <tar compression="bzip2" destfile="i2p.tar.bz2">
786            <tarfileset dir="pkg-temp" includes="**/*" prefix="i2p" />
787        </tar>
788    </target>
789
790    <target name="deletepkg-temp">
791        <delete dir="pkg-temp" />
792    </target>
793
794    <!-- readme and proxy error page files, initialNews.xml files, GeoIP files, and flag icons -->
795    <target name="prepConsoleDocs" depends="prepConsoleDocUpdates, prepgeoupdate" >
796        <copy todir="pkg-temp/docs/initialNews/">
797          <fileset dir="installer/resources/initialNews/" />
798        </copy>
799    </target>
800
801    <!-- readme and proxy error page files -->
802    <target name="prepConsoleDocUpdates">
803        <copy todir="pkg-temp/docs/" >
804          <fileset dir="installer/resources/readme/" includes="readme*.html" />
805          <fileset dir="installer/resources/proxy/" includes="*.ht" />
806          <!-- lang_ar.png added in 0.8.4; a1,a2,je, and eu.png added in 0.8.9; gg.png added in 0.8.10; im.png added in 0.8.12 -->
807          <fileset dir="installer/resources/" includes="icons/flags/lang_ar.png icons/flags/gg.png icons/flags/je.png icons/flags/eu.png icons/flags/im.png icons/flags/a1.png icons/flags/a2.png" />
808        </copy>
809    </target>
810
811    <target name="consoleDocs" depends="deletepkg-temp, prepConsoleDocs">
812        <zip destfile="docs.zip" basedir="pkg-temp" whenempty="fail" />
813    </target>
814
815    <target name="copyJavadoc" depends="javadoc">
816        <copy todir="pkg-temp/docs/javadoc" >
817          <fileset dir="build/javadoc/" />
818        </copy>
819    </target>
820
821    <target name="updater200" depends="prepupdate, preplicenses, pack200, zipit200" />
822    <target name="updater200WithJettyFixes" depends="prepjupdatefixes, preplicenses, pack200, zipit200" />
823    <target name="updater200WithJettyFixesAndJbigi" depends="prepjupdatefixes, prepjbigiupdate, preplicenses, pack200, zipit200" />
824    <target name="updater" depends="prepupdate, preplicenses, zipit" />
825    <target name="updaterWithJavadoc" depends="prepupdate, preplicenses, copyJavadoc, zipit" />
826    <target name="updater200WithJavadoc" depends="prepupdate, preplicenses, copyJavadoc, pack200, zipit200" />
827    <target name="updaterWithGeoIP" depends="prepupdate, prepgeoupdate, preplicenses, zipit" />
828    <target name="updaterWithJetty" depends="prepjupdate, preplicenses, zipit" />
829    <target name="updaterWithJettyFixes" depends="prepjupdatefixes, preplicenses, zipit" />
830    <target name="updaterWithJettyFixesAndJbigi" depends="prepjupdatefixes, prepjbigiupdate, preplicenses, zipit" />
831    <target name="updaterWithJettyFixesAndGeoIP" depends="prepjupdatefixes, prepgeoupdate, preplicenses, zipit" />
832    <target name="updaterSmall" depends="prepupdateSmall, zipit" />
833    <target name="updaterRouter" depends="prepupdateRouter, zipit" />
834
835    <target name="zipit" depends="getReleaseNumber" >
836        <!--
837             As of release 0.8.8, the router will enforce a zipfile comment equal to the
838             version number in the sud/su2 header, since the version in the header is NOT
839             covered by the signature.
840         -->
841        <zip destfile="i2pupdate.zip" basedir="pkg-temp" whenempty="fail" comment="${release.number}" />
842       <!-- just a test, makes almost no difference
843        <tar destfile="i2pupdate.tgz" basedir="pkg-temp" compression="gzip" />
844        <tar destfile="i2pupdate.tbz" basedir="pkg-temp" compression="bzip2" />
845       -->
846    </target>
847
848    <target name="zipit200" depends="getReleaseNumber" >
849        <zip destfile="i2pupdate200.zip" basedir="pkg-temp" whenempty="fail" comment="${release.number}" />
850    </target>
851
852    <target name="pack200">
853<!-- *nix here -->
854        <exec executable="sh" osfamily="unix" failonerror="true">
855            <arg value="-c" />
856            <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" />
857        </exec>
858        <exec executable="sh" osfamily="mac" failonerror="true">
859            <arg value="-c" />
860            <!-- pack200 will only pack to a .pack file, and only from a .jar file, so we put another .jar on the end -->
861            <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" />
862        </exec>
863<!-- windoz here : i admit, i hate escaped symbols in xml, indeed = =! -->
864                <exec executable="cmd" osfamily="windows" failonerror="true">
865                        <arg value="/c" />
866                        <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" />
867        </exec>
868                <exec executable="cmd" osfamily="windows" failonerror="true">
869                        <arg value="/c" />
870                        <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" />
871        </exec>
872    </target>
873
874    <target name="updateTest" depends="prepupdate">
875        <ant dir="core/java/" target="jarTest" />
876        <copy file="core/java/build/i2ptest.jar" todir="pkg-temp/lib" />
877        <zip destfile="i2pupdate.zip" basedir="pkg-temp" />
878    </target>
879
880    <target name="prepupdate" depends="build2, prepupdateSmall, prepConsoleDocUpdates, prepCertificates">
881        <copy file="build/BOB.jar" todir="pkg-temp/lib/" />
882        <copy file="build/sam.jar" todir="pkg-temp/lib/" />
883        <copy file="build/i2psnark.jar" todir="pkg-temp/lib" />
884        <!-- include systray changes in 0.7.5 -->
885        <copy file="build/systray.jar" todir="pkg-temp/lib/" />
886        <copy file="build/desktopgui.jar" todir="pkg-temp/lib/" />
887        <copy file="build/susimail.war" todir="pkg-temp/webapps/" />
888        <copy file="build/susidns.war" todir="pkg-temp/webapps/" />
889        <!-- as of 0.7.12; someday, we can remove these from the updater -->
890        <copy file="apps/susidns/src/WEB-INF/lib/jstl.jar" todir="pkg-temp/lib/" />
891        <copy file="apps/susidns/src/WEB-INF/lib/standard.jar" todir="pkg-temp/lib/" />
892        <copy file="build/i2psnark.war" todir="pkg-temp/webapps/" />
893        <copy file="history.txt" todir="pkg-temp/" />
894        <!-- the following overwrites history.txt on unix to shrink the update file -->
895        <exec executable="head" osfamily="unix" failifexecutionfails="true" output="pkg-temp/history.txt">
896            <arg value="-n" />
897            <arg value="1500" />
898            <arg value="history.txt" />
899        </exec>
900        <exec executable="echo" osfamily="unix" failifexecutionfails="true" output="pkg-temp/history.txt" append="true">
901            <arg value="&#10;&#10;----------------&#10;&#10;EARLIER HISTORY IS AVAILABLE IN THE SOURCE PACKAGE" />
902        </exec>
903        <copy file="installer/resources/deletelist.txt" todir="pkg-temp/" />
904      <!-- May be pointless now, people with split directories will never see this,
905           and for flat installs we don't want to overwrite news more recent than the update package.
906        <copy file="installer/resources/news.xml" todir="pkg-temp/docs/" />
907       -->
908    </target>
909
910    <target name="prepupdateSmall" depends="buildSmall, prepupdateRouter, prepthemeupdates">
911        <copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
912        <copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
913        <copy file="build/streaming.jar" todir="pkg-temp/lib/" />
914        <copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
915        <!-- pulled out of routerconsole.jar in 0.7.12, someday we can take out of updater -->
916        <!-- name without version so we can overwrite if we upgrade  -->
917        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
918        <copy file="build/i2ptunnel.war" todir="pkg-temp/webapps/" />
919        <copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
920        <copy file="build/addressbook.war" todir="pkg-temp/webapps/" />
921        <!-- decapitalized the file in 0.7.8 -->
922       <copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
923    </target>
924
925    <target name="prepupdateRouter" depends="buildrouter, deletepkg-temp">
926        <copy file="build/i2p.jar" todir="pkg-temp/lib/" />
927        <copy file="build/router.jar" todir="pkg-temp/lib/" />
928    </target>
929
930    <!-- jbigi.jar -->
931    <target name="prepjbigiupdate" depends="jbigi">
932        <copy file="build/jbigi.jar" todir="pkg-temp/lib/" />
933    </target>
934
935    <!-- GeoIP files and flag icons -->
936    <target name="prepgeoupdate">
937        <copy file="installer/resources/geoip.txt" todir="pkg-temp/geoip/" />
938        <copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
939        <copy todir="pkg-temp/docs/icons/flags" >
940          <fileset dir="installer/resources/icons/flags" />
941        </copy>
942    </target>
943
944    <target name="prepjupdate" depends="prepupdate, buildWEB">
945        <copy file="build/jasper-compiler.jar" todir="pkg-temp/lib/" />
946        <copy file="build/jasper-runtime.jar" todir="pkg-temp/lib/" />
947        <copy file="build/commons-logging.jar" todir="pkg-temp/lib/" />
948        <copy file="build/commons-el.jar" todir="pkg-temp/lib/" />
949        <copy file="build/javax.servlet.jar" todir="pkg-temp/lib/" />
950        <copy file="build/org.mortbay.jetty.jar" todir="pkg-temp/lib/" />
951    </target>
952    <target name="prepjupdatefixes" depends="prepupdate, buildWEB">
953        <copy file="build/org.mortbay.jetty.jar" todir="pkg-temp/lib/" />
954    </target>
955
956    <target name="util-list-changes" depends="checkForMtn" if="mtn.available" >
957        <exec executable="mtn" outputproperty="workspace.changes.util" errorproperty="mtn.error.util" failifexecutionfails="false" >
958            <arg value="list" />
959            <arg value="changed" />
960            <arg value="core/java/src/net/i2p/util" />
961        </exec>
962        <!-- \n in an attribute value generates an invalid manifest -->
963        <exec executable="tr" inputstring="${workspace.changes.util}" outputproperty="workspace.changes.util.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
964            <arg value="-s" />
965            <arg value="[:space:]" />
966            <arg value="," />
967        </exec>
968    </target>
969
970    <taskdef name="izpack"
971             classpath="${basedir}/installer/lib/izpack/patches.jar:${basedir}/installer/lib/izpack/standalone-compiler.jar"
972             classname="com.izforge.izpack.ant.IzPackTask" />
973
974    <target name="izpack-patches" >
975        <jar destfile="${basedir}/installer/lib/izpack/patches.jar"
976             basedir="${basedir}/installer/lib/izpack/patches" />
977    </target>
978
979    <target name="installer" depends="preppkg, buildProperties, util-list-changes, izpack-patches" >
980        <mkdir dir="pkg-temp/installer" />
981        <!-- set if unset -->
982        <property name="workspace.changes.util.tr" value="" />
983        <jar destfile="./pkg-temp/installer/copy.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Copy.class net/i2p/util/FileUtil.class">
984            <manifest>
985                <attribute name="Main-Class" value="net.i2p.util.Copy" />
986                <attribute name="Build-Date" value="${build.timestamp}" />
987                <attribute name="Base-Revision" value="${workspace.version}" />
988                <attribute name="Workspace-Changes" value="${workspace.changes.util.tr}" />
989            </manifest>
990        </jar>
991        <jar destfile="./pkg-temp/installer/delete.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Delete.class net/i2p/util/FileUtil.class">
992            <manifest>
993                <attribute name="Main-Class" value="net.i2p.util.Delete" />
994                <attribute name="Build-Date" value="${build.timestamp}" />
995                <attribute name="Base-Revision" value="${workspace.version}" />
996                <attribute name="Workspace-Changes" value="${workspace.changes.util.tr}" />
997            </manifest>
998        </jar>
999        <jar destfile="./pkg-temp/installer/exec.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Exec.class">
1000            <manifest>
1001                <attribute name="Main-Class" value="net.i2p.util.Exec" />
1002                <attribute name="Build-Date" value="${build.timestamp}" />
1003                <attribute name="Base-Revision" value="${workspace.version}" />
1004                <attribute name="Workspace-Changes" value="${workspace.changes.util.tr}" />
1005            </manifest>
1006        </jar>
1007        <!--
1008          Force 1.5 pack200 output
1009          Doesnt work!
1010          http://jira.codehaus.org/browse/IZPACK-404
1011          http://forums.sun.com/thread.jspa?threadID=773439
1012          http://bfo.co.uk/blog/2010/05/13/combining_ant_jar_signatures_and_pack200.html
1013        <property name="com.sun.java.util.jar.pack.package.majver" value="150" />
1014        <property name="com.sun.java.util.jar.pack.package.minver" value="7" />
1015        -->
1016        <izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
1017
1018        <ant target="installerexe" />
1019    </target>
1020
1021    <target name="installerexe">
1022        <condition property="noExe">
1023            <os arch="x86_64" />
1024        </condition>
1025        <condition property="noExe">
1026            <os arch="amd64" />
1027        </condition>
1028        <condition property="noExe">
1029           <not>
1030            <or>
1031             <os name="Linux" />
1032             <os family="windows" />
1033            </or>
1034           </not>
1035        </condition>
1036        <ant target="doInstallerEXE" />
1037    </target>
1038
1039    <target name="doInstallerEXE" unless="noExe">
1040        <!-- now the installer exe -->
1041        <launch4j configFile="./installer/i2pinstaller.xml" />
1042        <launch4j configFile="./installer/i2pstandalone.xml" />
1043        <!-- thazzit -->
1044    </target>
1045
1046    <!-- Custom installers -->
1047
1048    <target name="installer-freebsd" depends="clean, preppkg-freebsd-only, getReleaseNumber, getBuildNumber, buildProperties, util-list-changes, izpack-patches" >
1049        <mkdir dir="pkg-temp/installer" />
1050        <!-- set if unset -->
1051        <property name="workspace.changes.util.tr" value="" />
1052        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${release.number}-${build.number}${build.extra}_freebsd-only.jar" installerType="standard" basedir="${basedir}" />
1053    </target>
1054
1055    <target name="installer-linux" depends="clean, preppkg-linux-only, getReleaseNumber, getBuildNumber, buildProperties, util-list-changes, izpack-patches" >
1056        <mkdir dir="pkg-temp/installer" />
1057        <!-- set if unset -->
1058        <property name="workspace.changes.util.tr" value="" />
1059        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${release.number}-${build.number}${build.extra}_linux-only.jar" installerType="standard" basedir="${basedir}" />
1060    </target>
1061
1062
1063    <target name="installer-osx" depends="clean, checkForIzpack2App, preppkg-osx-only, getReleaseNumber, getBuildNumber, buildProperties, util-list-changes, izpack-patches">
1064        <mkdir dir="pkg-temp/installer" />
1065        <mkdir dir="pkg-temp/osx" />
1066        <!-- set if unset -->
1067        <property name="workspace.changes.util.tr" value="" />
1068        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${release.number}-${build.number}${build.extra}_osx-only.jar" installerType="standard" basedir="${basedir}" />
1069        <ant target="installer2app" />
1070        <delete dir="pkg-temp/osx" />
1071    </target>
1072
1073    <target name="checkForIzpack2App">
1074        <available property="izpack2app.available" file="${user.home}/IzPack/utils/wrappers/izpack2app/izpack2app.py" />
1075    </target>
1076
1077    <target name="installer2app" if="izpack2app.available">
1078        <mkdir dir="pkg-temp/osx" />
1079        <exec executable="python" failonerror="true">
1080            <arg value="${user.home}/IzPack/utils/wrappers/izpack2app/izpack2app.py" />
1081            <arg value="${basedir}/i2pinstall_${release.number}-${build.number}${build.extra}_osx-only.jar" />
1082            <arg value="${basedir}/pkg-temp/osx/i2p-${release.number}-${build.number}${build.extra}_osx-install.app" />
1083        </exec>
1084        <exec executable="chmod" failonerror="true" osfamily="unix">
1085                <arg value="755" />
1086                <arg value="${basedir}/pkg-temp/osx/i2p-${release.number}-${build.number}${build.extra}_osx-install.app/Contents/MacOS/JavaApplicationStub" />
1087        </exec>
1088        <exec executable="tar" osfamily="unix" failonerror="true">
1089                <arg value="--owner=root" />
1090                <arg value="--group=root" />
1091                <arg value="-cjvf" />
1092                <arg value="${basedir}/i2pinstall_${release.number}-${build.number}${build.extra}_osx.tar.bz2" />
1093                <arg value="-C" />
1094                <arg value="${basedir}/pkg-temp/osx" />
1095                <arg value="i2p-${release.number}-${build.number}${build.extra}_osx-install.app" />
1096        </exec>
1097    </target>
1098
1099    <!-- Yes, even though this makes an installer for Windows, we still need to depend on preppkg-unix (because the installer attempts to delete these files
1100     and will fail if they don't exist. Thankfully these files are so very small there's not much harm in including them.
1101    -->
1102    <target name="installer-windows" depends="clean, doBuildEXE, preppkg-windows-only, preppkg-unix, getReleaseNumber, getBuildNumber, buildProperties, util-list-changes, izpack-patches" >
1103        <mkdir dir="pkg-temp/installer" />
1104        <!-- set if unset -->
1105        <property name="workspace.changes.util.tr" value="" />
1106        <jar destfile="./pkg-temp/installer/copy.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Copy.class net/i2p/util/FileUtil.class">
1107            <manifest>
1108                <attribute name="Main-Class" value="net.i2p.util.Copy" />
1109                <attribute name="Build-Date" value="${build.timestamp}" />
1110                <attribute name="Base-Revision" value="${workspace.version}" />
1111                <attribute name="Workspace-Changes" value="${workspace.changes.util.tr}" />
1112            </manifest>
1113        </jar>
1114        <jar destfile="./pkg-temp/installer/delete.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Delete.class net/i2p/util/FileUtil.class">
1115            <manifest>
1116                <attribute name="Main-Class" value="net.i2p.util.Delete" />
1117                <attribute name="Build-Date" value="${build.timestamp}" />
1118                <attribute name="Base-Revision" value="${workspace.version}" />
1119                <attribute name="Workspace-Changes" value="${workspace.changes.util.tr}" />
1120            </manifest>
1121        </jar>
1122        <jar destfile="./pkg-temp/installer/exec.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Exec.class">
1123            <manifest>
1124                <attribute name="Main-Class" value="net.i2p.util.Exec" />
1125                <attribute name="Build-Date" value="${build.timestamp}" />
1126                <attribute name="Base-Revision" value="${workspace.version}" />
1127                <attribute name="Workspace-Changes" value="${workspace.changes.util.tr}" />
1128            </manifest>
1129        </jar>
1130        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${release.number}-${build.number}${build.extra}_windows-only.jar" installerType="standard" basedir="${basedir}" />
1131        <delete dir="pkg-temp/win" />
1132    </target>
1133
1134    <target name="installer-all" depends="installer-freebsd, installer-linux, installer-osx, installer-windows, installer" >
1135    </target>
1136    <!-- end custom installers -->
1137
1138    <target name="test" depends="buildProperties, jbigi" >
1139        <mkdir dir="reports/core/junit/" />
1140        <ant dir="core/java/" target="test" />
1141    </target>
1142    <target name="junit.report" depends="buildProperties" >
1143        <ant dir="core/java/" target="junit.report" />
1144    </target>
1145    <target name="clover.report" depends="buildProperties" >
1146        <ant dir="core/java/" target="clover.report" />
1147    </target>
1148    <target name="test.report" depends="junit.report, clover.report"/>
1149    <target name="fulltest" depends="buildProperties" >
1150                <ant dir="core/java/" target="fulltest" />
1151                <ant dir="router/java/" target="fulltest" />
1152    </target>
1153    <target name="fullclovertest" depends="buildProperties" >
1154                <ant dir="core/java/" target="fullclovertest" />
1155                <ant dir="router/java/" target="fullclovertest" />
1156    </target>
1157
1158    <target name="testscripts" >
1159        <exec executable="tests/scripts/checkcerts.sh" failonerror="true" />
1160        <exec executable="tests/scripts/checkpo.sh" failonerror="true" />
1161        <exec executable="tests/scripts/checkutf8.sh" failonerror="true" />
1162        <exec executable="tests/scripts/checkxml.sh" failonerror="true" />
1163    </target>
1164
1165
1166    <!-- <target name="syndie" >
1167        <ant dir="apps/syndie/java/" target="standalone" />
1168        <copy file="apps/syndie/java/syndie-standalone.zip" todir="." />
1169    </target> -->
1170    <target name="i2psnark" depends="buildProperties" >
1171        <ant dir="apps/i2psnark/java" target="standalone" />
1172        <copy file="apps/i2psnark/java/i2psnark-standalone.zip" todir="." />
1173    </target>
1174    <target name="slackpkg">
1175        <echo message="Building Slackware package." />
1176        <ant dir="Slackware/i2p/" target="slackpkg" />
1177        <ant dir="Slackware/i2p-base/" target="slackpkg" />
1178    </target>
1179    <target name="justBOB" depends="builddepSmall">
1180        <ant dir="apps/BOB/" target="onejar" />
1181        <copy file="apps/BOB/dist/BOB-one.jar" todir="." />
1182    </target>
1183    <target name="findbugs" depends="build2">
1184        <echo message="Starting findbugs, this will take a while..." />
1185        <exec executable="nice" failonerror="true">
1186            <arg value="findbugs"/>
1187            <arg value="-textui"/>
1188            <arg value="-projectName"/>
1189            <arg value="i2p"/>
1190            <arg value="-sortByClass"/>
1191            <arg value="-xml"/>
1192            <arg value="-output"/>
1193            <arg value="i2p.fba"/>
1194            <arg value="-auxclasspath"/>
1195            <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.5.9.1.jar:apps/systray/java/lib/systray4j.jar:installer/lib/wrapper/all/wrapper.jar:apps/susidns/src/WEB-INF/lib/standard.jar:apps/susidns/src/WEB-INF/lib/jstl.jar:apps/jrobin/jrobin-1.5.9.1.jar"/>
1196            <arg value="-sourcepath"/>
1197            <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/"/>
1198            <!-- start of the files to be analyzed -->
1199            <arg value="build/BOB.jar"/>
1200            <arg value="build/addressbook.war"/>
1201            <arg value="build/i2p.jar"/>
1202            <arg value="build/i2psnark.jar"/>
1203            <arg value="build/i2psnark.war"/>
1204            <arg value="build/i2ptunnel.jar"/>
1205            <arg value="build/i2ptunnel.war"/>
1206            <arg value="build/mstreaming.jar"/>
1207            <arg value="build/router.jar/"/>
1208            <arg value="build/desktopgui.jar"/>
1209            <arg value="build/routerconsole.jar"/>
1210            <arg value="build/routerconsole.war"/>
1211            <arg value="build/sam.jar"/>
1212            <arg value="build/streaming.jar"/>
1213            <arg value="build/susidns.war"/>
1214            <arg value="build/susimail.war"/>
1215            <arg value="build/systray.jar"/>
1216        </exec>
1217        <echo message="Findbugs output stored in i2p.fba" />
1218        <echo message="Now run: findbugs i2p.fba" />
1219    </target>
1220
1221    <!-- this is the same dependency as pkg, but with updater200 in the middle,
1222         since preppkg puts too much stuff in pkg-temp -->
1223<!--
1224    <target name="release" depends="distclean, updaterWithJettyFixesAndJbigi , updater200WithJettyFixes, preppkg, installer, getReleaseNumber" >
1225-->
1226    <target name="release" depends="distclean, testscripts, updater, updater200, preppkg, installer, getReleaseNumber" >
1227        <echo message="================================================================" />
1228        <echo message="Did you update these files?" />
1229        <exec executable="ls" failonerror="true">
1230            <arg value="-l" />
1231            <arg value="history.txt" />
1232            <arg value="installer/install.xml" />
1233            <arg value="installer/resources/news.xml" />
1234            <arg value="core/java/src/net/i2p/CoreVersion.java" />
1235            <arg value="router/java/src/net/i2p/router/RouterVersion.java" />
1236        </exec>
1237        <echo message="Everything is checked in, right? Let's be sure:" />
1238        <exec executable="mtn" failonerror="true">
1239            <arg value="st" />
1240        </exec>
1241        <echo message="If there are any modified files above, stop now!" />
1242
1243        <echo message="New version number is ${release.number}" />
1244        <copy file="i2pupdate.zip" tofile="i2pupdate_${release.number}.zip" />
1245        <copy file="i2pinstall.exe" tofile="i2pinstall_${release.number}.exe" />
1246        <delete file="i2pupdate.sud" failonerror="false" />
1247        <delete file="i2pupdate.su2" failonerror="false" />
1248        <input message="Enter private signing key file:" addproperty="release.privkey" />
1249        <fail message="You must enter a path." >
1250            <condition>
1251                <equals arg1="${release.privkey}" arg2=""/>
1252            </condition>
1253        </fail>
1254        <echo message="Key file is ${release.privkey}" />
1255        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
1256            <classpath>
1257                <pathelement location="build/i2p.jar" />
1258            </classpath>
1259            <arg value="sign" />
1260            <arg value="i2pupdate.zip" />
1261            <arg value="i2pupdate.sud" />
1262            <arg value="${release.privkey}" />
1263            <arg value="${release.number}" />
1264        </java>
1265        <echo message="Verify version and VALID signature:" />
1266        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
1267            <classpath>
1268                <pathelement location="build/i2p.jar" />
1269            </classpath>
1270            <arg value="verifysig" />
1271            <arg value="i2pupdate.sud" />
1272        </java>
1273        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
1274            <classpath>
1275                <pathelement location="build/i2p.jar" />
1276            </classpath>
1277            <arg value="verifyversion" />
1278            <arg value="i2pupdate.sud" />
1279        </java>
1280        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
1281            <classpath>
1282                <pathelement location="build/i2p.jar" />
1283            </classpath>
1284            <arg value="showversion" />
1285            <arg value="i2pupdate.sud" />
1286        </java>
1287        <!-- now build and verify the packed sud from the packed zip -->
1288        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
1289            <classpath>
1290                <pathelement location="build/i2p.jar" />
1291            </classpath>
1292            <arg value="sign" />
1293            <arg value="i2pupdate200.zip" />
1294            <arg value="i2pupdate.su2" />
1295            <arg value="${release.privkey}" />
1296            <arg value="${release.number}" />
1297        </java>
1298        <echo message="Verify version and VALID signature:" />
1299        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
1300            <classpath>
1301                <pathelement location="build/i2p.jar" />
1302            </classpath>
1303            <arg value="verifysig" />
1304            <arg value="i2pupdate.su2" />
1305        </java>
1306        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
1307            <classpath>
1308                <pathelement location="build/i2p.jar" />
1309            </classpath>
1310            <arg value="verifyversion" />
1311            <arg value="i2pupdate.su2" />
1312        </java>
1313        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
1314            <classpath>
1315                <pathelement location="build/i2p.jar" />
1316            </classpath>
1317            <arg value="showversion" />
1318            <arg value="i2pupdate.su2" />
1319        </java>
1320        <!-- will this use the monotonerc file in the current workspace? -->
1321        <echo message="Checking out fresh copy into ../i2p-${release.number} for tarballing:" />
1322        <delete dir="../i2p-${release.number}" />
1323        <exec executable="mtn" failonerror="true">
1324            <arg value="co" />
1325            <arg value="-b" />
1326            <arg value="i2p.i2p" />
1327            <!-- w: is the revision of the current workspace -->
1328            <arg value="-r" />
1329            <arg value="w:" />
1330            <arg value="../i2p-${release.number}/" />
1331        </exec>
1332        <exec executable="tar" failonerror="true">
1333            <arg value="cjf" />
1334            <arg value="i2psource_${release.number}.tar.bz2" />
1335            <arg value="-C" />
1336            <arg value=".." />
1337            <arg value="--exclude" />
1338            <arg value="i2p-${release.number}/_MTN*" />
1339            <arg value="i2p-${release.number}/" />
1340        </exec>
1341        <echo message="Sign the files:" />
1342        <delete file="i2pinstall_${release.number}.exe.sig" />
1343        <delete file="i2psource_${release.number}.tar.bz2.sig" />
1344        <delete file="i2pupdate_${release.number}.zip.sig" />
1345        <exec executable="gpg" failonerror="true">
1346            <arg value="-b" />
1347            <arg value="i2pinstall_${release.number}.exe" />
1348        </exec>
1349        <exec executable="gpg" failonerror="true">
1350            <arg value="-b" />
1351            <arg value="i2psource_${release.number}.tar.bz2" />
1352        </exec>
1353        <exec executable="gpg" failonerror="true">
1354            <arg value="-b" />
1355            <arg value="i2pupdate_${release.number}.zip" />
1356        </exec>
1357        <echo message="File sizes:" />
1358        <exec executable="ls" failonerror="true">
1359            <arg value="-l" />
1360            <arg value="i2pinstall_${release.number}.exe" />
1361            <arg value="i2psource_${release.number}.tar.bz2" />
1362            <arg value="i2pupdate_${release.number}.zip" />
1363            <arg value="i2pupdate.su2" />
1364            <arg value="i2pupdate.sud" />
1365            <arg value="i2pinstall_${release.number}.exe.sig" />
1366            <arg value="i2psource_${release.number}.tar.bz2.sig" />
1367            <arg value="i2pupdate_${release.number}.zip.sig" />
1368        </exec>
1369        <echo message="SHA256 sums:" />
1370        <exec executable="sha256sum" failonerror="true">
1371            <arg value="i2pinstall_${release.number}.exe" />
1372            <arg value="i2psource_${release.number}.tar.bz2" />
1373            <arg value="i2pupdate_${release.number}.zip" />
1374            <arg value="i2pupdate.su2" />
1375            <arg value="i2pupdate.sud" />
1376        </exec>
1377        <echo message="Don't forget to mtn tag w: i2p-${release.number}" />
1378        <echo message="... and mtn cert t:i2p-${release.number} branch i2p.i2p.release" />
1379    </target>
1380
1381    <target name="debian" depends="debian-clean, debian-binary" />
1382
1383    <target name="debian-binary" >
1384        <echo message="Did you update the version using dch -i?" />
1385        <echo message=" " />
1386        <echo message="If the changelog was not updated with dch -i, press" />
1387        <echo message="press CTRL+C to abort building this Debian package." />
1388        <echo message="" />
1389        <echo message="Pausing build for ten seconds to give enough time to read this notice." />
1390        <exec executable="sleep" failonerror="true">
1391                <arg value="10" />
1392        </exec>
1393        <echo message="====================" />
1394        <!-- bundle the jetty 5 lib since there isn't a deb for it -->
1395        <ant dir="apps/jetty" target="ensureJettylib" />
1396       
1397        <exec executable="fakeroot" failonerror="true">
1398            <arg value="debian/rules" />
1399            <arg value="patch" />
1400            <arg value="binary" />
1401            <arg value="clean" />
1402        </exec>
1403        <delete dir=".pc" />
1404    </target>
1405    <target name="debian-clean" depends="buildProperties" >
1406        <exec executable="fakeroot" failonerror="true">
1407            <arg value="debian/rules" />
1408            <arg value="clean" />
1409        </exec>
1410        <delete dir="./.pc" />
1411    </target>
1412    <target name="debian-patch" depends="buildProperties" >
1413        <exec executable="quilt" failonerror="true">
1414            <arg value="-a" />
1415            <arg value="push" />
1416        </exec>
1417        <echo message="====================" />
1418    </target>
1419    <target name="debian-unpatch" depends="buildProperties">
1420        <exec executable="quilt" failonerror="false">
1421            <arg value="-a" />
1422            <arg value="pop" />
1423        </exec>
1424    </target>
1425
1426    <target name="debianrepo" depends="debian">
1427        <exec dir="debian" executable="./makerepo.sh" failonerror="true"/>
1428    </target>
1429
1430<!-- the following are appened to help build barebone portable version,
1431     none of the above is modified for this purpose -->
1432        <target name = "pkg-portable-clean">
1433                <delete dir="build/" />
1434                <delete dir="pkg-temp/" />
1435                <delete>
1436                        <fileset dir="." includes="portable-**.zip**" />
1437                </delete>
1438        </target>
1439<!-- build a portable archive -->
1440
1441<!-- *0* Since we simply pack all files in folder "build/" into our archieve,
1442                we need to make sure its small, with NO redundent jars or wars.
1443                thus cleaning is required before each build-->
1444        <target name="buildSmallOnly" depends="pkg-portable-clean,buildSmall"/>
1445
1446<!-- *1* preparing the jars by OS dependent de-bloating -->
1447        <target name="preppkg-portable-win32-jbigi" depends="buildSmallOnly, jbigi-windows-only" />
1448
1449        <target name="preppkg-portable-linux-jbigi"  depends="buildSmallOnly, jbigi-linux-only" />
1450
1451<!-- *2* os independent procedure  -->
1452        <target name="preppkg-portable-basic" >
1453                <mkdir dir="pkg-temp" />
1454                        <!-- non OS dependent configurations only, dont add *nux/win stuff here -->
1455                        <copy todir="pkg-temp">
1456                                <fileset dir="installer/resources/portable/configs/" />
1457                        </copy>
1458                        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
1459                        <copy file="installer/resources/hosts.txt" todir="pkg-temp/" />
1460                        <copy file="installer/resources/readme.license.txt" todir="pkg-temp/" />
1461                <mkdir dir="pkg-temp/addressbook" />
1462                        <copy file="apps/addressbook/subscriptions.txt" todir="pkg-temp/addressbook/" />
1463                        <copy file="apps/addressbook/myhosts.txt"  todir="pkg-temp/addressbook/" />
1464                        <!-- config.txt is in installer/resources/portable -->
1465                <mkdir dir="pkg-temp/docs" />
1466                        <copy file="installer/resources/initialNews/initialNews.xml" tofile="pkg-temp/docs/news.xml" overwrite="true" />
1467                        <copy file="installer/resources/readme/readme.html" tofile="pkg-temp/docs/readme.html" />
1468                        <copy file="installer/resources/startconsole.html" todir="pkg-temp/docs/" />
1469                        <copy file="installer/resources/start.ico" todir="pkg-temp/docs/" />
1470                        <copy file="installer/resources/console.ico" todir="pkg-temp/docs/" />
1471                        <!-- HTTP Header files, english only,
1472                                if you need a different lang do it in a seperate target -->
1473                        <copy todir="pkg-temp/docs/" >
1474                                <fileset dir="installer/resources/proxy/"  includes="**-header.ht" />
1475                        </copy>
1476                        <!-- Theme light only -->
1477                        <copy todir="pkg-temp/docs/themes/console/light/" overwrite="true" >
1478                                <fileset dir="installer/resources/themes/console/light/" includes="**.css" />
1479                        </copy>
1480                        <copy file="installer/resources/themes/console/light/console_big.css" todir="portable/docs/themes/console/light/" />
1481                        <copy todir="pkg-temp/docs/themes/console/images/" >
1482                                <fileset dir="installer/resources/themes/console/images/" />
1483                        </copy>
1484                        <!-- FLAGs for language icon (not for ip)-->
1485                        <copy todir="pkg-temp/docs/icons/flags" >
1486                                <fileset dir="installer/resources/icons/flags/" includes="cn.png,de.png,fr.png,nl.png,ru.png,se.png,us.png" />
1487                        </copy>
1488                <mkdir dir="pkg-temp/webapps" />
1489                        <copy todir="pkg-temp/webapps/">
1490                                <fileset dir="build/" includes="**.war" />
1491                        </copy>
1492                <mkdir dir="pkg-temp/lib" />
1493                        <copy todir ="pkg-temp/lib/" >
1494                                <fileset dir="build/" includes="**.jar" />
1495                        </copy>
1496                        <!-- 3rd party jars from apps/  -->
1497                                <!-- jrobin - without jobin , you lost graph and get a lot error entry in logs -->
1498                        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
1499        </target>
1500<!-- *3* os dependent procedure/commands -->
1501        <target name = "preppkg-portable-win32" depends="preppkg-portable-win32-jbigi,preppkg-portable-basic">
1502                        <!-- systray4.j  - why do we need trayicons for portable version ? dependency hardcoded in console -->
1503                <copy file="apps/systray/java/lib/systray4j.dll" todir="pkg-temp/lib" />
1504                <copy file="apps/systray/java/lib/systray4j.jar" todir="pkg-temp/lib" />
1505                        <!--wrapper - dont even think about it. i2p cosumes appreantly more mem without it on win32-->
1506                <copy file="installer/lib/wrapper/win32/wrapper.dll" todir="pkg-temp/lib" />
1507                <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
1508                <copy file="installer/lib/wrapper/win32/I2Psvc.exe" tofile="pkg-temp/i2psvc.ex_" />
1509                        <!--  copy the unpack/start batchfiles -->
1510                <copy todir="pkg-temp">
1511                        <fileset dir="installer/resources/portable/win32/" />
1512                </copy>
1513        </target>
1514<!-- *4* command for windows package -->
1515        <target name = "pkg-portable-win32"     depends="preppkg-portable-win32, pack200" >
1516                <!-- i need the portable\ folder in .zip so basedir is set to . -->
1517                <move file="pkg-temp" tofile="portable"/>
1518                <zip destfile="portable-win32.zip" basedir="." level="9" includes="portable\**" />
1519                <checksum file="portable-win32.zip" forceOverwrite="yes"/>
1520                <move file="portable" tofile="pkg-temp"/>
1521        </target>
1522</project>
Note: See TracBrowser for help on using the repository browser.