source: build.xml @ 9c0c733

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

Add non-x86 target for Linux.

Move the arm and ppc archs for linux from the preppkg target to the non-x86
target.

Make the linux target depend on the x86 and non-x86 targets.

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