source: build.xml @ 0773a30

Last change on this file since 0773a30 was 0773a30, checked in by kytv <kytv@…>, 6 years ago

add hamcrest-all to classpaths and minor formatting fixes

  • Property mode set to 100644
File size: 103.7 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<project basedir="." default="all" name="i2p">
3
4    <!-- Include property files so that values can be easily overridden.
5         Users should create an override.properties file to make changes.
6     -->
7    <property file="override.properties"/>
8    <property file="build.properties"/>
9
10    <!-- You probably don't want to change anything from here down -->
11    <target name="help" depends="all" />
12    <target name="all" >
13        <echo message="Useful targets: " />
14        <echo message="  pkg:       distclean then package everything up (updater, installer)" />
15        <echo message="  dist:      pkg and javadoc" />
16        <echo message="  dist200:   pkg, updater200, and javadoc" />
17        <echo message="  installer: build the GUI installer" />
18        <echo message="  installer-freebsd: build the GUI installer (FreeBSD only)" />
19        <echo message="  installer-linux: build the GUI installer (Linux only)" />
20        <echo message="  installer-osx: build the GUI installer (OSX only)" />
21        <echo message="  installer-windows: build the GUI installer (Windows only)" />
22        <echo message="  installer-nowindows: build the GUI installer (all but Windows)" />
23        <echo message="  tarball:   tar the full install into i2p.tar.bz2 (extracts to build a new clean install)" />
24        <echo message="  updater:   Package the built files in i2pupdate.zip (extracts safely over existing installs)" />
25        <echo message="  updater200: Updater compressed with pack200 (creates i2pupdate200.zip, 60% smaller)" />
26        <echo message="  signed-updater200: Signed updater compressed with pack200 (creates i2pupdate.su3, 60% smaller)" />
27        <echo message="  updaterWithJavadoc: updater including the javadocs, for display in the console" />
28        <echo message="  updater200WithJavadoc: updater including the javadocs, for display in the console (creates i2pupdate200.zip)" />
29        <echo message="  signed-updater200WithJavadoc: Signed updater including the javadocs, for display in the console (creates i2pupdate.su3)" />
30        <echo message="  updaterWithJavadocAndJetty: updater including the javadocs, for display in the console, and Jetty " />
31        <echo message="  updater200WithJavadocAndJetty: updater including the javadocs, for display in the console, and Jetty (creates i2pupdate200.zip)" />
32        <echo message="  signed-updater200WithJavadocAndJetty: Signed updater including the javadocs, for display in the console, and Jetty (creates i2pupdate.su3)" />
33        <echo message="  updaterWithJetty: Updater including Jetty" />
34        <echo message="  updater200withJetty: Updater including Jetty" />
35        <echo message="  updater200withJetty: Updater including Jetty" />
36        <echo message="  signed-updater200withJetty: Signed updater including Jetty" />
37        <echo message="  updaterWithJettyFixes: updater including local jetty patches" />
38        <echo message="  updaterWithGeoIP: updater including GeoIP Files" />
39        <echo message="  updaterWithJettyFixesAndGeoIP" />
40        <echo message="  updaterWithJettyFixesAndJbigi" />
41        <echo message="  updaterSmall:   updater with the essentials only - no SAM, i2psnark, SusiMail, SusiDNS, or history.txt" />
42        <echo message="  updaterRouter:  updater with the i2p.jar and router.jar only" />
43        <echo message="  distclean: clean up all derived files" />
44        <!-- <echo message="  syndie:    generate a standalone syndie install" /> -->
45        <echo message="  desktopgui: generate a standalone desktopgui install" />
46        <echo message="  i2psnark:  generate a standalone i2psnark install" />
47        <echo message="  justBOB:  generate a standalone BOB-one.jar" />
48        <echo message="  javadoc:   generate javadoc for the entire project into ./build/javadoc and ./javadoc.zip" />
49        <echo message="  javadoc-test: Javadocs for unit test classes (build/javadoc-test)" />
50        <echo message="  slackpkg:  generate Slackware package in ./Slackware/i2p" />
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 the &quot;Build-Depends&quot; field."/>
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 of the dependencies for you:" />
68            <echo message=" " />
69            <echo message="apt-get install debhelper ant debconf default-jdk gettext libgmp3-dev po-debconf fakeroot build-essential \" />
70            <echo message="                   quilt libcommons-logging-java" />
71            <echo message=" " />
72            <echo message="Once the dependencies are installed, run &quot;ant debian&quot;"/>
73            <echo message="to patch the source and build the packages." />
74    </target>
75
76    <macrodef name="gpgsign">
77        <attribute name="file" />
78        <sequential>
79            <delete file="@{file}.sig" quiet="true" />
80            <exec executable="gpg" failonerror="true">
81                <arg value="--default-key" />
82                <arg value="${release.gpg.keyid}" />
83                <arg value="-b" />
84                <arg value="@{file}" />
85            </exec>
86            <chmod type="file" perm="444">
87                <fileset dir="${basedir}">
88                    <include name="@{file} @{file}.sig" />
89                </fileset>
90            </chmod>
91        </sequential>
92    </macrodef>
93
94    <macrodef name="mktorrent">
95        <attribute name="file" />
96        <sequential>
97            <delete file="@{file}.torrent" quiet="true"/>
98            <java classname="org.klomp.snark.Storage" fork="true" failonerror="true">
99                <classpath>
100                    <pathelement location="build/i2p.jar" />
101                    <pathelement location="build/i2psnark.jar" />
102                </classpath>
103                <arg value="@{file}" />
104                <arg value="http://tracker2.postman.i2p/announce.php" />
105            </java>
106        </sequential>
107    </macrodef>
108
109    <macrodef name="sha256sum">
110        <attribute name="file" />
111        <sequential>
112            <!--
113                 Note: "local" only works with ant 1.8+. This limitation shouldn't be
114                 a big deal since this macro is only called by the release
115                 target.
116             -->
117            <local name="file-sum"/>
118            <checksum format="MD5SUM" file="@{file}" property="file-sum" algorithm="sha-256"/>
119            <echo message="${file-sum}  @{file}" />
120        </sequential>
121    </macrodef>
122
123    <macrodef name="sudsign">
124        <attribute name="infile" />
125        <attribute name="outfile" />
126        <sequential>
127            <input message="Enter private signing key file:" addproperty="release.privkey" />
128            <fail message="You must enter an existing file path." >
129                <condition>
130                    <or>
131                        <equals arg1="${release.privkey}" arg2=""/>
132                        <not>
133                            <length file="${release.privkey}" when="greater" length="0" />
134                        </not>
135                    </or>
136                </condition>
137            </fail>
138            <echo message="Key file is ${release.privkey}" />
139            <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
140                <classpath>
141                    <pathelement location="build/i2p.jar" />
142                </classpath>
143                <arg value="sign" />
144                <arg value="@{infile}" />
145                <arg value="@{outfile}" />
146                <arg value="${release.privkey}" />
147                <arg value="${release.number}" />
148            </java>
149            <echo message="Verify version and VALID signature:" />
150            <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
151                <classpath>
152                    <pathelement location="build/i2p.jar" />
153                </classpath>
154                <arg value="verifysig" />
155                <arg value="@{outfile}" />
156            </java>
157            <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
158                <classpath>
159                    <pathelement location="build/i2p.jar" />
160                </classpath>
161                <arg value="verifyversion" />
162                <arg value="@{outfile}" />
163            </java>
164            <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
165                <classpath>
166                    <pathelement location="build/i2p.jar" />
167                </classpath>
168                <arg value="showversion" />
169                <arg value="@{outfile}" />
170            </java>
171        </sequential>
172    </macrodef>
173
174    <macrodef name="su3sign">
175        <attribute name="infile" />
176        <attribute name="outfile" />
177        <attribute name="sigtype" />
178        <sequential>
179        <input message="Enter su3 private signing key store:" addproperty="release.privkey.su3" />
180        <fail message="You must enter an existing file path." >
181            <condition>
182                <or>
183                    <equals arg1="${release.privkey.su3}" arg2=""/>
184                    <not>
185                        <length file="${release.privkey.su3}" when="greater" length="0" />
186                    </not>
187                </or>
188            </condition>
189        </fail>
190        <input message="Enter key name (you@mail.i2p):" addproperty="release.signer.su3" />
191        <fail message="You must enter a name." >
192            <condition>
193                <equals arg1="${release.signer.su3}" arg2=""/>
194            </condition>
195        </fail>
196        <input message="Enter key password for ${release.signer.su3}:" addproperty="release.password.su3" />
197        <fail message="You must enter a password." >
198            <condition>
199                <equals arg1="${release.password.su3}" arg2=""/>
200            </condition>
201        </fail>
202            <java classname="net.i2p.crypto.SU3File" inputstring="${release.password.su3}" fork="true" failonerror="true">
203                <classpath>
204                    <pathelement location="build/i2p.jar" />
205                </classpath>
206                <arg value="sign" />
207                <arg value="-c" />
208                <arg value="@{sigtype}" />
209                <arg value="-t" />
210                <arg value="RSA_SHA512_4096" />
211                <arg value="@{infile}" />
212                <arg value="@{outfile}" />
213                <arg value="${release.privkey.su3}" />
214                <arg value="${release.number}" />
215                <arg value="${release.signer.su3}" />
216            </java>
217            <echo message="Verify version and VALID signature:" />
218            <java classname="net.i2p.crypto.SU3File" fork="true" failonerror="true">
219                <classpath>
220                    <pathelement location="build/i2p.jar" />
221                </classpath>
222                <!-- set base dir so it can find the pubkey cert -->
223                <jvmarg value="-Di2p.dir.base=installer/resources" />
224                <arg value="verifysig" />
225                <arg value="@{outfile}" />
226            </java>
227            <java classname="net.i2p.crypto.SU3File" fork="true" failonerror="true">
228                <classpath>
229                    <pathelement location="build/i2p.jar" />
230                </classpath>
231                <!-- set base dir so it can find the pubkey cert -->
232                <jvmarg value="-Di2p.dir.base=installer/resources" />
233                <arg value="showversion" />
234                <arg value="@{outfile}" />
235            </java>
236        </sequential>
237    </macrodef>
238    <target name="dist" depends="pkg, javadoc" />
239    <target name="dist200" depends="pkg200, javadoc" />
240    <target name="build" depends="build2">
241        <!-- so we don't build standalone for the updater -->
242        <!-- This builds apps/i2psnark/java/i2psnark-standalone.zip,
243          -   which we don't distribute anywhere...
244        <ant dir="apps/i2psnark/java/" target="standalone" />
245        -->
246    </target>
247    <target name="build2" depends="builddep, jar, buildWEB" />
248    <target name="buildSmall" depends="builddepSmall, jarSmall, buildWEB" />
249    <target name="buildclean" depends="distclean, build" />
250
251    <target name="builddep" depends="builddepSmall, buildBOB, buildSAM, buildSusiMail, buildSusiDNS, buildI2PSnark" />
252
253    <target name="builddepSmall" depends="buildrouter, buildSystray, buildDesktopGui, buildRouterConsole, buildStreaming, buildI2PTunnel, buildAddressbook" />
254
255    <!-- start of buildX, one for each sub-build.xml.
256         Do not put ant tasks in the sub-build.xmls anymore,
257         so the build will go faster.
258      -->
259
260    <target name="buildBOB" depends="buildStreaming" >
261        <ant dir="apps/BOB/" target="jar" />
262        <copy file="apps/BOB/dist/BOB.jar" todir="build/" />
263    </target>
264
265    <target name="buildSAM" depends="buildStreaming" >
266        <ant dir="apps/sam/java/" target="jar" />
267        <copy file="apps/sam/java/build/sam.jar" todir="build/" />
268    </target>
269
270    <target name="buildSusiMail" depends="buildCore, buildJetty" >
271        <ant dir="apps/susimail/" target="war" />
272        <copy file="apps/susimail/susimail.war" todir="build/" />
273    </target>
274
275    <target name="buildSusiDNS" depends="buildCore, buildJetty" >
276        <ant dir="apps/susidns/src" target="all" />
277        <copy file="apps/susidns/src/susidns.war" todir="build/" />
278    </target>
279
280    <target name="buildI2PSnark" depends="buildStreaming, buildJetty" >
281        <ant dir="apps/i2psnark/java/" target="war" />
282        <copy file="apps/i2psnark/i2psnark.war" todir="build/" />
283        <copy file="apps/i2psnark/java/build/i2psnark.jar" todir="build/" />
284    </target>
285
286    <!-- jar (not war) for Android -->
287    <target name="buildAddressbookJar" depends="buildCore" >
288        <ant dir="apps/addressbook/" target="jar" />
289    </target>
290
291    <target name="buildAddressbook" depends="buildCore, buildJetty" >
292        <ant dir="apps/addressbook/" target="war" />
293        <copy file="apps/addressbook/dist/addressbook.war" todir="build/" />
294    </target>
295
296    <!-- jar only (no war) for Android -->
297    <target name="buildI2PTunnelJar" depends="buildStreaming" >
298        <ant dir="apps/i2ptunnel/java/" target="jar" />
299        <copy file="apps/i2ptunnel/java/build/i2ptunnel.jar" todir="build/" />
300    </target>
301
302    <target name="buildI2PTunnel" depends="buildStreaming, buildJetty" >
303        <ant dir="apps/i2ptunnel/java/" target="build" />
304        <copy file="apps/i2ptunnel/java/build/i2ptunnel.jar" todir="build/" />
305        <copy file="apps/i2ptunnel/java/build/i2ptunnel.war" todir="build/" />
306    </target>
307
308    <target name="buildDesktopGui" depends="buildCore, buildrouter" >
309<!--
310        <ant dir="apps/desktopgui" target="clean" />
311-->
312        <ant dir="apps/desktopgui" target="jar" />
313        <copy file="apps/desktopgui/dist/desktopgui.jar" todir="build/" />
314    </target>
315
316    <target name="buildRouterConsole" depends="buildrouter, buildSystray, buildDesktopGui, buildJetty" >
317        <ant dir="apps/routerconsole/java/" target="jar" />
318    </target>
319
320    <!-- newsxml.jar only (subset of routerconsole, no war) for Android -->
321    <target name="buildNewsXMLJar" depends="buildRouter" >
322        <ant dir="apps/routerconsole/java/" target="newsxmljar" />
323    </target>
324
325    <target name="buildJetty" depends="buildCore" >
326        <ant dir="apps/jetty" target="build" />
327        <copy todir="build/" >
328            <fileset dir="apps/jetty/jettylib" excludes="ant.jar" />
329        </copy>
330    </target>
331
332    <target name="buildSystray" depends="buildCore" >
333        <ant dir="apps/systray/java/" target="jar" />
334        <copy file="apps/systray/java/build/systray.jar" todir="build/" />
335    </target>
336
337    <target name="buildStreaming" depends="buildMinistreaming" >
338        <ant dir="apps/streaming/java/" target="jar" />
339        <copy file="apps/streaming/java/build/streaming.jar" todir="build/" />
340    </target>
341
342    <target name="buildMinistreaming" depends="buildCore" >
343        <ant dir="apps/ministreaming/java/" target="jar" />
344        <copy file="apps/ministreaming/java/build/mstreaming.jar" todir="build/" />
345    </target>
346
347    <target name="buildRouter" depends="buildrouter" />
348    <target name="buildrouter" depends="buildCore" >
349        <ant dir="router/java/" target="jar" />
350        <copy file="router/java/build/router.jar" todir="build/" />
351    </target>
352
353    <target name="buildCore" depends="buildProperties" >
354        <ant dir="core/java/" target="jar" />
355        <copy file="core/java/build/i2p.jar" todir="build/" />
356    </target>
357
358    <target name="buildJrobin" depends="buildProperties" >
359        <!-- take only what we need from the jrobin jar -->
360        <jar destfile="build/jrobin.jar" >
361            <zipfileset src="apps/jrobin/jrobin-1.5.9.1.jar"
362                        excludes="org/jrobin/cmd/ org/jrobin/convertor/ org/jrobin/inspector/" />
363            <manifest>
364                <attribute name="Built-By" value="${build.built-by}" />
365                <attribute name="Build-Date" value="${build.timestamp}" />
366                <attribute name="Base-Revision" value="${workspace.version}" />
367            </manifest>
368        </jar>
369    </target>
370
371    <target name="buildProperties" depends="getMtnRev, getReleaseNumber, getBuildNumber" >
372        <!-- default if not set above -->
373        <property name="workspace.version" value="unknown" />
374        <tstamp>
375            <format property="build.timestamp" pattern="yyyy-MM-dd HH:mm:ss z" timezone="UTC" locale="en" />
376        </tstamp>
377        <property name="full.version" value="${release.number}-${i2p.build.number}${build.extra}" />
378        <echo message="Building version ${full.version} (mtn rev ${workspace.version})" />
379    </target>
380
381    <target name="buildWEB" depends="buildRouterConsole" >
382        <copy file="apps/routerconsole/java/build/routerconsole.jar" todir="build/" />
383        <copy file="apps/routerconsole/java/build/routerconsole.war" todir="build/" />
384    </target>
385
386    <target name="buildTools" depends="buildrouter" >
387        <ant dir="installer/tools/java" target="jar" />
388        <copy file="installer/tools/java/build/tools.jar" todir="build/" />
389    </target>
390
391    <!-- end of sub-build.xml targets -->
392
393    <target name="checkForMtn" >
394        <available property="mtn.available" file="_MTN" type="dir" />
395    </target>
396
397    <target name="getMtnRev" depends="checkForMtn" if="mtn.available" >
398        <exec executable="mtn" outputproperty="workspace.version" errorproperty="mtn.error1" failifexecutionfails="false" >
399            <arg value="automate" />
400            <arg value="get_base_revision_id" />
401        </exec>
402    </target>
403
404    <target name="trimMtnRev" depends="getMtnRev">
405        <script language="javascript">
406            <![CDATA[
407            var MtnRev = project.getProperty("workspace.version");
408            if (MtnRev != 'unknown' && MtnRev != null) {
409                echo = project.createTask("echo");
410                var MtnShortHash = MtnRev.substring(0,8);
411                project.setProperty("MtnShortHash", MtnShortHash);
412                echo.setMessage("Trimmed hash: " + MtnShortHash);
413                echo.perform();
414            } else {
415                project.setProperty("MtnShortHash", 'unknown');
416            }
417            ]]>
418        </script>
419    </target>
420
421    <target name="checkIfBumped">
422        <exec executable="mtn" outputproperty="bumped" errorproperty="mtn.error2" failifexecutionfails="false" >
423            <arg value="ls" />
424            <arg value="ch" />
425            <arg value="router/java/src/net/i2p/router/RouterVersion.java" />
426        </exec>
427        <condition property="bumped.already">
428            <not>
429                <equals arg1="${bumped}" arg2=""/>
430            </not>
431        </condition>
432    </target>
433
434    <target name="bumpBuild" depends="checkIfBumped, getBuildNumber" unless="bumped.already">
435        <script language="javascript">
436            <![CDATA[
437            var newBuildNumber = (Number(project.getProperty("i2p.build.number")) + 1);
438            if (newBuildNumber != 'unknown' && newBuildNumber != null) {
439                echo = project.createTask("echo");
440                project.setProperty("new.i2p.build.number", newBuildNumber);
441                echo.setMessage("Build number is now: " + newBuildNumber);
442                echo.perform();
443            }
444            ]]>
445        </script>
446        <replaceregexp byline="true" file="router/java/src/net/i2p/router/RouterVersion.java"
447            match='(^\s+public\s+final\s+static\s+long\s+BUILD\s+=\s+)[0-9]+;' replace='\1${new.i2p.build.number};'/>
448    </target>
449
450    <condition property="noExe">
451        <not>
452            <!-- We only have launch4j binaries for the following systems -->
453            <and>
454                <or>
455                    <os arch="x86" />
456                    <os arch="i386" />
457                    <os arch="i586" />
458                    <os arch="i686" />
459                    <os arch="amd64" />
460                    <os arch="x86_64" />
461                </or>
462                <or>
463                    <os name="Linux" />
464                    <os family="windows" />
465                </or>
466            </and>
467        </not>
468    </condition>
469
470    <!-- this makes an empty build/launchi2p.jar and the build/i2p.exe for the no-wrapper windows startup, if possible -->
471    <target name="buildexe" depends="buildProperties, launch4j" unless="noExe">
472        <echo message="See the file &quot;build.properties&quot; if this step fails." />
473        <jar destfile="./build/launchi2p.jar">
474            <manifest>
475                <attribute name="Main-Class" value="net.i2p.router.RouterLaunch" />
476                <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-runtime.jar lib/commons-logging.jar lib/commons-el.jar lib/wrapper.jar lib/systray.jar lib/systray4j.jar lib/desktopgui.jar lib/i2psnark.jar lib/jrobin.jar lib/jstl.jar lib/standard.jar lib/jetty-continuation.jar lib/jetty-deploy.jar lib/jetty-http.jar lib/jetty-i2p.jar lib/jetty-io.jar lib/jetty-rewrite-handler.jar lib/jetty-security.jar lib/jetty-servlet.jar lib/jetty-servlets.jar lib/jetty-start.jar lib/jetty-util.jar lib/jetty-webapp.jar lib/jetty-xml.jar" />
477                <attribute name="Built-By" value="${build.built-by}" />
478                <attribute name="Build-Date" value="${build.timestamp}" />
479                <attribute name="Base-Revision" value="${workspace.version}" />
480            </manifest>
481        </jar>
482        <!-- now the standalone launcher exe -->
483        <launch4j configFile="./installer/i2pstandalone.xml" />
484        <!-- thazzit -->
485    </target>
486
487    <target name="launch4j">
488        <taskdef name="launch4j"
489                 classname="net.sf.launch4j.ant.Launch4jTask"
490                 classpath="${basedir}/installer/lib/launch4j/launch4j.jar:${basedir}/installer/lib/launch4j/lib/xstream.jar" />
491     </target>
492
493     <!--
494          the files are now copied to the build directory
495          in the build* targets
496      -->
497     <target name="jar" depends="jarSmall" />
498     <target name="jarSmall" depends="builddepSmall, buildJrobin" />
499
500    <!-- Custom target to collect the jars that I2P-Bote needs to compile, so it can compile from source. -->
501    <target name="jarBote" depends="buildRouter, buildStreaming, buildJetty" >
502        <copy file="apps/susidns/src/WEB-INF/lib/jstl.jar" todir="build/" />
503        <copy file="apps/susidns/src/WEB-INF/lib/standard.jar" todir="build/" />
504    </target>
505
506    <target name="jbigi-list-changes" depends="checkForMtn" if="mtn.available">
507        <exec executable="mtn" outputproperty="workspace.changes.jbigi" errorproperty="mtn.error.jbigi" failifexecutionfails="false" >
508            <arg value="list" />
509            <arg value="changed" />
510            <arg value="installer/lib/jbigi" />
511        </exec>
512        <!-- \n in an attribute value generates an invalid manifest -->
513        <exec executable="tr" inputstring="${workspace.changes.jbigi}" outputproperty="workspace.changes.jbigi.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
514            <arg value="-s" />
515            <arg value="&quot;[:space:]&quot;" />
516            <arg value="," />
517        </exec>
518    </target>
519
520    <target name="jbigi" depends="buildProperties, jbigi-list-changes">
521        <!-- set if unset -->
522        <property name="workspace.changes.jbigi.tr" value="" />
523        <mkdir dir="./build" />
524        <jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
525            <fileset dir="installer/lib/jbigi" includes="*.so *.dll *.jnilib" />
526            <manifest>
527                <attribute name="Built-By" value="${build.built-by}" />
528                <attribute name="Build-Date" value="${build.timestamp}" />
529                <attribute name="Base-Revision" value="${workspace.version}" />
530                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
531            </manifest>
532        </jar>
533    </target>
534
535    <target name="jbigi-nowindows" depends="buildProperties, jbigi-list-changes">
536        <!-- set if unset -->
537        <property name="workspace.changes.jbigi.tr" value="" />
538        <jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
539            <fileset dir="installer/lib/jbigi" includes="*.so *.jnilib" />
540            <manifest>
541                <attribute name="Built-By" value="${build.built-by}" />
542                <attribute name="Build-Date" value="${build.timestamp}" />
543                <attribute name="Base-Revision" value="${workspace.version}" />
544                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
545            </manifest>
546        </jar>
547    </target>
548
549    <!-- Now system-specific jbigis in alphabetical order -->
550    <target name="jbigi-freebsd-only"  depends="buildProperties, jbigi-list-changes">
551        <!-- set if unset -->
552        <property name="workspace.changes.jbigi.tr" value="" />
553        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
554            <fileset dir="installer/lib/jbigi" includes="*bsd*.so" />
555            <manifest>
556                <attribute name="Built-By" value="${build.built-by}" />
557                <attribute name="Build-Date" value="${build.timestamp}" />
558                <attribute name="Base-Revision" value="${workspace.version}" />
559                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
560            </manifest>
561        </jar>
562    </target>
563
564    <target name="jbigi-linux-only"  depends="buildProperties, jbigi-list-changes">
565        <!-- set if unset -->
566        <property name="workspace.changes.jbigi.tr" value="" />
567        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
568            <fileset dir="installer/lib/jbigi" includes="*linux*.so" />
569            <manifest>
570                <attribute name="Built-By" value="${build.built-by}" />
571                <attribute name="Build-Date" value="${build.timestamp}" />
572                <attribute name="Base-Revision" value="${workspace.version}" />
573                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
574            </manifest>
575        </jar>
576    </target>
577
578    <target name="jbigi-linux-x86-only"  depends="buildProperties, jbigi-list-changes">
579        <!-- set if unset -->
580        <property name="workspace.changes.jbigi.tr" value="" />
581        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
582            <fileset dir="installer/lib/jbigi" includes="*linux*.so" excludes="*linux-arm*.so,*linux-ppc*.so" />
583            <manifest>
584                <attribute name="Built-By" value="${build.built-by}" />
585                <attribute name="Build-Date" value="${build.timestamp}" />
586                <attribute name="Base-Revision" value="${workspace.version}" />
587                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
588            </manifest>
589        </jar>
590    </target>
591
592
593    <target name="jbigi-linux-nonx86-only"  depends="buildProperties, jbigi-list-changes">
594        <!-- set if unset -->
595        <property name="workspace.changes.jbigi.tr" value="" />
596        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
597            <fileset dir="installer/lib/jbigi" includes="*linux-arm*.so,*linux-ppc*.so" />
598            <manifest>
599                <attribute name="Built-By" value="${build.built-by}" />
600                <attribute name="Build-Date" value="${build.timestamp}" />
601                <attribute name="Base-Revision" value="${workspace.version}" />
602                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
603            </manifest>
604        </jar>
605    </target>
606
607    <target name="jbigi-osx-only"  depends="buildProperties, jbigi-list-changes" >
608        <!-- set if unset -->
609        <property name="workspace.changes.jbigi.tr" value="" />
610        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
611            <fileset dir="installer/lib/jbigi" includes="*.jnilib" />
612            <manifest>
613                <attribute name="Built-By" value="${build.built-by}" />
614                <attribute name="Build-Date" value="${build.timestamp}" />
615                <attribute name="Base-Revision" value="${workspace.version}" />
616                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
617            </manifest>
618        </jar>
619    </target>
620
621    <target name="jbigi-windows-only" depends="buildProperties, jbigi-list-changes" >
622        <!-- set if unset -->
623        <property name="workspace.changes.jbigi.tr" value="" />
624        <jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
625            <fileset dir="installer/lib/jbigi" includes="*windows*.dll" />
626            <manifest>
627                <attribute name="Built-By" value="${build.built-by}" />
628                <attribute name="Build-Date" value="${build.timestamp}" />
629                <attribute name="Base-Revision" value="${workspace.version}" />
630                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
631            </manifest>
632        </jar>
633    </target>
634
635    <!-- the apps need to compile the jsps to poupdate -->
636    <target name="poupdate" depends="buildRouter, buildStreaming, buildSystray, buildJetty, buildDesktopGui" >
637        <echo message="Setting environment variable LG2 to a lang code (eg: de,zh,nl etc)" />
638        <echo message=" will restrict language update to the language you specified, leaving other language untact." />
639        <ant dir="apps/routerconsole/java/" >
640            <target name="poupdate" />
641            <target name="poupdate-news" />
642            <target name="poupdate-countries" />
643        </ant>
644        <ant dir="apps/i2psnark/java/" target="poupdate" />
645        <ant dir="apps/i2ptunnel/java/" >
646            <target name="poupdate" />
647            <target name="poupdate-proxy" />
648        </ant>
649        <ant dir="apps/susidns/src/" target="poupdate" />
650        <ant dir="apps/susimail/" target="poupdate" />
651        <ant dir="apps/desktopgui" target="poupdate" />
652        <ant dir="installer/resources/locale" target="poupdate" />
653        <ant dir="apps/ministreaming/java" target="poupdate" />
654    </target>
655
656    <condition property="no.bundle">
657        <isfalse value="${require.gettext}" />
658    </condition>
659
660    <target name="prep-script-translation" unless="no.bundle" >
661        <!-- script translation added in 0.8.13, enabled in 0.9.5. -->
662        <ant dir="installer/resources/locale" target="bundle" />
663        <copy todir="pkg-temp/locale/">
664            <fileset dir="installer/resources/locale/mo/" />
665        </copy>
666    </target>
667
668    <target name="javadoc" depends="getReleaseNumber, getBuildNumber" >
669        <ant dir="apps/jetty" target="ensureJettylib" />
670        <mkdir dir="./build" />
671        <mkdir dir="./build/javadoc" />
672        <javadoc access="package"
673            destdir="./build/javadoc"
674            packagenames="*"
675            use="true"
676            splitindex="true"
677            doctitle="I2P Javadocs for Release ${release.number} Build ${i2p.build.number}${build.extra}"
678            windowtitle="I2P Anonymous Network - Java Documentation - Version ${release.number}">
679            <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.oldcrypto:org.bouncycastle.oldcrypto.*:gnu.crypto.*:gnu.getopt:gnu.gettext:com.nettgryppa.security:net.metanotion:net.metanotion.*" />
680            <group title="Streaming Library" packages="net.i2p.client.streaming:net.i2p.client.streaming.impl" />
681            <group title="Router" packages="net.i2p.router:net.i2p.router.*:net.i2p.data.i2np:net.i2p.data.router:org.cybergarage.*:org.freenetproject:org.xlattice.crypto.filters" />
682            <group title="Router Console" packages="net.i2p.router.web:net.i2p.router.update:net.i2p.router.news" />
683            <!-- apps and bridges starting here, alphabetical please -->
684            <group title="Addressbook Application" packages="net.i2p.addressbook" />
685            <group title="BOB Bridge" packages="net.i2p.BOB" />
686            <group title="BOB Demos" packages="net.i2p.BOB.Demos.echo.echoclient:net.i2p.BOB.Demos.echo.echoserver" />
687            <group title="Desktopgui Application" packages="net.i2p.desktopgui:net.i2p.desktopgui.*" />
688            <group title="I2PSnark Application" packages="org.klomp.snark:org.klomp.snark.*" />
689            <group title="I2PTunnel Application" packages="net.i2p.i2ptunnel:net.i2p.i2ptunnel.*" />
690            <group title="Installer Utilities" packages="net.i2p.installer" />
691            <group title="Jetty Starter and Logging" packages="net.i2p.jetty:net.i2p.servlet:net.i2p.servlet.*" />
692            <group title="SAM Bridge" packages="net.i2p.sam" />
693            <group title="SAM Demos" packages="net.i2p.sam.client" />
694            <group title="SusiDNS Application" packages="i2p.susi.dns" />
695            <group title="SusiMail Application" packages="i2p.susi.webmail:i2p.susi.webmail.*:i2p.susi.debug:i2p.susi.util:org.mortbay.servlet:org.mortbay.util" />
696            <group title="Systray Application" packages="net.i2p.apps.systray" />
697            <sourcepath>
698                <pathelement location="core/java/src" />
699                <pathelement location="router/java/src" />
700                <pathelement location="apps/ministreaming/java/src" />
701                <pathelement location="apps/streaming/java/src" />
702                <pathelement location="apps/i2ptunnel/java/src" />
703                <pathelement location="apps/systray/java/src" />
704                <pathelement location="apps/desktopgui/src" />
705                <pathelement location="apps/routerconsole/java/src" />
706                <pathelement location="apps/addressbook/java/src" />
707                <pathelement location="apps/i2psnark/java/src" />
708                <pathelement location="apps/sam/java/src" />
709                <pathelement location="apps/BOB/src" />
710                <pathelement location="apps/BOB/Demos/echo/echoclient/src" />
711                <pathelement location="apps/BOB/Demos/echo/echoserver/src" />
712                <pathelement location="apps/susidns/src/java/src" />
713                <pathelement location="apps/susimail/src/src" />
714                <pathelement location="apps/jetty/java/src" />
715                <pathelement location="installer/java/src" />
716            </sourcepath>
717            <classpath>
718                <pathelement location="apps/jetty/jettylib/org.mortbay.jetty.jar" />
719                <pathelement location="apps/jetty/jettylib/javax.servlet.jar" />
720                <pathelement location="apps/jetty/jettylib/jetty-http.jar" />
721                <pathelement location="apps/jetty/jettylib/jetty-security.jar" />
722                <pathelement location="apps/jetty/jettylib/jetty-servlet.jar" />
723                <pathelement location="apps/jetty/jettylib/jetty-start.jar" />
724                <pathelement location="apps/jetty/jettylib/jetty-util.jar" />
725                <pathelement location="apps/jetty/jettylib/jetty-webapp.jar" />
726                <pathelement location="apps/jetty/jettylib/jetty-xml.jar" />
727                <pathelement location="apps/systray/java/lib/systray4j.jar" />
728                <pathelement location="apps/jrobin/jrobin-1.5.9.1.jar" />
729                <pathelement location="installer/lib/wrapper/all/wrapper.jar" />
730            </classpath>
731            <!-- These variables are stored in build.properties.
732                  End-users can override by creating the file override.properties -->
733            <link offline="true" href="${javasedocs.url}" packagelistLoc="installer/resources/package-lists/java/" />
734            <link offline="true" href="${javaeedocs.url}" packagelistLoc="installer/resources/package-lists/javaee/" />
735            <link offline="true" href="${jettydocs.url}" packagelistLoc="installer/resources/package-lists/jetty/" />
736            <link offline="true" href="${jrobindocs.url}" packagelistLoc="installer/resources/package-lists/jrobin/" />
737            <link offline="true" href="${wrapperdocs.url}" packagelistLoc="installer/resources/package-lists/wrapper/" />
738        </javadoc>
739        <echo message="Warning, javadoc embeds timestamps in the output, run with 'TZ=UTC ant javadoc' if you plan to distribute" />
740    </target>
741    <target name="javadoc-zip" depends="javadoc">
742        <zip destfile="javadoc.zip" basedir="build" level="9" includes="javadoc\**" />
743    </target>
744
745    <target name="javadoc-test" depends="buildRouter, javadoc" >
746        <mkdir dir="./build" />
747        <mkdir dir="./build/javadoc-test" />
748
749        <!-- set junit home to the old default unless overridden elsewhere -->
750        <property name="junit.home" value="${ant.home}/lib/" />
751        <javadoc access="package"
752            destdir="./build/javadoc-test"
753            packagenames="*"
754            use="true"
755            splitindex="true"
756            doctitle="I2P Unit Test Javadocs for Release ${release.number} Build ${i2p.build.number}${build.extra}"
757            windowtitle="I2P Anonymous Network - Java Documentation - Version ${release.number}">
758            <group title="Core SDK" packages="net.i2p:net.i2p.*:net.i2p.client:net.i2p.client.*:net.i2p.internal:net.i2p.internal.*:freenet.support.CPUInformation:org.bouncycastle.oldcrypto:org.bouncycastle.oldcrypto.*:gnu.crypto.*:gnu.gettext:org:com.nettgryppa.security:net.metanotion:net.metanotion.*" />
759            <group title="Router" packages="net.i2p.router:net.i2p.router.*:net.i2p.data.i2np:org.cybergarage.*:org.freenetproject:org.xlattice.crypto.filters" />
760            <sourcepath>
761                <pathelement location="core/java/test/junit" />
762                <pathelement location="router/java/test/junit" />
763                <pathelement location="core/java/test/scalatest" />
764            </sourcepath>
765            <classpath>
766                <pathelement location="build/i2p.jar" />
767                <pathelement location="build/router.jar" />
768                <pathelement location="${junit.home}/junit4.jar" />
769                <pathelement location="${hamcrest.home}/hamcrest-all.jar" />
770            </classpath>
771            <!--
772                 These variables are stored in build.properties.
773                 End-users can override by creating the file override.properties
774            -->
775            <link offline="true" href="${javasedocs.url}" packagelistLoc="installer/resources/package-lists/java/" />
776            <link offline="true" href="${junitdocs.url}" packagelistLoc="installer/resources/package-lists/junit/" />
777            <link offline="true" href="${i2pdocs.url}" packagelistLoc="build/javadoc/" />
778        </javadoc>
779        <echo message="Warning, javadoc embeds timestamps in the output, run with 'TZ=UTC ant javadoc' if you plan to distribute" />
780    </target>
781
782    <target name="getReleaseNumber">
783        <loadfile srcfile="core/java/src/net/i2p/CoreVersion.java" property="release.number">
784            <filterchain>
785                <linecontains>
786                    <contains value="public final static String VERSION"/>
787                </linecontains>
788                <tokenfilter>
789                    <replaceregex pattern='.*"([^"]+)";' replace="\1" flags="gi" />
790                </tokenfilter>
791                <striplinebreaks/>
792                <trim/>
793            </filterchain>
794        </loadfile>
795        <property name="release.number" value="unknown" />
796        <echo message="Release number is ${release.number}" />
797    </target>
798
799    <target name="getBuildNumber">
800        <loadfile srcfile="router/java/src/net/i2p/router/RouterVersion.java" property="i2p.build.number">
801            <filterchain>
802                <linecontains>
803                    <contains value="public final static long BUILD" />
804                </linecontains>
805                <tokenfilter>
806                    <replaceregex pattern=".*=\s+([0-9]+);" replace="\1" flags="gi" />
807                </tokenfilter>
808                <trim/>
809                <striplinebreaks/>
810            </filterchain>
811        </loadfile>
812        <loadfile srcfile="router/java/src/net/i2p/router/RouterVersion.java" property="build.extra">
813            <filterchain>
814                <linecontains>
815                    <contains value="public final static String EXTRA" />
816                </linecontains>
817                <tokenfilter>
818                    <replaceregex pattern='.*"(.*)";' replace="\1" flags="gi" />
819                </tokenfilter>
820                <trim/>
821                <striplinebreaks/>
822            </filterchain>
823        </loadfile>
824        <property name="i2p.build.number" value="??" />
825        <property name="build.extra" value="" />
826        <echo message="Build number is ${i2p.build.number}${build.extra}" />
827    </target>
828
829    <target name="verifyReleaseBuildNumbers" depends="getReleaseNumber, getBuildNumber" >
830        <echo message="SDK: ${java.vendor} ${java.version} (${java.runtime.name} ${java.runtime.version})" />
831        <fail message="Bad release number: ${release.number}" >
832            <condition>
833                <or>
834                    <equals arg1="${release.number}" arg2="unknown"/>
835                    <equals arg1="${release.number}" arg2=""/>
836                </or>
837            </condition>
838        </fail>
839        <fail message="Non-zero build number: ${i2p.build.number}" >
840            <condition>
841                <not>
842                    <equals arg1="${i2p.build.number}" arg2="0"/>
843                </not>
844            </condition>
845        </fail>
846        <fail message="Non-empty extra build: ${build.extra}" >
847            <condition>
848                <not>
849                    <equals arg1="${build.extra}" arg2=""/>
850                </not>
851            </condition>
852        </fail>
853    </target>
854
855    <target name="-pre-release">
856            <echo message="================================================================" />
857            <echo message="Did you update these files?" />
858            <exec executable="ls" failonerror="true">
859                    <arg value="-l" />
860                    <arg value="history.txt" />
861                    <arg value="installer/install.xml" />
862                    <arg value="core/java/src/net/i2p/CoreVersion.java" />
863                    <arg value="router/java/src/net/i2p/router/RouterVersion.java" />
864            </exec>
865            <echo message="Everything is checked in, right? Let's be sure:" />
866            <exec executable="mtn" failonerror="true">
867                    <arg value="st" />
868            </exec>
869            <echo message="If there are any modified files above, stop now!" />
870            <echo message="================================================================" />
871            <sleep seconds="3"/>
872    </target>
873
874    <target name="clean" depends="pkgclean" >
875        <delete dir="./build" />
876        <delete dir="./reports" />
877        <delete file="installer/lib/izpack/patches.jar" failonerror="false" quiet="true" />
878        <delete file="syndie-standalone.zip" failonerror="false" quiet="true" />
879        <delete file="i2psnark-standalone.zip" failonerror="false" quiet="true" />
880        <delete file="BOB-one.jar" failonerror="false" quiet="true" />
881        <delete file="core/java/cobertura.ser"/>
882        <delete file="javadoc.zip" />
883        <delete file="i2p.fba" />
884        <delete file="${sloccount.report.file}" />
885    </target>
886
887    <target name="distclean" depends="clean">
888        <delete failonerror="false" quiet="true">
889            <fileset dir="." includes="i2pinstall* *.deb i2p_*.bz2 i2pupdate* i2psource* *.sig *.torrent" />
890        </delete>
891        <ant dir="core/java/" target="distclean" />
892        <ant dir="router/java/" target="distclean" />
893        <ant dir="installer/java" target="distclean" />
894        <ant dir="apps/ministreaming/java/" target="distclean" />
895        <ant dir="apps/streaming/java/" target="distclean" />
896        <ant dir="apps/i2ptunnel/java/" target="distclean" />
897        <ant dir="apps/sam/java/" target="distclean" />
898        <ant dir="apps/BOB" target="clean" />
899        <ant dir="apps/desktopgui" target="clean" />
900        <ant dir="apps/routerconsole/java/" target="distclean" />
901        <ant dir="apps/addressbook/" target="distclean" />
902        <ant dir="apps/susimail/" target="distclean" />
903        <ant dir="apps/susidns/src/" target="distclean" />
904        <ant dir="apps/systray/java/" target="distclean" />
905        <ant dir="apps/i2psnark/java/" target="distclean" />
906        <ant dir="apps/jetty/" target="distclean" />
907        <delete dir="core/c/jbigi/bin" />
908        <delete dir="core/c/jbigi/lib" />
909        <delete dir="core/c/jcpuid/lib" />
910        <ant dir="installer/resources/locale" target="distclean" />
911        <!--
912                NOTE! We need to turn off the default excludes for these
913                patterns to work.
914                These are the defaultexcludes in Ant as seen on
915                http://ant.apache.org/manual/CoreTasks/defaultexcludes.html
916                     **/*~
917                     **/#*#
918                     **/.#*
919                     **/%*%
920                     **/._*
921                     **/CVS
922                     **/CVS/**
923                     **/.cvsignore
924                     **/SCCS
925                     **/SCCS/**
926                     **/vssver.scc
927                     **/.svn
928                     **/.svn/**
929                     **/.DS_Store
930                The only recourse is to remove the offending ones.
931                We do this here, as we only need one change, and then put it
932                back after we are done with it.
933        -->
934        <defaultexcludes remove="**/*~"/>
935
936        <delete>
937            <fileset dir="." includes="**/*.class **/*.java~ **/*.txt~ **/*.xml~ **/*.sh~ **/*.SlackBuild~" />
938            <!--
939                Less common, but they pollute my workspace here, so we
940                might as well nuke these as well. Are there any others?
941               
942                !!??? Why don't we just nuke "**/*~" ???!!
943
944                ++Sponge
945            -->
946        </delete>
947        <!--
948                Now we put the defaults back
949        -->
950        <defaultexcludes default="true"/>
951    </target>
952
953    <target name="webappDistclean">
954        <ant dir="apps/i2ptunnel/java/" target="distclean" />
955        <ant dir="apps/routerconsole/java/" target="distclean" />
956        <ant dir="apps/addressbook/" target="distclean" />
957        <ant dir="apps/susimail/" target="distclean" />
958        <ant dir="apps/susidns/src/" target="distclean" />
959        <ant dir="apps/i2psnark/java/" target="distclean" />
960    </target>
961
962    <target name="pkg" depends="distclean, updater, preppkg, installer" />
963
964    <target name="pkg200" depends="distclean, updater200, preppkg, installer" />
965
966    <target name="pkgclean" depends="deletepkg-temp">
967        <delete>
968            <fileset dir="." includes="i2p.tar.bz2 install.jar i2pupdate.zip i2pupdate200.zip" />
969        </delete>
970    </target>
971
972    <target name="preppkg" depends="preppkg-linux, preppkg-freebsd, preppkg-osx, preppkg-windows, jbigi">
973        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
974        <copy todir="pkg-temp/lib/wrapper/solaris/">
975            <fileset dir="installer/lib/wrapper/solaris/" excludes="*.txt" />
976        </copy>
977    </target>
978
979    <target name="preppkg-nowindows" depends="preppkg-linux, preppkg-freebsd, preppkg-osx, jbigi-nowindows">
980        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
981        <copy todir="pkg-temp/lib/wrapper/solaris/">
982            <fileset dir="installer/lib/wrapper/solaris/" excludes="*.txt" />
983        </copy>
984        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
985    </target>
986
987    <target name="preppkgRepack" depends="preppkg-linux, preppkg-freebsd, preppkg-osx, preppkg-windows, jbigi">
988        <ant target="repack200" />
989        <!-- no use doing repack200 on jbigi.jar -->
990        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
991        <copy todir="pkg-temp/lib/wrapper/solaris/">
992            <fileset dir="installer/lib/wrapper/solaris/" excludes="*.txt" />
993        </copy>
994    </target>
995
996    <target name="preppkg-freebsd" depends="preppkg-unix">
997        <copy todir="pkg-temp/lib/wrapper/freebsd/">
998            <fileset dir="installer/lib/wrapper/freebsd/" excludes="*.txt" />
999        </copy>
1000        <copy todir="pkg-temp/lib/wrapper/freebsd64/">
1001            <fileset dir="installer/lib/wrapper/freebsd64" excludes="*.txt" />
1002        </copy>
1003    </target>
1004
1005    <target name="preppkg-freebsd-only" depends="preppkg-freebsd, jbigi-freebsd-only" >
1006        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
1007        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
1008    </target>
1009
1010    <!-- only what is needed for debian, etc. -->
1011    <target name="preppkg-linux-only" depends="preppkg-linux, jbigi-linux-only" >
1012        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
1013        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
1014    </target>
1015
1016    <target name="preppkg-unix" depends="preppkg-base, prep-script-translation" >
1017        <copy file="installer/resources/runplain.sh" todir="pkg-temp/" />
1018        <copy file="installer/resources/eepget" todir="pkg-temp/" />
1019        <copy file="installer/resources/i2prouter" todir="pkg-temp/" />
1020        <copy file="installer/resources/osid" todir="pkg-temp/" />
1021        <copy file="installer/resources/postinstall.sh" todir="pkg-temp/" />
1022        <copy todir="pkg-temp/man/">
1023            <fileset dir="installer/resources/man/" />
1024        </copy>
1025    </target>
1026
1027    <target name="preppkg-linux" depends="preppkg-linux-x86,preppkg-linux-nonx86" />
1028
1029    <target name="preppkg-linux-x86" depends="preppkg-unix">
1030        <copy todir="pkg-temp/lib/wrapper/linux/">
1031            <fileset dir="installer/lib/wrapper/linux/" excludes="*.txt" />
1032        </copy>
1033        <copy todir="pkg-temp/lib/wrapper/linux64/">
1034            <fileset dir="installer/lib/wrapper/linux64/" excludes="*.txt" />
1035        </copy>
1036    </target>
1037
1038    <target name="preppkg-linux-nonx86" depends="preppkg-unix">
1039        <copy todir="pkg-temp/lib/wrapper/linux-ppc/">
1040            <fileset dir="installer/lib/wrapper/linux-ppc/" excludes="*.txt" />
1041        </copy>
1042        <copy todir="pkg-temp/lib/wrapper/linux-armv5/">
1043            <fileset dir="installer/lib/wrapper/linux-armv5/" excludes="*.txt" />
1044        </copy>
1045        <copy todir="pkg-temp/lib/wrapper/linux-armv6/">
1046            <fileset dir="installer/lib/wrapper/linux-armv6/" excludes="*.txt" />
1047        </copy>
1048    </target>
1049
1050    <target name="preppkg-osx" depends="preppkg-unix">
1051        <!--<copy file="installer/resources/I2P Router Console.webloc" todir="pkg-temp/" />-->
1052        <copy todir="pkg-temp/Start I2P Router.app">
1053            <fileset dir="installer/resources/Start I2P Router.app" />
1054        </copy>
1055        <copy todir="pkg-temp/lib/wrapper/macosx/">
1056            <fileset dir="installer/lib/wrapper/macosx/" excludes="*.txt" />
1057        </copy>
1058        <copy file="installer/resources/net.i2p.router.plist.template" todir="pkg-temp/" />
1059        <copy file="installer/resources/install_i2p_service_osx.command" todir="pkg-temp/" />
1060        <copy file="installer/resources/uninstall_i2p_service_osx.command" todir="pkg-temp/" />
1061    </target>
1062
1063    <target name="preppkg-osx-only" depends="preppkg-osx, jbigi-osx-only" >
1064        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
1065        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
1066    </target>
1067
1068    <target name="preppkg-windows" depends="preppkg-base, buildUtilityJar, buildexe">
1069        <copy file="build/i2p.exe" todir="pkg-temp/" failonerror="false" />
1070        <copy file="apps/systray/java/lib/systray4j.dll" todir="pkg-temp/lib" />
1071        <copy file="apps/systray/java/resources/iggy.ico" todir="pkg-temp/icons" />
1072        <copy file="apps/systray/java/resources/iggy.xpm" todir="pkg-temp/icons" />
1073        <copy file="installer/resources/eepget.bat" todir="pkg-temp/" />
1074        <copy file="installer/resources/i2prouter.bat" todir="pkg-temp/" />
1075        <copy file="installer/resources/fixperms.bat" todir="pkg-temp/" />
1076        <copy file="installer/resources/install_i2p_service_winnt.bat" todir="pkg-temp/" />
1077        <copy file="installer/resources/set_config_dir_for_nt_service.bat" todir="pkg-temp/" />
1078        <copy file="installer/resources/uninstall_i2p_service_winnt.bat" todir="pkg-temp/" />
1079        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
1080        <copy file="build/utility.jar" todir="pkg-temp" />
1081        <copy todir="pkg-temp/lib/wrapper/win32/">
1082            <fileset dir="installer/lib/wrapper/win32/" excludes="*.txt" />
1083        </copy>
1084        <copy todir="pkg-temp/lib/wrapper/win64/">
1085            <fileset dir="installer/lib/wrapper/win64/" excludes="*.txt" />
1086        </copy>
1087    </target>
1088
1089    <target name="preppkg-windows-only" depends="preppkg-windows, jbigi-windows-only">
1090        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
1091        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
1092    </target>
1093
1094    <target name="preppkg-base" depends="build, preplicenses, prepConsoleDocs, prepthemeupdates, prepCertificates, prepRouterInfos">
1095        <!-- if updater200 was run previously, it left *.pack files in pkg-temp -->
1096        <!-- Also remove deletelist.txt used for updater only -->
1097        <delete>
1098            <fileset dir="pkg-temp" includes="**/*.jar.pack **/*.war.pack deletelist.txt" />
1099        </delete>
1100        <copy file="build/i2p.jar" todir="pkg-temp/lib/" />
1101        <copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
1102        <!-- all jetty stuff -->
1103        <copy todir="pkg-temp/lib" >
1104            <fileset dir="build" includes="commons*.jar jasper*.jar javax*.jar jetty*.jar jsp*.jar org.mortbay.*.jar" />
1105        </copy>
1106        <copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
1107        <copy file="build/streaming.jar" todir="pkg-temp/lib/" />
1108        <copy file="build/router.jar" todir="pkg-temp/lib/" />
1109        <copy file="build/desktopgui.jar" todir="pkg-temp/lib/" />
1110        <copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
1111        <!-- pulled out of routerconsole.jar in 0.7.12; name without version so we can overwrite if we upgrade  -->
1112        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
1113        <copy file="build/sam.jar" todir="pkg-temp/lib/" />
1114        <copy file="build/BOB.jar" todir="pkg-temp/lib/" />
1115        <copy file="build/systray.jar" todir="pkg-temp/lib" />
1116        <copy file="build/i2psnark.jar" todir="pkg-temp/lib/" />
1117        <copy file="apps/systray/java/lib/systray4j.jar" todir="pkg-temp/lib" />
1118        <copy file="build/i2ptunnel.war" todir="pkg-temp/webapps/" />
1119        <copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
1120        <copy file="build/addressbook.war" todir="pkg-temp/webapps/" />
1121        <copy file="build/susimail.war" todir="pkg-temp/webapps/" />
1122        <copy file="build/susidns.war" todir="pkg-temp/webapps/" />
1123        <copy file="apps/susidns/src/WEB-INF/lib/jstl.jar" todir="pkg-temp/lib/" />
1124        <copy file="apps/susidns/src/WEB-INF/lib/standard.jar" todir="pkg-temp/lib/" />
1125        <copy file="build/i2psnark.war" todir="pkg-temp/webapps/" />
1126        <copy file="apps/i2psnark/i2psnark.config" todir="pkg-temp/" />
1127        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
1128        <copy file="installer/resources/clients.config" todir="pkg-temp/" />
1129        <copy file="installer/resources/i2ptunnel.config" todir="pkg-temp/" />
1130        <copy file="installer/resources/systray.config" todir="pkg-temp/" />
1131        <copy file="installer/resources/wrapper.config" todir="pkg-temp/" />
1132        <copy file="installer/resources/hosts.txt" todir="pkg-temp/" />
1133        <copy file="INSTALL-headless.txt" todir="pkg-temp/" />
1134        <!-- overwrite the truncated history put in by the updater -->
1135        <copy file="history.txt" todir="pkg-temp/" overwrite="true" />
1136        <mkdir dir="pkg-temp/scripts" />
1137        <copy file="apps/proxyscript/i2pProxy.pac" todir="pkg-temp/scripts/" />
1138        <copy file="installer/resources/startconsole.html" todir="pkg-temp/docs/" />
1139        <copy file="installer/resources/start.ico" todir="pkg-temp/docs/" />
1140        <copy file="installer/resources/console.ico" todir="pkg-temp/docs/" />
1141        <copy file="installer/resources/uninstall.ico" todir="pkg-temp/docs/" />
1142        <!-- Eepsite stuff here -->
1143        <mkdir dir="pkg-temp/eepsite" />
1144        <copy todir="pkg-temp/eepsite/" >
1145            <fileset dir="installer/resources/eepsite/" excludes="**/.placeholder" />
1146        </copy>
1147        <copy todir="pkg-temp/eepsite/docroot/help/lib/" >
1148            <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" />
1149        </copy>
1150        <copy file="installer/resources/themes/console/images/favicon.ico" tofile="pkg-temp/eepsite/docroot/favicon.ico" />
1151        <copy todir="pkg-temp/docs/icons/flags" >
1152          <fileset dir="installer/resources/icons/flags" />
1153        </copy>
1154    </target>
1155
1156    <target name="preplicenses">
1157        <copy file="LICENSE.txt" todir="pkg-temp/" />
1158        <copy todir="pkg-temp/licenses/" >
1159          <fileset dir="licenses/" />
1160        </copy>
1161        <!--
1162              The license in launch4j/ is a BSD license for launch4j
1163              The license in launch4j/head is a MIT license for the code that is actually wrapped around the jars
1164              So we include the MIT one in our binary package
1165         -->
1166        <copy file="installer/lib/launch4j/head/LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-Launch4j.txt" />
1167        <copy file="apps/jetty/apache-tomcat-deployer/NOTICE" tofile="pkg-temp/licenses/NOTICE-Tomcat.txt" />
1168        <!--  Not sure if these are used or should be included -->
1169        <copy file="installer/lib/launch4j/lib/foxtrot.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-Foxtrot.txt" />
1170        <copy file="installer/lib/launch4j/lib/JGoodies.Forms.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-JGoodies-Forms.txt" />
1171        <copy file="installer/lib/launch4j/lib/JGoodies.Looks.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-JGoodies-Looks.txt" />
1172        <copy file="installer/lib/launch4j/lib/XStream.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-XStream.txt" />
1173    </target>
1174
1175    <target name="prepthemeupdates">
1176        <copy todir="pkg-temp/docs/themes/" >
1177            <fileset dir="installer/resources/themes/" />
1178        </copy>
1179    </target>
1180
1181    <!-- SSL Certs -->
1182    <target name="prepCertificates">
1183        <copy todir="pkg-temp/certificates/" >
1184          <fileset dir="installer/resources/certificates/" />
1185        </copy>
1186    </target>
1187
1188    <condition property="no.bundle.routerInfos">
1189        <isfalse value="${bundle.routerInfos}" />
1190    </condition>
1191
1192    <target name="prepRouterInfos" depends="buildrouter, buildTools" unless="no.bundle.routerInfos">
1193        <delete dir="pkg-temp/netDb" />
1194        <mkdir dir="pkg-temp/netDb" />
1195        <java classname="net.i2p.router.networkdb.kademlia.BundleRouterInfos" fork="true" failonerror="true">
1196            <classpath>
1197                <pathelement location="build/i2p.jar" />
1198                <pathelement location="build/router.jar" />
1199                <pathelement location="build/tools.jar" />
1200            </classpath>
1201            <arg value="-i" />
1202            <arg value="${bundle.routerInfos.i2pConfigDir}" />
1203            <arg value="-o" />
1204            <arg value="pkg-temp/netDb" />
1205            <arg value="-c" />
1206            <arg value="${bundle.routerInfos.count}" />
1207        </java>
1208    </target>
1209
1210    <target name="-areRouterInfosEnabled">
1211        <fail message="Option requires &quot;bundle.routerInfos&quot; to be configured. Please read &quot;build.properties&quot; for more info." >
1212            <condition>
1213                <isfalse value="${bundle.routerInfos}" />
1214            </condition>
1215        </fail>
1216    </target>
1217
1218    <target name="i2pseeds" depends="-areRouterInfosEnabled, prepRouterInfos">
1219        <delete file="i2pseeds.zip" />
1220        <delete file="i2pseeds.su3" />
1221        <zip destfile="i2pseeds.zip" basedir="pkg-temp/netDb" whenempty="fail" />
1222        <su3sign infile="i2pseeds.zip" sigtype="RESEED" outfile="i2pseeds.su3" />
1223    </target>
1224
1225    <!-- this is no longer required, izpack 4.3.0 supports headless installs with java -jar i2pinstall.exe -console -->
1226    <!-- and this is no longer used by the SlackBuild -->
1227    <target name="tarball" depends="preppkg">
1228        <tar compression="bzip2" destfile="i2p.tar.bz2">
1229            <tarfileset dir="pkg-temp" includes="**/*" prefix="i2p" />
1230        </tar>
1231    </target>
1232
1233    <target name="deletepkg-temp">
1234        <delete dir="pkg-temp" />
1235    </target>
1236
1237    <!-- readme and proxy error page files, initialNews.xml files, GeoIP files, and flag icons -->
1238    <target name="prepConsoleDocs" depends="prepConsoleDocUpdates, prepgeoupdate" >
1239        <copy todir="pkg-temp/docs/initialNews/">
1240          <fileset dir="installer/resources/initialNews/" />
1241        </copy>
1242        <!-- ensure the proxy files have the correct line endings -->
1243        <fixcrlf srcdir="pkg-temp/docs" includes="*.ht" encoding="utf8" eol="crlf" />
1244    </target>
1245
1246    <!-- readme and proxy error page files -->
1247    <target name="prepConsoleDocUpdates">
1248        <copy todir="pkg-temp/docs/" >
1249          <fileset dir="installer/resources/readme/" includes="readme*.html" />
1250          <fileset dir="installer/resources/proxy/" includes="*.ht" />
1251          <!-- 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; cw.png added in 0.9.5 -->
1252          <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 icons/flags/cw.png" />
1253        </copy>
1254    </target>
1255
1256    <target name="consoleDocs" depends="deletepkg-temp, prepConsoleDocs">
1257        <zip destfile="docs.zip" basedir="pkg-temp" whenempty="fail" />
1258    </target>
1259
1260    <target name="copyJavadoc" depends="javadoc">
1261        <copy todir="pkg-temp/docs/javadoc" >
1262          <fileset dir="build/javadoc/" />
1263        </copy>
1264    </target>
1265
1266    <target name="updater200" depends="prepupdate, preplicenses, pack200, zipit200" />
1267    <target name="updater200WithJetty" depends="prepjupdate, preplicenses, pack200, zipit200" />
1268    <target name="updater200WithJettyAndGeoIP" depends="prepjupdate, prepgeoupdate, preplicenses, pack200, zipit200" />
1269    <target name="updater200WithJettyFixes" depends="prepjupdatefixes, preplicenses, pack200, zipit200" />
1270    <target name="updater200WithJettyFixesAndJbigi" depends="prepjupdatefixes, prepjbigiupdate, preplicenses, pack200, zipit200" />
1271    <target name="updater" depends="prepupdate, preplicenses, zipit" />
1272    <target name="updaterRepack" depends="prepupdate, preplicenses, repack200, zipit" />
1273    <target name="updaterWithJavadoc" depends="prepupdate, preplicenses, copyJavadoc, zipit" />
1274    <target name="updater200WithJavadoc" depends="prepupdate, preplicenses, copyJavadoc, pack200, zipit200" />
1275    <target name="updaterWithJavadocAndJetty" depends="prepjupdate, preplicenses, copyJavadoc, zipit" />
1276    <target name="updater200WithJavadocAndJetty" depends="prepjupdate, preplicenses, copyJavadoc, pack200, zipit200" />
1277    <target name="updaterWithGeoIP" depends="prepupdate, prepgeoupdate, preplicenses, zipit" />
1278    <target name="updaterWithJetty" depends="prepjupdate, preplicenses, zipit" />
1279    <target name="updaterWithJettyRepack" depends="prepjupdate, preplicenses, repack200, zipit" />
1280    <target name="updaterWithJettyAndGeoIPRepack" depends="prepjupdate, prepgeoupdate, preplicenses, repack200, zipit" />
1281    <target name="updaterWithJettyFixes" depends="prepjupdatefixes, preplicenses, zipit" />
1282    <target name="updaterWithJettyFixesAndJbigi" depends="prepjupdatefixes, prepjbigiupdate, preplicenses, zipit" />
1283    <target name="updaterWithJettyFixesAndGeoIP" depends="prepjupdatefixes, prepgeoupdate, preplicenses, zipit" />
1284    <target name="updaterSmall" depends="prepupdateSmall, zipit" />
1285    <target name="updaterRouter" depends="prepupdateRouter, zipit" />
1286
1287    <target name="-sign-update" depends="buildrouter">
1288        <su3sign infile="i2pupdate200.zip" sigtype="ROUTER" outfile="i2pupdate.su3" />
1289    </target>
1290
1291    <target name="signed-updater200" depends="updater200, -sign-update" />
1292    <target name="signed-updater200WithJetty" depends="updater200WithJetty, -sign-update" />
1293    <target name="signed-updater200WithJettyAndGeoIP" depends="updater200WithJettyAndGeoIP, -sign-update" />
1294    <target name="signed-updater200WithJavadoc" depends="updater200WithJavadoc, -sign-update" />
1295    <target name="signed-updater200WithJavadocAndJetty" depends="updater200WithJavadocAndJetty, -sign-update" />
1296
1297    <target name="zipit" depends="getReleaseNumber">
1298        <!--
1299             As of release 0.8.8, the router will enforce a zipfile comment equal to the
1300             version number in the sud/su2 header, since the version in the header is NOT
1301             covered by the signature.
1302         -->
1303        <zip destfile="i2pupdate.zip" basedir="pkg-temp" whenempty="fail" comment="${release.number}" />
1304       <!-- just a test, makes almost no difference
1305        <tar destfile="i2pupdate.tgz" basedir="pkg-temp" compression="gzip" />
1306        <tar destfile="i2pupdate.tbz" basedir="pkg-temp" compression="bzip2" />
1307       -->
1308    </target>
1309
1310    <target name="zipit200" depends="getReleaseNumber" >
1311        <zip destfile="i2pupdate200.zip" basedir="pkg-temp" whenempty="fail" comment="${release.number}" />
1312    </target>
1313
1314    <target name="pack200">
1315        <!-- pack200 will only pack to a .pack file, and only from a .jar file, so we put another .jar on the end -->
1316        <!-- can't pack an empty jar or one without classes, it will fail to unpack on Java 5;
1317          -  see http://bugs.sun.com/view_bug.do?bug_id=6712743
1318          -->
1319        <!-- *nix here -->
1320        <exec executable="sh" osfamily="unix" failonerror="true">
1321            <arg value="-c" />
1322            <arg value="for i in pkg-temp/lib/*.jar pkg-temp/webapps/*war; do if [ $i = pkg-temp/lib/jasper-compiler.jar -o $i = pkg-temp/lib/jbigi.jar -o $i = pkg-temp/lib/jetty-java5-threadpool.jar -o $i = pkg-temp/lib/jetty-sslengine.jar ]; then continue; fi; echo pack200 $i; mv $i $i.jar; pack200 -g $i.pack $i.jar; rm -f $i.jar; done" />
1323        </exec>
1324        <exec executable="sh" osfamily="mac" failonerror="true">
1325            <arg value="-c" />
1326            <arg value="for i in pkg-temp/lib/*.jar pkg-temp/webapps/*war; do if [ $i = pkg-temp/lib/jasper-compiler.jar -o $i = pkg-temp/lib/jbigi.jar -o $i = pkg-temp/lib/jetty-java5-threadpool.jar -o $i = pkg-temp/lib/jetty-sslengine.jar ]; then continue; fi; echo pack200 $i; mv $i $i.jar; pack200 -g $i.pack $i.jar; rm -f $i.jar; done" />
1327        </exec>
1328        <!-- windoz here : i admit, i hate escaped symbols in xml, indeed = =! -->
1329        <exec executable="cmd" osfamily="windows" failonerror="true">
1330            <arg value="/c" />
1331            <!-- TODO implement fix above -->
1332            <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" />
1333        </exec>
1334        <exec executable="cmd" osfamily="windows" failonerror="true">
1335                <arg value="/c" />
1336                <arg value="for %i in (pkg-temp\lib\*.jar) do pack200 -g %i.pack %i &amp;&amp; del %i" />
1337        </exec>
1338    </target>
1339
1340    <!-- saves about 1% on average (more on jars with multiple compiled po files since they have lots of common strings) -->
1341    <target name="repack200">
1342        <!-- pack200 will only repack a .jar file, so we put another .jar on the end -->
1343        <!-- *nix here -->
1344        <exec executable="sh" osfamily="unix" failonerror="true">
1345            <arg value="-c" />
1346            <arg value="for i in pkg-temp/lib/*.jar pkg-temp/webapps/*war; do echo pack200 -r $i; mv $i $i.jar; pack200 -r $i.jar; mv $i.jar $i; done" />
1347        </exec>
1348        <exec executable="sh" osfamily="mac" failonerror="true">
1349            <arg value="-c" />
1350            <arg value="for i in pkg-temp/lib/*.jar pkg-temp/webapps/*war; do echo pack200 -r $i; mv $i $i.jar; pack200 -r $i.jar; mv $i.jar $i; done" />
1351        </exec>
1352        <!-- windoz here : i admit, i hate escaped symbols in xml, indeed = =! -->
1353        <exec executable="cmd" osfamily="windows" failonerror="true">
1354            <arg value="/c" />
1355            <arg value="for %i in (pkg-temp\webapps\*.war) do move %i %i.jar &amp;&amp; pack200 -r %i.jar &amp;&amp; move %i.jar %i" />
1356        </exec>
1357        <exec executable="cmd" osfamily="windows" failonerror="true">
1358                <arg value="/c" />
1359                <arg value="for %i in (pkg-temp\lib\*.jar) do pack200 -r %i" />
1360        </exec>
1361    </target>
1362
1363    <target name="prepupdate" depends="build2, prepupdateSmall, prepConsoleDocUpdates, prepCertificates, prep-script-translation">
1364        <copy file="build/BOB.jar" todir="pkg-temp/lib/" />
1365        <copy file="build/sam.jar" todir="pkg-temp/lib/" />
1366        <copy file="build/i2psnark.jar" todir="pkg-temp/lib" />
1367        <!-- include systray changes in 0.7.5 -->
1368        <copy file="build/systray.jar" todir="pkg-temp/lib/" />
1369       <!-- removed from updater in 0.9
1370        <copy file="build/desktopgui.jar" todir="pkg-temp/lib/" />
1371       -->
1372        <copy file="build/susimail.war" todir="pkg-temp/webapps/" />
1373        <copy file="build/susidns.war" todir="pkg-temp/webapps/" />
1374        <!-- as of 0.7.12; someday, we can remove these from the updater -->
1375        <copy file="apps/susidns/src/WEB-INF/lib/jstl.jar" todir="pkg-temp/lib/" />
1376        <copy file="apps/susidns/src/WEB-INF/lib/standard.jar" todir="pkg-temp/lib/" />
1377        <copy file="build/i2psnark.war" todir="pkg-temp/webapps/" />
1378        <copy file="history.txt" todir="pkg-temp/" />
1379        <!-- the following overwrites history.txt on unix to shrink the update file -->
1380        <copy file="history.txt" tofile="pkg-temp/history.txt" overwrite="true">
1381            <filterchain>
1382                <headfilter lines="1500" />
1383            </filterchain>
1384        </copy>
1385        <concat append="true" destfile="pkg-temp/history.txt">&#10;&#10;----------------&#10;&#10;EARLIER HISTORY IS AVAILABLE IN THE SOURCE PACKAGE"</concat>
1386        <copy file="installer/resources/deletelist.txt" todir="pkg-temp/" />
1387    </target>
1388
1389    <target name="prepupdateSmall" depends="buildSmall, prepupdateRouter, prepjupdatefixes, prepthemeupdates">
1390        <copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
1391        <copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
1392        <copy file="build/streaming.jar" todir="pkg-temp/lib/" />
1393        <copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
1394        <!-- pulled out of routerconsole.jar in 0.7.12, someday we can take out of updater -->
1395        <!-- name without version so we can overwrite if we upgrade  -->
1396        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
1397        <copy file="build/i2ptunnel.war" todir="pkg-temp/webapps/" />
1398        <copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
1399        <copy file="build/addressbook.war" todir="pkg-temp/webapps/" />
1400        <!-- decapitalized the file in 0.7.8 -->
1401        <copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
1402        <!-- small enough to include for now -->
1403        <copy file="installer/resources/geoipv6.dat.gz" todir="pkg-temp/geoip/" />
1404    </target>
1405
1406    <target name="prepupdateRouter" depends="buildrouter, deletepkg-temp">
1407        <copy file="build/i2p.jar" todir="pkg-temp/lib/" />
1408        <copy file="build/router.jar" todir="pkg-temp/lib/" />
1409    </target>
1410
1411    <!-- jbigi.jar -->
1412    <target name="prepjbigiupdate" depends="jbigi">
1413        <copy file="build/jbigi.jar" todir="pkg-temp/lib/" />
1414    </target>
1415
1416    <!-- GeoIP files and flag icons -->
1417    <target name="prepgeoupdate">
1418        <copy file="installer/resources/geoip.txt" todir="pkg-temp/geoip/" />
1419        <copy file="installer/resources/geoipv6.dat.gz" todir="pkg-temp/geoip/" />
1420        <copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
1421    </target>
1422
1423    <!-- All jetty jars required for update.
1424         We don't need commons-el or commons-logging, they haven't changed.
1425         TODO do we need to bother updating jasper?
1426         TODO where is JMX? We don't need it I hope.
1427      -->
1428    <target name="prepjupdate" depends="prepupdate, buildWEB">
1429        <copy todir="pkg-temp/lib" >
1430            <fileset dir="build" includes="commons*.jar jasper*.jar javax*.jar jetty*.jar jsp*.jar org.mortbay.*.jar" />
1431        </copy>
1432        <!--  We have to package the new eepsite files for MigrateJetty.java, but we
1433              can't overwrite an existing eepsite dir in a non-split configuration.
1434          -->
1435        <copy todir="pkg-temp/eepsite-jetty7" >
1436            <fileset dir="installer/resources/eepsite" includes="*.xml contexts/* etc/*" />
1437        </copy>
1438    </target>
1439
1440    <target name="delete-j6-update">
1441        <delete dir="pkg-temp/eepsite-jetty7" />
1442    </target>
1443
1444    <!-- Jetty 6 I2P logging addons, not really fixes -->
1445    <target name="prepjupdatefixes" depends="buildWEB">
1446        <copy file="build/jetty-i2p.jar" todir="pkg-temp/lib/" />
1447    </target>
1448
1449    <target name="util-list-changes" depends="checkForMtn" if="mtn.available" >
1450        <exec executable="mtn" outputproperty="workspace.changes.util" errorproperty="mtn.error.util" failifexecutionfails="false" >
1451            <arg value="list" />
1452            <arg value="changed" />
1453            <arg value="core/java/src/net/i2p/util" />
1454        </exec>
1455        <!-- \n in an attribute value generates an invalid manifest -->
1456        <exec executable="tr" inputstring="${workspace.changes.util}" outputproperty="workspace.changes.util.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
1457            <arg value="-s" />
1458            <arg value="[:space:]" />
1459            <arg value="," />
1460        </exec>
1461    </target>
1462
1463    <target name="izpack-patches" >
1464            <taskdef name="izpack"
1465                     classpath="${basedir}/installer/lib/izpack/patches.jar:${basedir}/installer/lib/izpack/standalone-compiler.jar"
1466                     classname="com.izforge.izpack.ant.IzPackTask" />
1467        <jar destfile="${basedir}/installer/lib/izpack/patches.jar"
1468             basedir="${basedir}/installer/lib/izpack/patches" />
1469    </target>
1470
1471    <target name="buildUtilityJar" depends="buildCore">
1472        <ant dir="installer/java" target="build" />
1473    </target>
1474
1475    <target name="installer" depends="preppkg, buildProperties, util-list-changes, izpack-patches, buildUtilityJar" >
1476        <!--
1477          Force 1.5 pack200 output
1478          Doesnt work!
1479          http://jira.codehaus.org/browse/IZPACK-404
1480          http://forums.sun.com/thread.jspa?threadID=773439
1481          http://bfo.co.uk/blog/2010/05/13/combining_ant_jar_signatures_and_pack200.html
1482        <property name="com.sun.java.util.jar.pack.package.majver" value="150" />
1483        <property name="com.sun.java.util.jar.pack.package.minver" value="7" />
1484        -->
1485        <izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
1486
1487        <ant target="installerexe" />
1488    </target>
1489
1490    <!-- this makes i2pinstall.exe from install.jar -->
1491    <target name="installerexe" depends="launch4j" unless="noExe">
1492        <echo message="See the file &quot;build.properties&quot; if this step fails." />
1493        <!-- now the installer exe -->
1494        <launch4j configFile="./installer/i2pinstaller.xml" />
1495        <!-- thazzit -->
1496    </target>
1497
1498    <!-- Custom installers -->
1499    <target name="installer-nowindows" depends="clean, preppkg-nowindows, izpack-patches" >
1500        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1501        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}.jar" installerType="standard" basedir="${basedir}" />
1502    </target>
1503
1504
1505    <target name="installer-freebsd" depends="clean, preppkg-freebsd-only, izpack-patches" >
1506        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1507        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_freebsd-only.jar" installerType="standard" basedir="${basedir}" />
1508    </target>
1509
1510    <target name="installer-linux" depends="clean, preppkg-linux-only, izpack-patches" >
1511        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1512        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_linux-only.jar" installerType="standard" basedir="${basedir}" />
1513    </target>
1514
1515
1516    <target name="installer-osx" depends="clean, checkForIzpack2App, preppkg-osx-only, izpack-patches">
1517        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1518        <mkdir dir="pkg-temp/osx" />
1519        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_osx-only.jar" installerType="standard" basedir="${basedir}" />
1520        <ant target="installer2app" />
1521        <delete dir="pkg-temp/osx" />
1522    </target>
1523
1524    <target name="checkForIzpack2App">
1525        <!-- we'll set the izpack2app binary name if it's not been set elsewhere yet -->
1526        <property name="izpack2app.binary" value="${user.home}/IzPack/utils/wrappers/izpack2app/izpack2app.py" />
1527        <available property="izpack2app.available" file="${izpack2app.binary}" />
1528    </target>
1529
1530    <target name="installer2app" if="izpack2app.available">
1531        <mkdir dir="pkg-temp/osx" />
1532        <exec executable="python" failonerror="true">
1533            <arg value="${izpack2app.binary}" />
1534            <arg value="${basedir}/i2pinstall_${full.version}_osx-only.jar" />
1535            <arg value="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" />
1536        </exec>
1537
1538        <tar longfile="gnu" destfile="${basedir}/i2pinstall_${full.version}_osx.tar.bz2" compression="bzip2">
1539            <tarfileset dir="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" prefix="/i2p-${full.version}_osx-install.app" filemode="644">
1540                <include name="**/**" />
1541                <exclude name="Contents/MacOS/*" />
1542            </tarfileset>
1543            <tarfileset dir="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" prefix="/i2p-${full.version}_osx-install.app" filemode="755">
1544                <include name="Contents/MacOS/*" />
1545            </tarfileset>
1546        </tar>
1547    </target>
1548
1549    <!-- call between installer-xxx and installer-windows -->
1550    <target name="delete-nonwindows">
1551        <delete dir="pkg-temp/lib/wrapper/" />
1552        <delete dir="pkg-temp/locale/" />
1553        <delete dir="pkg-temp/man/" />
1554        <delete dir="pkg-temp/Start I2P Router.app/" />
1555        <delete dir="pkg-temp" includes="eepget i2prouter INSTALL-headless.txt osid postinstall.sh runplain.sh" />
1556    </target>
1557
1558    <target name="installer-windows" depends="clean, preppkg-windows-only, util-list-changes, izpack-patches, buildUtilityJar" >
1559        <fixcrlf srcdir="pkg-temp" includes="*.config *.bat *.cmd **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="crlf"/>
1560        <izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
1561        <ant target="installerexe" />
1562        <delete file="${basedir}/install.jar" />
1563        <move file="${basedir}/i2pinstall.exe" tofile="${basedir}/i2pinstall_${full.version}_windows.exe" />
1564    </target>
1565
1566    <!-- this is broken as installer-xxx targets may delete (or not delete) things in pkg-temp -->
1567    <target name="installer-all" depends="installer-freebsd, installer-linux, installer-osx, installer-windows, installer-nowindows, installer" >
1568    </target>
1569    <!-- end custom installers -->
1570
1571    <!-- unit tests -->
1572    <target name="buildTest">
1573        <ant dir="core/java/" target="jarTest" />
1574        <ant dir="router/java/" target="jarTest" />
1575        <copy file="core/java/build/i2ptest.jar" todir="build" />
1576        <copy file="router/java/build/routertest.jar" todir="build" />
1577    </target>
1578    <target name="prepTest" depends="prepupdate, buildTest">
1579        <!-- overwrite i2p.jar and router.jar with the test versions -->
1580        <copy file="build/i2ptest.jar" tofile="pkg-temp/lib/i2p.jar" overwrite="true" />
1581        <copy file="build/routertest.jar" tofile="pkg-temp/lib/router.jar" overwrite="true" />
1582    </target>
1583    <target name="updateTest" depends="prepTest, zipit" />
1584    <target name="junit.test" depends="buildProperties, jbigi" >
1585        <ant dir="core/java/" target="junit.test" />
1586        <ant dir="router/java/" target="junit.test" />
1587        <ant dir="apps/streaming/java/" target="junit.test" />
1588    </target>
1589    <target name="scalatest.test" depends="buildProperties, jbigi" >
1590        <ant dir="core/java/" target="scalatest.test" />
1591        <!-- note there are no router scala tests yet -->
1592        <ant dir="router/java/" target="scalatest.test" />
1593    </target>
1594    <target name="test" depends="buildProperties, jbigi" >
1595        <!-- both junit and scala -->
1596        <ant dir="core/java/" target="test" />
1597        <ant dir="router/java/" target="test" />
1598        <ant dir="apps/streaming/java/" target="test" />
1599    </target>
1600    <target name="scalatest.report" depends="buildProperties" >
1601        <ant dir="core/java/" target="scalatest.report" />
1602        <ant dir="router/java/" target="scalatest.report" />
1603    </target>
1604    <target name="junit.report" depends="buildProperties" >
1605        <ant dir="core/java/" target="junit.report" />
1606        <ant dir="router/java/" target="junit.report" />
1607        <ant dir="apps/streaming/java/" target="junit.report" />
1608    </target>
1609    <target name="clover.report" depends="buildProperties" if="with.clover">
1610        <ant dir="core/java/" target="clover.report" />
1611        <ant dir="router/java/" target="clover.report" />
1612        <ant dir="apps/streaming/java" target="clover.report" />
1613    </target>
1614    <target name="cobertura.report" depends="buildProperties" if="with.cobertura">
1615        <ant dir="core/java/" target="cobertura.report" />
1616        <ant dir="router/java/" target="cobertura.report" />
1617        <ant dir="apps/streaming/java" target="cobertura.report" />
1618    </target>
1619    <target name="test.report" depends="junit.report, scalatest.report, clover.report, cobertura.report"/>
1620    <target name="fulltest" depends="buildProperties, jbigi" >
1621        <ant dir="core/java/" target="fulltest" />
1622        <ant dir="router/java/" target="fulltest" />
1623        <ant dir="apps/streaming/java" target="fulltest" />
1624    </target>
1625    <target name="jenkins.cobertura.report" depends="cobertura.report">
1626        <!--
1627             The jenkins cobertura plugin couldn't find the source files.
1628         -->
1629        <replaceregexp byline="true" file="reports/core/cobertura/coverage.xml"
1630            match='filename="net' replace='filename="core/java/src/net'/>
1631        <replaceregexp byline="true" file="reports/core/cobertura/coverage.xml"
1632            match="&lt;source&gt;./src" replace='&lt;source&gt;./core/java/src'/>
1633
1634        <replaceregexp byline="true" file="reports/router/cobertura/coverage.xml"
1635            match='filename="net' replace='filename="router/java/src/net'/>
1636        <replaceregexp byline="true" file="reports/router/cobertura/coverage.xml"
1637            match="&lt;source&gt;./src" replace="&lt;source&gt;router/java/src"/>
1638
1639        <replaceregexp byline="true" file="reports/streaming/cobertura/coverage.xml"
1640            match='filename="net' replace='filename="apps/streaming/java/src/net'/>
1641        <replaceregexp byline="true" file="reports/streaming/cobertura/coverage.xml"
1642            match="&lt;source&gt;./src" replace="&lt;source&gt;apps/streaming/java/src"/>
1643    </target>
1644    <!-- end unit tests -->
1645
1646    <target name="testscripts" >
1647        <exec executable="tests/scripts/checkcerts.sh" failonerror="true" />
1648        <exec executable="tests/scripts/checkpo.sh" failonerror="true" />
1649        <exec executable="tests/scripts/checkutf8.sh" failonerror="true" />
1650        <exec executable="tests/scripts/checkxml.sh" failonerror="true" />
1651        <exec executable="tests/scripts/checkscripts.sh" failonerror="true" />
1652    </target>
1653
1654
1655    <target name="testscripts-net" >
1656        <exec executable="tests/scripts/checkremotecerts.sh" failonerror="true" />
1657    </target>
1658
1659    <target name="testscripts-all" depends="testscripts,testscripts-net" />
1660
1661    <!-- <target name="syndie" >
1662        <ant dir="apps/syndie/java/" target="standalone" />
1663        <copy file="apps/syndie/java/syndie-standalone.zip" todir="." />
1664    </target> -->
1665    <target name="i2psnark" depends="buildProperties" >
1666        <ant dir="apps/i2psnark/java" target="standalone" />
1667        <copy file="apps/i2psnark/java/i2psnark-standalone.zip" todir="." />
1668    </target>
1669    <target name="slackpkg">
1670        <ant dir="Slackware/i2p/" target="slackpkg" />
1671    </target>
1672    <target name="justBOB" depends="builddepSmall, jbigi">
1673        <ant dir="apps/BOB/" target="onejar" />
1674        <copy file="apps/BOB/dist/BOB-one.jar" todir="." />
1675    </target>
1676
1677    <target name="sloccount.report">
1678        <property name="sloccount.report.file" value="sloccount.sc" />
1679        <echo message="Generating sloccount report (this will take awhile)" />
1680        <exec executable="sloccount" failonerror="true">
1681            <arg value="--details"/>
1682            <arg value="--wide"/>
1683            <arg value="${basedir}"/>
1684            <redirector output="${sloccount.report.file}">
1685                <outputfilterchain>
1686                    <linecontainsregexp negate="true">
1687                        <regexp pattern="(Warning: |lib/launch4j|_MTN|reports|pkg-temp|licenses|i2p\.fba|gmp-|WEB-INF)" />
1688                    </linecontainsregexp>
1689                    <linecontains negate="true">
1690                        <contains value="${sloccount.report.file}" />
1691                    </linecontains>
1692                </outputfilterchain>
1693            </redirector>
1694        </exec>
1695        <echo message="sloccount report saved to the file &quot;${sloccount.report.file}&quot;" />
1696    </target>
1697
1698    <target name="findbugs" depends="build2, buildUtilityJar">
1699        <echo message="Starting findbugs, this will take a while..." />
1700        <exec executable="nice" failonerror="true">
1701            <arg value="findbugs"/>
1702            <arg value="-textui"/>
1703            <arg value="-projectName"/>
1704            <arg value="i2p"/>
1705            <arg value="-sortByClass"/>
1706            <arg value="-xml"/>
1707            <arg value="-output"/>
1708            <arg value="i2p.fba"/>
1709            <arg value="-auxclasspath"/>
1710            <arg value="build/commons-el.jar:build/commons-logging.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"/>
1711            <arg value="-sourcepath"/>
1712            <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/:installer/java/src"/>
1713            <!-- start of the files to be analyzed -->
1714            <arg value="build/BOB.jar"/>
1715            <arg value="build/addressbook.war"/>
1716            <arg value="build/i2p.jar"/>
1717            <arg value="build/i2psnark.jar"/>
1718            <arg value="build/i2psnark.war"/>
1719            <arg value="build/i2ptunnel.jar"/>
1720            <arg value="build/i2ptunnel.war"/>
1721            <arg value="build/jetty-i2p.jar"/>
1722            <arg value="build/mstreaming.jar"/>
1723            <arg value="build/router.jar/"/>
1724            <arg value="build/desktopgui.jar"/>
1725            <arg value="build/routerconsole.jar"/>
1726            <arg value="build/routerconsole.war"/>
1727            <arg value="build/sam.jar"/>
1728            <arg value="build/streaming.jar"/>
1729            <arg value="build/susidns.war"/>
1730            <arg value="build/susimail.war"/>
1731            <arg value="build/systray.jar"/>
1732            <arg value="build/utility.jar"/>
1733        </exec>
1734        <echo message="Findbugs output stored in i2p.fba" />
1735        <echo message="Now run: findbugs i2p.fba" />
1736    </target>
1737
1738    <!-- this is the same dependency as pkg, but with updater200 in the middle,
1739         since preppkg puts too much stuff in pkg-temp -->
1740<!--
1741    <target name="release" depends="distclean, updaterWithJettyFixesAndJbigi , updater200WithJettyFixes, preppkg, installer, getReleaseNumber" >
1742    <target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyAndGeoIPRepack, updater200WithJettyAndGeoIP, delete-j6-update, installer-nowindows, delete-nonwindows, installer-windows">
1743-->
1744    <target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyRepack, updater200WithJetty, delete-j6-update, installer-nowindows, delete-nonwindows, installer-windows">
1745        <echo message="New version number is ${release.number}" />
1746        <copy file="i2pupdate.zip" tofile="i2pupdate_${release.number}.zip" />
1747        <copy file="i2pinstall_${full.version}.jar" tofile="i2pinstall_${release.number}.jar" />
1748        <copy file="i2pinstall_${full.version}_windows.exe" tofile="i2pinstall_${release.number}_windows.exe" />
1749        <delete file="i2pupdate.sud" />
1750        <delete file="i2pupdate.su2" />
1751        <!-- make this a lot easier by putting release.privkey=/path/to/privkey in override.properties -->
1752
1753        <!-- now build and verify the packed sud from the packed zip -->
1754        <sudsign infile="i2pupdate.zip" outfile="i2pupdate.sud" />
1755
1756        <!-- now build and verify the packed su2 from the packed zip -->
1757        <sudsign infile="i2pupdate200.zip" outfile="i2pupdate.su2" />
1758        <!-- now build and verify the packed su3 from the packed zip -->
1759        <su3sign infile="i2pupdate200.zip" sigtype="ROUTER" outfile="i2pupdate.su3" />
1760        <!-- this will use the monotonerc file in the current workspace -->
1761        <echo message="Checking out fresh copy into ../i2p-${release.number} for tarballing:" />
1762        <delete dir="../i2p-${release.number}" />
1763        <exec executable="mtn" failonerror="true">
1764            <arg value="co" />
1765            <!-- w: is the revision of the current workspace -->
1766            <arg value="-r" />
1767            <arg value="w:" />
1768            <arg value="../i2p-${release.number}/" />
1769        </exec>
1770        <exec executable="tar" failonerror="true">
1771            <arg value="cjf" />
1772            <arg value="i2psource_${release.number}.tar.bz2" />
1773            <arg value="-C" />
1774            <arg value=".." />
1775            <arg value="--exclude" />
1776            <arg value="i2p-${release.number}/_MTN*" />
1777            <arg value="i2p-${release.number}/" />
1778        </exec>
1779        <echo message="Sign the files:" />
1780        <input message="Enter GPG key ID (e.g. 0x12345678) for signing:" addproperty="release.gpg.keyid" />
1781        <fail message="You must enter a key ID." >
1782            <condition>
1783                <equals arg1="${release.gpg.keyid}" arg2=""/>
1784            </condition>
1785        </fail>
1786
1787        <!-- the gpgsign macro sets the permission of signed files and the sigs themselves to 444 -->
1788        <gpgsign file="i2pinstall_${release.number}_windows.exe" />
1789        <gpgsign file="i2pinstall_${release.number}.jar" />
1790        <gpgsign file="i2psource_${release.number}.tar.bz2" />
1791        <gpgsign file="i2pupdate_${release.number}.zip" />
1792
1793        <chmod perm="444" type="file">
1794            <fileset dir="${basedir}">
1795                <include name="i2pupdate.su2" />
1796                <include name="i2pupdate.su3" />
1797                <include name="i2pupdate.sud" />
1798            </fileset>
1799        </chmod>
1800        <echo message="File sizes:" />
1801        <exec executable="ls" failonerror="true">
1802            <arg value="-l" />
1803            <arg value="i2pinstall_${release.number}_windows.exe" />
1804            <arg value="i2pinstall_${release.number}.jar" />
1805            <arg value="i2psource_${release.number}.tar.bz2" />
1806            <arg value="i2pupdate_${release.number}.zip" />
1807            <arg value="i2pupdate.su2" />
1808            <arg value="i2pupdate.su3" />
1809            <arg value="i2pupdate.sud" />
1810            <arg value="i2pinstall_${release.number}_windows.exe.sig" />
1811            <arg value="i2pinstall_${release.number}.jar.sig" />
1812            <arg value="i2psource_${release.number}.tar.bz2.sig" />
1813            <arg value="i2pupdate_${release.number}.zip.sig" />
1814        </exec>
1815        <echo message="SHA256 sums:" />
1816        <sha256sum file="i2pinstall_${release.number}_windows.exe" />
1817        <sha256sum file="i2pinstall_${release.number}.jar" />
1818        <sha256sum file="i2psource_${release.number}.tar.bz2" />
1819        <sha256sum file="i2pupdate_${release.number}.zip" />
1820        <sha256sum file="i2pupdate.su2" />
1821        <sha256sum file="i2pupdate.su3" />
1822        <sha256sum file="i2pupdate.sud" />
1823        <!-- make torrent files -->
1824        <copy file="i2pupdate.sud" tofile="i2pupdate-${release.number}.sud" />
1825        <mktorrent file="i2pupdate-${release.number}.sud" />
1826        <copy file="i2pupdate.su2" tofile="i2pupdate-${release.number}.su2" />
1827        <mktorrent file="i2pupdate-${release.number}.su2" />
1828        <copy file="i2pupdate.su3" tofile="i2pupdate-${release.number}.su3" />
1829        <mktorrent file="i2pupdate-${release.number}.su3" />
1830        <echo message="Don't forget to mtn tag w: i2p-${release.number}" />
1831        <echo message="... and mtn cert t:i2p-${release.number} branch i2p.i2p.release" />
1832    </target>
1833
1834    <target name="debian" depends="debian-clean, debchange, debian-binary" />
1835
1836    <target name="getExtendedVersion" depends="buildProperties, trimMtnRev">
1837        <property name="MtnShortHash" value="unknown" />
1838        <condition property="Extended.Version" value="${full.version}-${MtnShortHash}">
1839            <not>
1840                <or>
1841                    <equals arg1="${MtnShortHash}" arg2="" />
1842                    <equals arg1="${MtnShortHash}" arg2="unknown" />
1843                </or>
1844            </not>
1845        </condition>
1846        <!-- if not set above we'll set it here -->
1847        <property name="Extended.Version" value="${full.version}" />
1848    </target>
1849
1850    <target name="debchange" depends="getExtendedVersion" unless="noAutoDebchange">
1851        <echo message= "Debian version is ${Extended.Version}-1" />
1852        <exec executable="dch" failonerror="true">
1853            <arg value="-b" />
1854            <arg value="--check-dirname-level" />
1855            <arg value="0" />
1856            <arg value="-v" />
1857            <arg value="${Extended.Version}-1" />
1858            <arg value="Unofficial Debian package built using &quot;ant debian&quot;" />
1859        </exec>
1860    </target>
1861
1862    <target name="debian-binary" depends="getExtendedVersion">
1863        <exec executable="fakeroot" failonerror="true">
1864            <arg value="debian/rules" />
1865            <arg value="patch" />
1866            <arg value="binary" />
1867            <arg value="clean" />
1868        </exec>
1869        <delete dir=".pc" />
1870        <move todir=".">
1871            <fileset dir=".." includes="libjbigi*${release.number}*.deb i2p*${release.number}*.deb" />
1872        </move>
1873        <echo message="" />
1874        <echo message="====================" />
1875        <echo message="Packages have been built and moved to ${basedir}" />
1876        <echo message="====================" />
1877    </target>
1878
1879    <target name="debian-clean" depends="getExtendedVersion" >
1880        <exec executable="fakeroot" failonerror="true">
1881            <arg value="debian/rules" />
1882            <arg value="clean" />
1883        </exec>
1884        <delete dir="./.pc" />
1885    </target>
1886
1887    <target name="debian-tarball" depends="getExtendedVersion">
1888        <!-- this will use the monotonerc file in the current workspace -->
1889        <fail message="This target cannot be used without Monotone! Use &quot;fakeroot debian/rules get-orig-source&quot; instead.">
1890            <condition>
1891                <not>
1892                    <isset property="mtn.available" />
1893                </not>
1894            </condition>
1895        </fail>
1896        <property name="debian.tarball.name" value="i2p_${Extended.Version}.orig.tar.bz2" />
1897        <echo message="Checking out fresh copy into ../i2p-${Extended.Version} for tarballing:" />
1898        <delete dir="../i2p-${Extended.Version}" />
1899        <exec executable="mtn" failonerror="true">
1900            <arg value="co" />
1901            <arg value="-b" />
1902            <arg value="i2p.i2p" />
1903            <!-- w: is the revision of the current workspace -->
1904            <arg value="-r" />
1905            <arg value="w:" />
1906            <arg value="../i2p-${Extended.Version}" />
1907        </exec>
1908        <delete includeemptydirs="true" quiet="false">
1909            <fileset dir="../i2p-${Extended.Version}/installer/lib/" />
1910            <fileset dir="../i2p-${Extended.Version}/Slackware" />
1911            <fileset dir="../i2p-${Extended.Version}/_MTN" />
1912        </delete>
1913        <tar longfile="gnu" destfile="../${debian.tarball.name}" compression="bzip2">
1914            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${Extended.Version}">
1915                <include name="**/**" />
1916                <exclude name="debian/**"/>
1917                <exclude name="**/*.sh"/>
1918            </tarfileset>
1919            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${Extended.Version}" filemode="755">
1920                <exclude name="debian/**" />
1921                <include name="**/*.sh" />
1922            </tarfileset>
1923        </tar>
1924    </target>
1925
1926    <target name="debian-patch" depends="getExtendedVersion" >
1927        <exec executable="quilt" failonerror="true">
1928            <arg value="-a" />
1929            <arg value="push" />
1930        </exec>
1931        <echo message="====================" />
1932    </target>
1933    <target name="debian-unpatch" depends="buildProperties">
1934        <exec executable="quilt" failonerror="false">
1935            <arg value="-a" />
1936            <arg value="pop" />
1937        </exec>
1938    </target>
1939
1940    <target name="debianrepo" depends="debian">
1941        <exec dir="debian" executable="./makerepo.sh" failonerror="true"/>
1942    </target>
1943
1944<!-- the following are appened to help build barebone portable version,
1945     none of the above is modified for this purpose -->
1946        <target name = "pkg-portable-clean">
1947                <delete dir="build/" />
1948                <delete dir="pkg-temp/" />
1949                <delete>
1950                        <fileset dir="." includes="portable-**.zip**" />
1951                </delete>
1952        </target>
1953<!-- build a portable archive -->
1954
1955<!-- *0* Since we simply pack all files in folder "build/" into our archieve,
1956                we need to make sure its small, with NO redundent jars or wars.
1957                thus cleaning is required before each build-->
1958        <target name="buildSmallOnly" depends="pkg-portable-clean,buildSmall"/>
1959
1960<!-- *1* preparing the jars by OS dependent de-bloating -->
1961        <target name="preppkg-portable-win32-jbigi" depends="buildSmallOnly, jbigi-windows-only" />
1962
1963        <target name="preppkg-portable-linux-jbigi"  depends="buildSmallOnly, jbigi-linux-only" />
1964
1965<!-- *2* os independent procedure  -->
1966        <target name="preppkg-portable-basic" >
1967                <mkdir dir="pkg-temp" />
1968                        <!-- non OS dependent configurations only, dont add *nux/win stuff here -->
1969                        <copy todir="pkg-temp">
1970                                <fileset dir="installer/resources/portable/configs/" />
1971                        </copy>
1972                        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
1973                        <copy file="installer/resources/hosts.txt" todir="pkg-temp/" />
1974                        <copy file="installer/resources/readme.license.txt" todir="pkg-temp/" />
1975                <mkdir dir="pkg-temp/addressbook" />
1976                        <copy file="apps/addressbook/subscriptions.txt" todir="pkg-temp/addressbook/" />
1977                        <copy file="apps/addressbook/myhosts.txt"  todir="pkg-temp/addressbook/" />
1978                        <!-- config.txt is in installer/resources/portable -->
1979                <mkdir dir="pkg-temp/docs" />
1980                        <copy file="installer/resources/initialNews/initialNews.xml" tofile="pkg-temp/docs/news.xml" overwrite="true" />
1981                        <copy file="installer/resources/readme/readme.html" tofile="pkg-temp/docs/readme.html" />
1982                        <copy file="installer/resources/startconsole.html" todir="pkg-temp/docs/" />
1983                        <copy file="installer/resources/start.ico" todir="pkg-temp/docs/" />
1984                        <copy file="installer/resources/console.ico" todir="pkg-temp/docs/" />
1985                        <!-- HTTP Header files, english only,
1986                                if you need a different lang do it in a seperate target -->
1987                        <copy todir="pkg-temp/docs/" >
1988                                <fileset dir="installer/resources/proxy/"  includes="**-header.ht" />
1989                        </copy>
1990                        <!-- Theme light only -->
1991                        <copy todir="pkg-temp/docs/themes/console/light/" overwrite="true" >
1992                                <fileset dir="installer/resources/themes/console/light/" includes="**.css" />
1993                        </copy>
1994                        <copy file="installer/resources/themes/console/light/console_big.css" todir="portable/docs/themes/console/light/" />
1995                        <copy todir="pkg-temp/docs/themes/console/images/" >
1996                                <fileset dir="installer/resources/themes/console/images/" />
1997                        </copy>
1998                        <!-- FLAGs for language icon (not for ip)-->
1999                        <copy todir="pkg-temp/docs/icons/flags" >
2000                                <fileset dir="installer/resources/icons/flags/" includes="cn.png,de.png,fr.png,nl.png,ru.png,se.png,us.png" />
2001                        </copy>
2002                <mkdir dir="pkg-temp/webapps" />
2003                        <copy todir="pkg-temp/webapps/">
2004                                <fileset dir="build/" includes="**.war" />
2005                        </copy>
2006                <mkdir dir="pkg-temp/lib" />
2007                        <copy todir ="pkg-temp/lib/" >
2008                                <fileset dir="build/" includes="**.jar" />
2009                        </copy>
2010                        <!-- 3rd party jars from apps/  -->
2011                                <!-- jrobin - without jobin , you lost graph and get a lot error entry in logs -->
2012                        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
2013        </target>
2014<!-- *3* os dependent procedure/commands -->
2015        <target name = "preppkg-portable-win32" depends="preppkg-portable-win32-jbigi,preppkg-portable-basic">
2016                        <!-- systray4.j  - why do we need trayicons for portable version ? dependency hardcoded in console -->
2017                <copy file="apps/systray/java/lib/systray4j.dll" todir="pkg-temp/lib" />
2018                <copy file="apps/systray/java/lib/systray4j.jar" todir="pkg-temp/lib" />
2019                        <!--wrapper - dont even think about it. i2p cosumes appreantly more mem without it on win32-->
2020                <copy file="installer/lib/wrapper/win32/wrapper.dll" todir="pkg-temp/lib" />
2021                <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
2022                <copy file="installer/lib/wrapper/win32/I2Psvc.exe" tofile="pkg-temp/i2psvc.ex_" />
2023                        <!--  copy the unpack/start batchfiles -->
2024                <copy todir="pkg-temp">
2025                        <fileset dir="installer/resources/portable/win32/" />
2026                </copy>
2027        </target>
2028<!-- *4* command for windows package -->
2029        <target name = "pkg-portable-win32"     depends="preppkg-portable-win32, pack200" >
2030                <!-- i need the portable\ folder in .zip so basedir is set to . -->
2031                <move file="pkg-temp" tofile="portable"/>
2032                <zip destfile="portable-win32.zip" basedir="." level="9" includes="portable\**" />
2033                <checksum file="portable-win32.zip" forceOverwrite="yes"/>
2034                <move file="portable" tofile="pkg-temp"/>
2035        </target>
2036</project>
Note: See TracBrowser for help on using the repository browser.