source: build.xml @ 307a68aa

Last change on this file since 307a68aa was 307a68aa, checked in by zzz <zzz@…>, 21 months ago

Installer: Add support for IzPack? 5 (ticket #1864)
fix typo in postinstall.sh

  • Property mode set to 100644
File size: 146.7 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<project basedir="." default="all" name="i2p"
3    xmlns:artifact="antlib:org.apache.maven.artifact.ant">
4
5    <!-- Include property files so that values can be easily overridden.
6         Users should create an override.properties file to make changes.
7     -->
8    <property file="override.properties"/>
9    <property file="build.properties"/>
10    <!--  When changing, also change javadoc URL in build.properties, and checksum in apps/jetty/build.xml -->
11    <property name="jetty.ver" value="9.2.24.v20180105" />
12    <property name="tomcat.ver" value="8.5.30" />
13
14    <!-- You probably don't want to change anything from here down -->
15    <target name="help" depends="all" />
16    <target name="all" >
17        <echo message="Useful targets: " />
18        <echo message="  pkg:       distclean then package everything up (updater, installer)" />
19        <echo message="  dist:      pkg and javadoc" />
20        <echo message="  dist200:   pkg, updater200, and javadoc" />
21        <echo message="  installer: build the GUI installer" />
22        <echo message="  installer-freebsd: build the GUI installer (FreeBSD only)" />
23        <echo message="  installer-linux: build the GUI installer (Linux only)" />
24        <echo message="  installer-osx: build the GUI installer (OSX only)" />
25        <echo message="  installer-windows: build the GUI installer (Windows only)" />
26        <echo message="  installer-nowindows: build the GUI installer (all but Windows)" />
27        <echo message="  osxLauncher: build the Mac OS X router/GUI launcher (OSX only)" />
28        <echo message="  bbLauncher: build the Browser Bundle router launcher" />
29        <echo message="  tarball:   tar the full install into i2p.tar.bz2 (extracts to build a new clean install)" />
30        <echo message="  updater:   Package the built files in i2pupdate.zip (extracts safely over existing installs)" />
31        <echo message="  updater200: Updater compressed with pack200 (creates i2pupdate200.zip, 60% smaller)" />
32        <echo message="  signed-updater200: Signed updater compressed with pack200 (creates i2pupdate.su3, 60% smaller)" />
33        <echo message="  updaterWithJavadoc: updater including the javadocs, for display in the console" />
34        <echo message="  updater200WithJavadoc: updater including the javadocs, for display in the console (creates i2pupdate200.zip)" />
35        <echo message="  signed-updater200WithJavadoc: Signed updater including the javadocs, for display in the console (creates i2pupdate.su3)" />
36        <echo message="  updaterWithJavadocAndJetty: updater including the javadocs, for display in the console, and Jetty " />
37        <echo message="  updater200WithJavadocAndJetty: updater including the javadocs, for display in the console, and Jetty (creates i2pupdate200.zip)" />
38        <echo message="  signed-updater200WithJavadocAndJetty: Signed updater including the javadocs, for display in the console, and Jetty (creates i2pupdate.su3)" />
39        <echo message="  updaterWithJetty: Updater including Jetty" />
40        <echo message="  updater200WithJetty: Updater including Jetty" />
41        <echo message="  signed-updater200withJetty: Signed updater including Jetty" />
42        <echo message="  updaterWithJettyFixes: updater including local jetty patches" />
43        <echo message="  updaterWithGeoIP: updater including GeoIP Files" />
44        <echo message="  updaterWithJettyFixesAndGeoIP" />
45        <echo message="  updaterWithJettyFixesAndJbigi" />
46        <echo message="  updaterWithJbigi" />
47        <echo message="  updater200WithJbigi" />
48        <echo message="  updaterSmall:   updater with the essentials only - no SAM, i2psnark, SusiMail, SusiDNS, or history.txt" />
49        <echo message="  updaterRouter:  updater with the i2p.jar and router.jar only" />
50        <echo message="  distclean: clean up all derived files" />
51        <!-- <echo message="  syndie:    generate a standalone syndie install" /> -->
52        <echo message="  desktopgui: generate a standalone desktopgui install" />
53        <echo message="  i2psnark:  generate a standalone i2psnark install" />
54        <echo message="  justBOB:  generate a standalone BOB-one.jar" />
55        <echo message="  javadoc:   generate javadoc for the entire project into ./build/javadoc and ./javadoc.zip" />
56        <echo message="  javadoc-test: Javadocs for unit test classes (build/javadoc-test)" />
57        <echo message="  slackpkg:  generate Slackware package in ./Slackware/i2p" />
58        <echo message="  debianhowto: instructions on building Debian packages" />
59        <echo message="  debian: generate Debian packages in ../" />
60        <echo message="          run &quot;ant debianhowto&quot; for instructions" />
61        <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)" />
62        <!-- <echo message="  debianrepo: build a Debian repository (reprepro required)" /> -->
63        <echo message="  poupdate: update the .po files for translators" />
64        <echo message="  pkg-portable-win32:  build a minimum portable version for win32" />
65        <echo message="  bench: build the benchmarks" />
66   </target>
67    <target name="debianhowto">
68            <echo message="To build debian packages, you must make sure that you have" />
69            <echo message="the necessary build-dependencies installed." />
70            <echo message="The packages required to build can be found in the file "/>
71            <echo message="&quot;debian/control&quot; in the &quot;Build-Depends&quot; field."/>
72            <echo message="In addition to those packages, be sure to install &quot;fakeroot&quot;,"/>
73            <echo message="&quot;quilt&quot; and &quot;build-essential&quot;!" />
74            <echo message="" />
75            <echo message="The following command will install the build dependencies for you:" />
76            <echo message=" " />
77            <echo message="sudo apt-get install debhelper ant debconf default-jdk gettext libgmp-dev po-debconf fakeroot \" />
78            <echo message="  build-essential quilt dh-apparmor dh-systemd libservice-wrapper-java \"  />
79            <echo message="  devscripts libjetty9-java libtomcat8-java libtaglibs-standard-jstlel-java libgetopt-java"  />
80            <echo message=" " />
81            <echo message="The following command will install the additional runtime dependencies:" />
82            <echo message="sudo apt-get install libecj-java geoip-database" />
83            <echo message=" " />
84            <echo message="Once the dependencies are installed, run &quot;ant debian&quot;"/>
85            <echo message="to patch the source and build the packages." />
86    </target>
87
88    <property name="gpg" value="gpg" />
89
90    <macrodef name="gpgsign">
91        <attribute name="file" />
92        <sequential>
93            <delete file="@{file}.sig" quiet="true" />
94            <exec executable="${gpg}" failonerror="true">
95                <arg value="-u" />
96                <arg value="${release.gpg.keyid}" />
97                <arg value="-b" />
98                <arg value="@{file}" />
99            </exec>
100            <chmod type="file" perm="444">
101                <fileset dir="${basedir}">
102                    <include name="@{file} @{file}.sig" />
103                </fileset>
104            </chmod>
105        </sequential>
106    </macrodef>
107
108    <macrodef name="gpgsignasc">
109        <attribute name="file" />
110        <sequential>
111            <delete file="@{file}.asc" quiet="true" />
112            <exec executable="${gpg}" failonerror="true">
113                <arg value="-u" />
114                <arg value="${release.gpg.keyid}" />
115                <arg value="-ab" />
116                <arg value="@{file}" />
117            </exec>
118            <chmod type="file" perm="444">
119                <fileset dir="${basedir}">
120                    <include name="@{file} @{file}.asc" />
121                </fileset>
122            </chmod>
123        </sequential>
124    </macrodef>
125
126    <macrodef name="mktorrent">
127        <attribute name="file" />
128        <sequential>
129            <delete file="@{file}.torrent" quiet="true"/>
130            <java classname="org.klomp.snark.Storage" fork="true" failonerror="true">
131                <classpath>
132                    <pathelement location="build/i2p.jar" />
133                    <pathelement location="build/i2psnark.jar" />
134                </classpath>
135                <arg value="-a" />
136                <arg value="http://tracker2.postman.i2p/announce.php" />
137                <arg value="-c" />
138                <arg value="${build.built-by}" />
139                <arg value="@{file}" />
140            </java>
141        </sequential>
142    </macrodef>
143
144    <macrodef name="sha256sum">
145        <attribute name="file" />
146        <sequential>
147            <!--
148                 Note: "local" only works with ant 1.8+. This limitation shouldn't be
149                 a big deal since this macro is only called by the release
150                 target.
151             -->
152            <local name="file-sum"/>
153            <checksum format="MD5SUM" file="@{file}" property="file-sum" algorithm="sha-256"/>
154            <echo message="${file-sum}  @{file}" />
155        </sequential>
156    </macrodef>
157
158    <macrodef name="sudsign">
159        <attribute name="infile" />
160        <attribute name="outfile" />
161        <sequential>
162            <input message="Enter sud/su2 private signing key file:" addproperty="release.privkey" />
163            <fail message="You must enter an existing file path." >
164                <condition>
165                    <or>
166                        <equals arg1="${release.privkey}" arg2=""/>
167                        <not>
168                            <length file="${release.privkey}" when="greater" length="0" />
169                        </not>
170                    </or>
171                </condition>
172            </fail>
173            <echo message="Key file is ${release.privkey}" />
174            <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
175                <classpath>
176                    <pathelement location="build/i2p.jar" />
177                </classpath>
178                <arg value="sign" />
179                <arg value="@{infile}" />
180                <arg value="@{outfile}" />
181                <arg value="${release.privkey}" />
182                <arg value="${release.number}" />
183            </java>
184            <echo message="Verify version and VALID signature:" />
185            <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
186                <classpath>
187                    <pathelement location="build/i2p.jar" />
188                </classpath>
189                <arg value="verifysig" />
190                <arg value="@{outfile}" />
191            </java>
192            <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
193                <classpath>
194                    <pathelement location="build/i2p.jar" />
195                </classpath>
196                <arg value="verifyversion" />
197                <arg value="@{outfile}" />
198            </java>
199            <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
200                <classpath>
201                    <pathelement location="build/i2p.jar" />
202                </classpath>
203                <arg value="showversion" />
204                <arg value="@{outfile}" />
205            </java>
206        </sequential>
207    </macrodef>
208
209    <macrodef name="su3sign">
210        <attribute name="infile" />
211        <attribute name="outfile" />
212        <attribute name="sigtype" />
213        <attribute name="su3.ver" />
214        <sequential>
215        <input message="Enter su3 private signing key store:" addproperty="release.privkey.su3" />
216        <fail message="You must enter an existing file path." >
217            <condition>
218                <or>
219                    <equals arg1="${release.privkey.su3}" arg2=""/>
220                    <not>
221                        <length file="${release.privkey.su3}" when="greater" length="0" />
222                    </not>
223                </or>
224            </condition>
225        </fail>
226        <input message="Enter su3 key name (you@mail.i2p):" addproperty="release.signer.su3" />
227        <fail message="You must enter a name." >
228            <condition>
229                <equals arg1="${release.signer.su3}" arg2=""/>
230            </condition>
231        </fail>
232        <input message="Enter su3 key password for ${release.signer.su3}:" addproperty="release.password.su3" />
233        <fail message="You must enter a password." >
234            <condition>
235                <equals arg1="${release.password.su3}" arg2=""/>
236            </condition>
237        </fail>
238            <java classname="net.i2p.crypto.SU3File" inputstring="${release.password.su3}" fork="true" failonerror="true">
239                <classpath>
240                    <pathelement location="build/i2p.jar" />
241                </classpath>
242                <arg value="sign" />
243                <arg value="-c" />
244                <arg value="@{sigtype}" />
245                <arg value="-t" />
246                <arg value="RSA_SHA512_4096" />
247                <arg value="@{infile}" />
248                <arg value="@{outfile}" />
249                <arg value="${release.privkey.su3}" />
250                <arg value="@{su3.ver}" />
251                <arg value="${release.signer.su3}" />
252            </java>
253            <echo message="Verify version and VALID signature:" />
254            <java classname="net.i2p.crypto.SU3File" fork="true" failonerror="true">
255                <classpath>
256                    <pathelement location="build/i2p.jar" />
257                </classpath>
258                <!-- set base dir so it can find the pubkey cert -->
259                <jvmarg value="-Di2p.dir.base=installer/resources" />
260                <arg value="verifysig" />
261                <arg value="@{outfile}" />
262            </java>
263            <java classname="net.i2p.crypto.SU3File" fork="true" failonerror="true">
264                <classpath>
265                    <pathelement location="build/i2p.jar" />
266                </classpath>
267                <!-- set base dir so it can find the pubkey cert -->
268                <jvmarg value="-Di2p.dir.base=installer/resources" />
269                <arg value="showversion" />
270                <arg value="@{outfile}" />
271            </java>
272        </sequential>
273    </macrodef>
274
275    <target name="dist" depends="pkg, javadoc" />
276    <target name="dist200" depends="pkg200, javadoc" />
277    <target name="build" depends="build2">
278        <!-- so we don't build standalone for the updater -->
279        <!-- This builds apps/i2psnark/java/i2psnark-standalone.zip,
280          -   which we don't distribute anywhere...
281        <ant dir="apps/i2psnark/java/" target="standalone" />
282        -->
283    </target>
284    <target name="build2" depends="builddep, jar, buildWEB" />
285    <target name="buildSmall" depends="builddepSmall, jarSmall, buildWEB" />
286    <target name="buildclean" depends="distclean, build" />
287
288    <target name="builddep" depends="builddepSmall, buildBOB, buildSAM, buildSusiMail, buildSusiDNS, buildI2PSnark" />
289
290    <target name="builddepSmall" depends="buildrouter, buildSystray, buildDesktopGui, buildRouterConsole, buildStreaming, buildI2PTunnel, buildAddressbook" />
291
292    <!-- start of buildX, one for each sub-build.xml.
293         Do not put ant tasks in the sub-build.xmls anymore,
294         so the build will go faster.
295      -->
296
297    <target name="-setepoch">
298        <script language="javascript">
299            <![CDATA[
300              property = project.setProperty("epoch",Math.floor((new Date()).getTime()/1000));
301            ]]>
302        </script>
303    </target>
304
305    <target name="bbLauncher" depends="build">
306        <sequential>
307            <exec executable="./sbt" dir="launchers" failonerror="true">
308                <arg value="browserbundle:clean" />
309            </exec>
310            <exec executable="./sbt" dir="launchers" failonerror="true">
311                <arg value="browserbundle:assembly" />
312            </exec>
313        </sequential>
314    </target>
315
316    <target name="osxLauncher" depends="build,preppkg-osx">
317        <sequential>
318            <exec executable="./sbt" dir="launchers" failonerror="true">
319                <arg value="macosx:cleanAllTask" />
320            </exec>
321            <exec executable="./sbt" dir="launchers" failonerror="true">
322                <arg value="macosx:buildAppBundleTask" />
323            </exec>
324        </sequential>
325    </target>
326
327    <target name="buildBOB" depends="buildStreaming" >
328        <ant dir="apps/BOB/" target="jar" />
329        <copy file="apps/BOB/dist/BOB.jar" todir="build/" />
330    </target>
331
332    <target name="buildSAM" depends="buildStreaming" >
333        <ant dir="apps/sam/java/" target="jar" />
334        <copy file="apps/sam/java/build/sam.jar" todir="build/" />
335    </target>
336
337    <target name="buildSusiMail" depends="buildCore, buildJetty" >
338        <ant dir="apps/susimail/" target="war" />
339        <copy file="apps/susimail/susimail.war" todir="build/" />
340    </target>
341
342    <!-- jar (not war) for testing only -->
343    <target name="buildSusiMailJar" depends="buildCore, buildJetty" >
344        <ant dir="apps/susimail/" target="jar" />
345        <copy file="apps/susimail/susimail.jar" todir="build/" />
346    </target>
347
348    <target name="buildSusiDNS" depends="buildCore, buildJetty, buildImagegen, buildAddressbook" >
349        <ant dir="apps/susidns/src" target="all" />
350        <copy file="apps/susidns/src/susidns.war" todir="build/" />
351    </target>
352
353    <target name="buildImagegen" depends="buildCore, buildJetty" >
354        <ant dir="apps/imagegen" target="build" />
355        <copy file="apps/imagegen/imagegen/build/imagegen.war" todir="build/" />
356    </target>
357
358    <target name="buildI2PSnark" depends="buildStreaming, buildJetty, buildSystray" >
359        <ant dir="apps/i2psnark/java/" target="war" />
360        <copy file="apps/i2psnark/i2psnark.war" todir="build/" />
361        <copy file="apps/i2psnark/java/build/i2psnark.jar" todir="build/" />
362    </target>
363
364    <!-- jar (not war) for Android -->
365    <target name="buildAddressbookJar" depends="buildCore" >
366        <ant dir="apps/addressbook/" target="jar" />
367        <copy file="apps/addressbook/dist/addressbook.jar" todir="build/" />
368    </target>
369
370    <target name="buildAddressbook" depends="buildCore" >
371        <ant dir="apps/addressbook/" target="all" />
372        <copy file="apps/addressbook/dist/addressbook.jar" todir="build/" />
373        <!-- war is empty, only for updates -->
374        <copy file="apps/addressbook/dist/addressbook.war" todir="build/" />
375    </target>
376
377    <!-- Both jars and no war, for Android -->
378    <target name="buildI2PTunnelJars" depends="buildStreaming" >
379        <ant dir="apps/i2ptunnel/java/" target="uiJar" />
380        <copy file="apps/i2ptunnel/java/build/i2ptunnel.jar" todir="build/" />
381        <copy file="apps/i2ptunnel/java/build/i2ptunnel-ui.jar" todir="build/" />
382    </target>
383
384    <target name="buildI2PTunnel" depends="buildStreaming, buildJetty, buildImagegen" >
385        <ant dir="apps/i2ptunnel/java/" target="build" />
386        <copy file="apps/i2ptunnel/java/build/i2ptunnel.jar" todir="build/" />
387        <copy file="apps/i2ptunnel/java/build/i2ptunnel.war" todir="build/" />
388    </target>
389
390    <target name="buildDesktopGui" depends="buildCore, buildrouter" >
391<!--
392        <ant dir="apps/desktopgui" target="clean" />
393-->
394        <ant dir="apps/desktopgui" target="jar" />
395        <copy file="apps/desktopgui/dist/desktopgui.jar" todir="build/" />
396    </target>
397
398    <target name="buildRouterConsole" depends="buildrouter, buildSystray, buildDesktopGui, buildJetty, buildJrobin" >
399        <ant dir="apps/routerconsole/java/" target="jar" />
400    </target>
401
402    <!-- newsxml.jar only (subset of routerconsole, no war) for Android -->
403    <target name="buildNewsXMLJar" depends="buildRouter" >
404        <ant dir="apps/routerconsole/java/" target="newsxmljar" />
405    </target>
406
407    <target name="buildJetty" depends="buildCore" >
408        <ant dir="apps/jetty" target="build" />
409        <copy todir="build/" >
410            <fileset dir="apps/jetty/jettylib" excludes="ant.jar" />
411        </copy>
412    </target>
413
414    <target name="buildSystray" depends="buildCore" >
415        <ant dir="apps/systray/java/" target="jar" />
416        <copy file="apps/systray/java/build/systray.jar" todir="build/" />
417    </target>
418
419    <target name="buildStreaming" depends="buildMinistreaming" >
420        <ant dir="apps/streaming/java/" target="jar" />
421        <copy file="apps/streaming/java/build/streaming.jar" todir="build/" />
422    </target>
423
424    <target name="buildMinistreaming" depends="buildCore" >
425        <ant dir="apps/ministreaming/java/" target="jar" />
426        <copy file="apps/ministreaming/java/build/mstreaming.jar" todir="build/" />
427    </target>
428
429    <target name="buildRouter" depends="buildrouter" />
430    <target name="buildrouter" depends="buildCore" >
431        <ant dir="router/java/" target="jar" />
432        <copy file="router/java/build/router.jar" todir="build/" />
433    </target>
434
435    <target name="buildCore" depends="buildProperties" >
436        <ant dir="core/java/" target="jar" />
437        <copy file="core/java/build/i2p.jar" todir="build/" />
438    </target>
439
440    <target name="buildJrobin" depends="buildCore" >
441        <ant dir="apps/jrobin/java/" target="jar" />
442        <copy file="apps/jrobin/java/build/jrobin.jar" todir="build/" />
443    </target>
444
445    <target name="buildProperties" depends="getMtnRev, getReleaseNumber, getBuildNumber, setBuildTimestamp" >
446        <!-- default if not set above -->
447        <property name="workspace.version" value="unknown" />
448        <!-- default if not set by setBuildTimestamp -->
449        <property name="build.timestamp" value="reproducible" />
450        <property name="full.version" value="${release.number}-${i2p.build.number}${build.extra}" />
451        <echo message="Building version ${full.version} (mtn rev ${workspace.version})" />
452    </target>
453
454    <target name="setBuildTimestamp" unless="${build.reproducible}" >
455        <tstamp>
456            <format property="build.timestamp" pattern="yyyy-MM-dd HH:mm:ss z" timezone="UTC" locale="en" />
457        </tstamp>
458    </target>
459
460    <target name="buildWEB" depends="buildRouterConsole" >
461        <copy file="apps/routerconsole/java/build/routerconsole.jar" todir="build/" />
462        <copy file="apps/routerconsole/java/build/routerconsole.war" todir="build/" />
463    </target>
464
465    <target name="buildTools" depends="buildrouter" >
466        <ant dir="installer/tools/java" target="jar" />
467        <copy file="installer/tools/java/build/tools.jar" todir="build/" />
468    </target>
469
470    <!-- end of sub-build.xml targets -->
471
472    <!-- monotone targets -->
473
474    <target name="checkForMtn" >
475        <available property="mtn.available" file="_MTN" type="dir" />
476    </target>
477
478    <target name="failIfNoMtn" depends="checkForMtn">
479        <fail message="This target cannot be used without Monotone! Use &quot;fakeroot debian/rules get-orig-source&quot; instead.">
480            <condition>
481                <not>
482                    <isset property="mtn.available" />
483                </not>
484            </condition>
485        </fail>
486    </target>
487
488    <target name="getMtnRev" depends="checkForMtn" if="mtn.available" >
489        <exec executable="mtn" outputproperty="workspace.version" errorproperty="mtn.error1" failifexecutionfails="false" >
490            <arg value="automate" />
491            <arg value="get_base_revision_id" />
492        </exec>
493    </target>
494
495    <target name="trimMtnRev" depends="getMtnRev">
496        <script language="javascript">
497            <![CDATA[
498            var MtnRev = project.getProperty("workspace.version");
499            if (MtnRev != 'unknown' && MtnRev != null) {
500                echo = project.createTask("echo");
501                var MtnShortHash = MtnRev.substring(0,8);
502                project.setProperty("MtnShortHash", MtnShortHash);
503                echo.setMessage("Trimmed hash: " + MtnShortHash);
504                echo.perform();
505            } else {
506                project.setProperty("MtnShortHash", 'unknown');
507            }
508            ]]>
509        </script>
510    </target>
511
512    <target name="checkIfBumped">
513        <exec executable="mtn" outputproperty="bumped" errorproperty="mtn.error2" failifexecutionfails="false" >
514            <arg value="ls" />
515            <arg value="ch" />
516            <arg value="router/java/src/net/i2p/router/RouterVersion.java" />
517        </exec>
518        <condition property="bumped.already">
519            <not>
520                <equals arg1="${bumped}" arg2=""/>
521            </not>
522        </condition>
523    </target>
524
525    <target name="bump" depends="bumpBuild" />
526    <target name="bumpBuild" depends="checkIfBumped, getBuildNumber" unless="bumped.already">
527        <script language="javascript">
528            <![CDATA[
529            var newBuildNumber = (Number(project.getProperty("i2p.build.number")) + 1);
530            if (newBuildNumber != 'unknown' && newBuildNumber != null) {
531                echo = project.createTask("echo");
532                project.setProperty("new.i2p.build.number", newBuildNumber);
533                echo.setMessage("Build number is now: " + newBuildNumber + project.getProperty("build.extra"));
534                echo.perform();
535            }
536            ]]>
537        </script>
538        <replaceregexp byline="true" file="router/java/src/net/i2p/router/RouterVersion.java"
539            match='(^\s+public\s+final\s+static\s+long\s+BUILD\s+=\s+)[0-9]+;' replace='\1${new.i2p.build.number};'/>
540    </target>
541
542    <target name="revisions" depends="getReleaseNumber, getBuildNumber">
543        <!-- mtn log __brief __no-graph __to t:i2p-0.9.xx | cut -d ' ' -f 2 | sort | uniq -c | sort -rn -->
544        <exec executable="mtn" outputproperty="getrevisions1" errorproperty="reverror1" failifexecutionfails="true" >
545            <arg value="log" />
546            <arg value="--brief" />
547            <arg value="--no-graph" />
548            <arg value="--to" />
549            <arg value="t:i2p-${release.number}" />
550        </exec>
551        <exec executable="cut" inputstring="${getrevisions1}" outputproperty="getrevisions2" failifexecutionfails="true" >
552            <arg value="-d" />
553            <arg value=" " />
554            <arg value="-f" />
555            <arg value="2" />
556        </exec>
557        <exec executable="sort" inputstring="${getrevisions2}" outputproperty="getrevisions3" failifexecutionfails="true" >
558        </exec>
559        <exec executable="uniq" inputstring="${getrevisions3}" outputproperty="getrevisions4" failifexecutionfails="true" >
560            <arg value="-c" />
561        </exec>
562        <exec executable="sort" inputstring="${getrevisions4}" outputproperty="getrevisions5" failifexecutionfails="true" >
563            <arg value="-rn" />
564        </exec>
565        <echo message="Revisions since ${release.number}:" />
566        <echo message="${getrevisions5}" />
567    </target>
568
569    <!-- end monotone targets -->
570
571    <!-- launch4j targets -->
572
573    <condition property="noExe">
574        <not>
575            <!-- We only have launch4j binaries for the following systems -->
576            <and>
577                <or>
578                    <os arch="x86" />
579                    <os arch="i386" />
580                    <os arch="i586" />
581                    <os arch="i686" />
582                    <os arch="amd64" />
583                    <os arch="x86_64" />
584                </or>
585                <or>
586                    <os name="Linux" />
587                    <os family="windows" />
588                </or>
589            </and>
590        </not>
591    </condition>
592
593    <!-- this makes an empty build/launchi2p.jar and the build/i2p.exe for the no-wrapper windows startup, if possible -->
594    <target name="buildexe" depends="buildProperties, launch4j" unless="noExe">
595        <echo message="See the file &quot;build.properties&quot; if this step fails." />
596        <jar destfile="./build/launchi2p.jar">
597            <manifest>
598                <attribute name="Main-Class" value="net.i2p.router.RouterLaunch" />
599                <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-el.jar lib/wrapper.jar lib/systray.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" />
600                <attribute name="Built-By" value="${build.built-by}" />
601                <attribute name="Build-Date" value="${build.timestamp}" />
602                <attribute name="Base-Revision" value="${workspace.version}" />
603            </manifest>
604        </jar>
605        <!-- now the standalone launcher exe -->
606        <launch4j configFile="./installer/i2pstandalone.xml" />
607        <!-- thazzit -->
608    </target>
609
610    <target name="launch4j">
611        <taskdef name="launch4j"
612                 classname="net.sf.launch4j.ant.Launch4jTask"
613                 classpath="${basedir}/installer/lib/launch4j/launch4j.jar:${basedir}/installer/lib/launch4j/lib/xstream.jar" />
614     </target>
615
616    <!-- end launch4j targets -->
617
618     <!--
619          the files are now copied to the build directory
620          in the build* targets
621      -->
622     <target name="jar" depends="jarSmall" />
623     <target name="jarSmall" depends="builddepSmall" />
624
625    <!-- Custom target to collect the jars that I2P-Bote needs to compile, so it can compile from source. -->
626    <target name="jarBote" depends="buildRouter, buildStreaming, buildJetty" >
627        <copy file="apps/susidns/src/lib/jstl.jar" todir="build/" />
628        <copy file="apps/susidns/src/lib/standard.jar" todir="build/" />
629    </target>
630
631    <!-- jbigi targets -->
632
633    <target name="jbigi-list-changes" depends="checkForMtn" if="mtn.available">
634        <exec executable="mtn" outputproperty="workspace.changes.jbigi" errorproperty="mtn.error.jbigi" failifexecutionfails="false" >
635            <arg value="list" />
636            <arg value="changed" />
637            <arg value="installer/lib/jbigi" />
638        </exec>
639        <!-- \n in an attribute value generates an invalid manifest -->
640        <exec executable="tr" inputstring="${workspace.changes.jbigi}" outputproperty="workspace.changes.jbigi.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
641            <arg value="-s" />
642            <arg value="&quot;[:space:]&quot;" />
643            <arg value="," />
644        </exec>
645    </target>
646
647    <target name="jbigi" depends="buildProperties, jbigi-list-changes">
648        <!-- set if unset -->
649        <property name="workspace.changes.jbigi.tr" value="" />
650        <mkdir dir="./build" />
651        <jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
652            <fileset dir="installer/lib/jbigi" includes="*.so *.dll *.jnilib" />
653            <manifest>
654                <attribute name="Built-By" value="${build.built-by}" />
655                <attribute name="Build-Date" value="${build.timestamp}" />
656                <attribute name="Base-Revision" value="${workspace.version}" />
657                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
658            </manifest>
659        </jar>
660    </target>
661
662    <target name="jbigi-nowindows" depends="buildProperties, jbigi-list-changes">
663        <!-- set if unset -->
664        <property name="workspace.changes.jbigi.tr" value="" />
665        <delete file="build/jbigi.jar" failonerror="false" quiet="true" />
666        <jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
667            <fileset dir="installer/lib/jbigi" includes="*.so *.jnilib" />
668            <manifest>
669                <attribute name="Built-By" value="${build.built-by}" />
670                <attribute name="Build-Date" value="${build.timestamp}" />
671                <attribute name="Base-Revision" value="${workspace.version}" />
672                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
673            </manifest>
674        </jar>
675    </target>
676
677    <!-- Now system-specific jbigis in alphabetical order -->
678    <target name="jbigi-freebsd-only"  depends="buildProperties, jbigi-list-changes">
679        <!-- set if unset -->
680        <property name="workspace.changes.jbigi.tr" value="" />
681        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
682            <fileset dir="installer/lib/jbigi" includes="*bsd*.so" />
683            <manifest>
684                <attribute name="Built-By" value="${build.built-by}" />
685                <attribute name="Build-Date" value="${build.timestamp}" />
686                <attribute name="Base-Revision" value="${workspace.version}" />
687                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
688            </manifest>
689        </jar>
690    </target>
691
692    <target name="jbigi-linux-only"  depends="buildProperties, jbigi-list-changes">
693        <!-- set if unset -->
694        <property name="workspace.changes.jbigi.tr" value="" />
695        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
696            <fileset dir="installer/lib/jbigi" includes="*linux*.so" />
697            <manifest>
698                <attribute name="Built-By" value="${build.built-by}" />
699                <attribute name="Build-Date" value="${build.timestamp}" />
700                <attribute name="Base-Revision" value="${workspace.version}" />
701                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
702            </manifest>
703        </jar>
704    </target>
705
706    <target name="jbigi-linux-x86-only"  depends="buildProperties, jbigi-list-changes">
707        <!-- set if unset -->
708        <property name="workspace.changes.jbigi.tr" value="" />
709        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
710            <fileset dir="installer/lib/jbigi" includes="*linux*.so" excludes="*linux-arm*.so,*linux-ppc*.so" />
711            <manifest>
712                <attribute name="Built-By" value="${build.built-by}" />
713                <attribute name="Build-Date" value="${build.timestamp}" />
714                <attribute name="Base-Revision" value="${workspace.version}" />
715                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
716            </manifest>
717        </jar>
718    </target>
719
720
721    <target name="jbigi-linux-nonx86-only"  depends="buildProperties, jbigi-list-changes">
722        <!-- set if unset -->
723        <property name="workspace.changes.jbigi.tr" value="" />
724        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
725            <fileset dir="installer/lib/jbigi" includes="*linux-arm*.so,*linux-ppc*.so" />
726            <manifest>
727                <attribute name="Built-By" value="${build.built-by}" />
728                <attribute name="Build-Date" value="${build.timestamp}" />
729                <attribute name="Base-Revision" value="${workspace.version}" />
730                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
731            </manifest>
732        </jar>
733    </target>
734
735    <target name="jbigi-osx-only"  depends="buildProperties, jbigi-list-changes" >
736        <!-- set if unset -->
737        <property name="workspace.changes.jbigi.tr" value="" />
738        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
739            <fileset dir="installer/lib/jbigi" includes="*.jnilib" />
740            <manifest>
741                <attribute name="Built-By" value="${build.built-by}" />
742                <attribute name="Build-Date" value="${build.timestamp}" />
743                <attribute name="Base-Revision" value="${workspace.version}" />
744                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
745            </manifest>
746        </jar>
747    </target>
748
749    <target name="jbigi-windows-only" depends="buildProperties, jbigi-list-changes" >
750        <!-- set if unset -->
751        <property name="workspace.changes.jbigi.tr" value="" />
752        <delete file="build/jbigi.jar" failonerror="false" quiet="true" />
753        <jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
754            <fileset dir="installer/lib/jbigi" includes="*windows*.dll" />
755            <manifest>
756                <attribute name="Built-By" value="${build.built-by}" />
757                <attribute name="Build-Date" value="${build.timestamp}" />
758                <attribute name="Base-Revision" value="${workspace.version}" />
759                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
760            </manifest>
761        </jar>
762    </target>
763
764    <!-- end jbigi targets -->
765
766    <target name="poupdate-source" depends="set-lg2-en, poupdate" />
767
768    <target name="set-lg2-en" >
769        <property name="lg2" value="en" />
770    </target>
771
772    <!-- the apps need to compile the jsps to poupdate -->
773    <target name="poupdate" depends="buildRouter, buildStreaming, buildSystray, buildJetty, buildDesktopGui, buildJrobin" >
774        <echo message="Setting environment variable LG2 to a lang code (eg: de,zh,nl etc)" />
775        <echo message=" will restrict language update to the language you specified, leaving other language untact." />
776        <!-- set if unset -->
777        <property name="lg2" value="" />
778        <ant dir="apps/routerconsole/java/" >
779            <target name="poupdate" />
780            <target name="poupdate-news" />
781            <target name="poupdate-countries" />
782        </ant>
783        <ant dir="apps/i2psnark/java/" target="poupdate" />
784        <ant dir="apps/i2ptunnel/java/" >
785            <target name="poupdate" />
786            <target name="poupdate-proxy" />
787        </ant>
788        <ant dir="apps/susidns/src/" target="poupdate" />
789        <ant dir="apps/susimail/" target="poupdate" />
790        <ant dir="apps/desktopgui" target="poupdate" />
791        <ant dir="installer/resources/locale" target="poupdate" />
792        <ant dir="apps/ministreaming/java" target="poupdate" />
793    </target>
794
795    <condition property="no.bundle">
796        <isfalse value="${require.gettext}" />
797    </condition>
798
799    <target name="prep-script-translation" unless="no.bundle" >
800        <!-- script translation added in 0.8.13, enabled in 0.9.5. -->
801        <ant dir="installer/resources/locale" target="bundle" />
802        <copy todir="pkg-temp/locale/">
803            <fileset dir="installer/resources/locale/mo/" />
804        </copy>
805    </target>
806
807    <target name="javadoc" depends="getReleaseNumber, getBuildNumber" >
808        <ant dir="apps/jetty" target="ensureJettylib" />
809        <mkdir dir="./build" />
810        <mkdir dir="./build/javadoc" />
811        <javadoc access="package"
812            destdir="./build/javadoc"
813            packagenames="*"
814            use="true"
815            splitindex="true"
816            failonerror="true"
817            additionalparam="-notimestamp"
818            doctitle="I2P Javadocs for Release ${release.number} Build ${i2p.build.number}${build.extra}"
819            windowtitle="I2P Anonymous Network - Java Documentation - Version ${release.number}">
820            <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:org.apache.http.conn.ssl:org.apache.http.conn.util:org.apache.http.util:net.minidev.json:net.minidev.json.*" />
821            <group title="Streaming Library" packages="net.i2p.client.streaming:net.i2p.client.streaming.impl" />
822            <group title="Router" packages="net.i2p.router:net.i2p.router.*:net.i2p.data.i2np:net.i2p.data.router:org.cybergarage:org.cybergarage.*:org.freenetproject:org.xlattice.crypto.filters:com.maxmind.geoip:com.southernstorm.noise.*" />
823            <group title="Router Console" packages="net.i2p.router.web:net.i2p.router.web.*:net.i2p.router.update:net.i2p.router.news" />
824            <!-- apps and bridges starting here, alphabetical please -->
825            <group title="Addressbook Application" packages="net.i2p.addressbook:net.i2p.router.naming:net.metanotion:net.metanotion.*" />
826            <group title="BOB Bridge" packages="net.i2p.BOB" />
827            <group title="BOB Demos" packages="net.i2p.BOB.Demos.echo.echoclient:net.i2p.BOB.Demos.echo.echoserver" />
828            <group title="Desktopgui Application" packages="net.i2p.desktopgui:net.i2p.desktopgui.*" />
829            <group title="I2PSnark Application" packages="org.klomp.snark:org.klomp.snark.*" />
830            <group title="I2PTunnel Application" packages="net.i2p.i2ptunnel:net.i2p.i2ptunnel.*" />
831            <group title="Imagegen Application" packages="com.docuverse.identicon:com.google.zxing:com.google.zxing.*:net.i2p.imagegen" />
832            <group title="Installer Utilities" packages="net.i2p.installer" />
833            <group title="Jetty Utilities" packages="net.i2p.jetty:net.i2p.servlet:net.i2p.servlet.*" />
834            <group title="JRobin Library" packages="org.jrobin:org.jrobin.*:engine.misc" />
835            <group title="SAM Bridge" packages="net.i2p.sam" />
836            <group title="SAM Demos" packages="net.i2p.sam.client" />
837            <group title="SusiDNS Application" packages="i2p.susi.dns:net.i2p.addressbook.servlet" />
838            <group title="SusiMail Application" packages="i2p.susi.webmail:i2p.susi.webmail.*:i2p.susi.debug:i2p.susi.util" />
839            <group title="Systray Application" packages="net.i2p.apps.systray" />
840            <sourcepath>
841                <pathelement location="core/java/src" />
842                <pathelement location="router/java/src" />
843                <pathelement location="apps/ministreaming/java/src" />
844                <pathelement location="apps/streaming/java/src" />
845                <pathelement location="apps/i2ptunnel/java/src" />
846                <pathelement location="apps/systray/java/src" />
847                <pathelement location="apps/desktopgui/src" />
848                <pathelement location="apps/routerconsole/java/src" />
849                <pathelement location="apps/addressbook/java/src" />
850                <pathelement location="apps/i2psnark/java/src" />
851                <pathelement location="apps/sam/java/src" />
852                <pathelement location="apps/BOB/src" />
853                <pathelement location="apps/BOB/Demos/echo/echoclient/src" />
854                <pathelement location="apps/BOB/Demos/echo/echoserver/src" />
855                <pathelement location="apps/susidns/src/java/src" />
856                <pathelement location="apps/susimail/src/src" />
857                <pathelement location="apps/jetty/java/src" />
858                <pathelement location="apps/imagegen/imagegen/webapp/src/main/java" />
859                <pathelement location="apps/imagegen/identicon/core/src/main/java" />
860                <pathelement location="apps/imagegen/zxing/core/src/main/java" />
861                <pathelement location="apps/imagegen/zxing/javase/src/main/java" />
862                <pathelement location="apps/jrobin/java/src" />
863                <pathelement location="installer/java/src" />
864            </sourcepath>
865            <classpath>
866                <!-- warning, some entries are needed for Debian builds only -->
867                <pathelement location="apps/jetty/jettylib/org.mortbay.jetty.jar" />
868                <pathelement location="apps/jetty/jettylib/jasper-runtime.jar" />
869                <pathelement location="apps/jetty/jettylib/javax.servlet.jar" />
870                <pathelement location="apps/jetty/jettylib/jetty-http.jar" />
871                <pathelement location="apps/jetty/jettylib/jetty-security.jar" />
872                <pathelement location="apps/jetty/jettylib/jetty-servlet.jar" />
873                <pathelement location="apps/jetty/jettylib/jetty-servlets.jar" />
874                <pathelement location="apps/jetty/jettylib/jetty-start.jar" />
875                <pathelement location="apps/jetty/jettylib/jetty-util.jar" />
876                <pathelement location="apps/jetty/jettylib/jetty-webapp.jar" />
877                <pathelement location="apps/jetty/jettylib/jetty-xml.jar" />
878                <pathelement location="apps/jetty/jettylib/tomcat-api.jar" />
879                <pathelement location="apps/jrobin/jrobin-1.5.9.1.jar" />
880                <pathelement location="installer/lib/wrapper/all/wrapper.jar" />
881                <!-- following are only for debian builds -->
882                <pathelement location="core/java/build/libintl.jar" />
883                <pathelement location="core/java/build/gnu-getopt.jar" />
884            </classpath>
885            <!-- These variables are stored in build.properties.
886                  End-users can override by creating the file override.properties -->
887            <link offline="true" href="${javasedocs.url}" packagelistLoc="installer/resources/package-lists/java/" />
888            <link offline="true" href="${javaeedocs.url}" packagelistLoc="installer/resources/package-lists/javaee/" />
889            <link offline="true" href="${jettydocs.url}" packagelistLoc="installer/resources/package-lists/jetty/" />
890            <link offline="true" href="${wrapperdocs.url}" packagelistLoc="installer/resources/package-lists/wrapper/" />
891        </javadoc>
892    </target>
893
894    <target name="javadoc-zip" depends="javadoc">
895        <zip destfile="javadoc.zip" basedir="build" level="9" includes="javadoc\**" />
896    </target>
897
898    <target name="javadoc-test" depends="buildRouter, javadoc" >
899        <mkdir dir="./build" />
900        <mkdir dir="./build/javadoc-test" />
901
902        <!-- set junit home to the old default unless overridden elsewhere -->
903        <property name="junit.home" value="${ant.home}/lib/" />
904        <javadoc access="package"
905            destdir="./build/javadoc-test"
906            packagenames="*"
907            use="true"
908            splitindex="true"
909            doctitle="I2P Unit Test Javadocs for Release ${release.number} Build ${i2p.build.number}${build.extra}"
910            windowtitle="I2P Anonymous Network - Java Documentation - Version ${release.number}">
911            <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.*" />
912            <group title="Router" packages="net.i2p.router:net.i2p.router.*:net.i2p.data.i2np:org.cybergarage.*:org.freenetproject:org.xlattice.crypto.filters" />
913            <sourcepath>
914                <pathelement location="core/java/test/junit" />
915                <pathelement location="router/java/test/junit" />
916                <pathelement location="core/java/test/scalatest" />
917            </sourcepath>
918            <classpath>
919                <pathelement location="build/i2p.jar" />
920                <pathelement location="build/router.jar" />
921                <pathelement location="${junit.home}/junit4.jar" />
922                <pathelement location="${hamcrest.home}/hamcrest-all.jar" />
923            </classpath>
924            <!--
925                 These variables are stored in build.properties.
926                 End-users can override by creating the file override.properties
927            -->
928            <link offline="true" href="${javasedocs.url}" packagelistLoc="installer/resources/package-lists/java/" />
929            <link offline="true" href="${junitdocs.url}" packagelistLoc="installer/resources/package-lists/junit/" />
930            <link offline="true" href="${i2pdocs.url}" packagelistLoc="build/javadoc/" />
931        </javadoc>
932        <echo message="Warning, javadoc embeds timestamps in the output, run with 'TZ=UTC ant javadoc' if you plan to distribute" />
933    </target>
934
935    <target name="getReleaseNumber">
936        <loadfile srcfile="core/java/src/net/i2p/CoreVersion.java" property="release.number">
937            <filterchain>
938                <linecontains>
939                    <contains value="public final static String VERSION"/>
940                </linecontains>
941                <tokenfilter>
942                    <replaceregex pattern='.*"([^"]+)";' replace="\1" flags="gi" />
943                </tokenfilter>
944                <striplinebreaks/>
945                <trim/>
946            </filterchain>
947        </loadfile>
948        <property name="release.number" value="unknown" />
949        <echo message="Release number is ${release.number}" />
950    </target>
951
952    <target name="getBuildNumber">
953        <loadfile srcfile="router/java/src/net/i2p/router/RouterVersion.java" property="i2p.build.number">
954            <filterchain>
955                <linecontains>
956                    <contains value="public final static long BUILD" />
957                </linecontains>
958                <tokenfilter>
959                    <replaceregex pattern=".*=\s+([0-9]+);" replace="\1" flags="gi" />
960                </tokenfilter>
961                <trim/>
962                <striplinebreaks/>
963            </filterchain>
964        </loadfile>
965        <loadfile srcfile="router/java/src/net/i2p/router/RouterVersion.java" property="build.extra">
966            <filterchain>
967                <linecontains>
968                    <contains value="public final static String EXTRA" />
969                </linecontains>
970                <tokenfilter>
971                    <replaceregex pattern='.*"(.*)";' replace="\1" flags="gi" />
972                </tokenfilter>
973                <trim/>
974                <striplinebreaks/>
975            </filterchain>
976        </loadfile>
977        <property name="i2p.build.number" value="??" />
978        <property name="build.extra" value="" />
979        <echo message="Build number is ${i2p.build.number}${build.extra}" />
980    </target>
981
982    <target name="verifyReleaseBuildNumbers" depends="getReleaseNumber, getBuildNumber" >
983        <echo message="SDK: ${java.vendor} ${java.version} (${java.runtime.name} ${java.runtime.version})" />
984        <fail message="Bad release number: ${release.number}" >
985            <condition>
986                <or>
987                    <equals arg1="${release.number}" arg2="unknown"/>
988                    <equals arg1="${release.number}" arg2=""/>
989                </or>
990            </condition>
991        </fail>
992        <fail message="Non-zero build number: ${i2p.build.number}" >
993            <condition>
994                <not>
995                    <equals arg1="${i2p.build.number}" arg2="0"/>
996                </not>
997            </condition>
998        </fail>
999        <fail message="Non-empty extra build: ${build.extra}" >
1000            <condition>
1001                <not>
1002                    <equals arg1="${build.extra}" arg2=""/>
1003                </not>
1004            </condition>
1005        </fail>
1006    </target>
1007
1008    <target name="-pre-sign">
1009            <!-- if you're distributing su3 files to others, at a minimum you should set these -->
1010            <fail message="javac.compilerargs must contain a -bootclasspath option in override.properties">
1011                <condition>
1012                    <not><contains string="${javac.compilerargs}" substring="-bootclasspath"/></not>
1013                </condition>
1014            </fail>
1015            <fail message="javac.compilerargs7 must contain a -bootclasspath option in override.properties">
1016                <condition>
1017                    <not><contains string="${javac.compilerargs7}" substring="-bootclasspath"/></not>
1018                </condition>
1019            </fail>
1020            <fail message="build.built-by must be set in override.properties">
1021                <condition>
1022                    <equals arg1="${build.built-by}" arg2="unknown"/>
1023                </condition>
1024            </fail>
1025            <fail message="require.gettext must be true">
1026                <condition>
1027                    <not><equals arg1="${require.gettext}" arg2="true"/></not>
1028                </condition>
1029            </fail>
1030    </target>
1031
1032    <target name="-pre-release" depends="-pre-sign, failIfNoMtn">
1033            <echo message="================================================================" />
1034            <echo message="Did you update these files?" />
1035            <exec executable="ls" failonerror="true">
1036                    <arg value="-l" />
1037                    <arg value="history.txt" />
1038                    <arg value="installer/install.xml" />
1039                    <arg value="core/java/src/net/i2p/CoreVersion.java" />
1040                    <arg value="router/java/src/net/i2p/router/RouterVersion.java" />
1041            </exec>
1042            <echo message="Everything is checked in, right? Let's be sure:" />
1043            <exec executable="mtn" failonerror="true">
1044                    <arg value="st" />
1045            </exec>
1046            <echo message="If there are any modified files above, stop now!" />
1047            <echo message="================================================================" />
1048            <sleep seconds="3"/>
1049    </target>
1050
1051    <target name="clean" depends="pkgclean" >
1052        <delete dir="./build" />
1053        <delete dir="./reports" />
1054        <delete file="installer/lib/izpack/patches.jar" failonerror="false" quiet="true" />
1055        <delete file="syndie-standalone.zip" failonerror="false" quiet="true" />
1056        <delete file="i2psnark-standalone.zip" failonerror="false" quiet="true" />
1057        <delete file="BOB-one.jar" failonerror="false" quiet="true" />
1058        <delete file="core/java/cobertura.ser"/>
1059        <delete file="javadoc.zip" />
1060        <delete file="i2p.fba" />
1061        <delete file="${sloccount.report.file}" />
1062        <delete file="mavencentral-i2p.jar" />
1063        <delete file="mavencentral-router.jar" />
1064        <delete file="mavencentral-mstreaming.jar" />
1065        <delete file="mavencentral-streaming.jar" />
1066        <delete file="mavencentral-servlet-i2p.jar" />
1067    </target>
1068
1069    <target name="distclean" depends="clean">
1070        <delete failonerror="false" quiet="true">
1071            <fileset dir="." includes="i2pinstall* *.deb i2p_*.bz2 i2pupdate* i2psource* *.sig *.torrent" />
1072        </delete>
1073        <ant dir="core/java/" target="distclean" />
1074        <ant dir="router/java/" target="distclean" />
1075        <ant dir="installer/java" target="distclean" />
1076        <ant dir="apps/ministreaming/java/" target="distclean" />
1077        <ant dir="apps/streaming/java/" target="distclean" />
1078        <ant dir="apps/i2ptunnel/java/" target="distclean" />
1079        <ant dir="apps/sam/java/" target="distclean" />
1080        <ant dir="apps/BOB" target="clean" />
1081        <ant dir="apps/desktopgui" target="clean" />
1082        <ant dir="apps/routerconsole/java/" target="distclean" />
1083        <ant dir="apps/addressbook/" target="distclean" />
1084        <ant dir="apps/susimail/" target="distclean" />
1085        <ant dir="apps/susidns/src/" target="distclean" />
1086        <ant dir="apps/systray/java/" target="distclean" />
1087        <ant dir="apps/i2psnark/java/" target="distclean" />
1088        <ant dir="apps/jetty/" target="distclean" />
1089        <ant dir="apps/imagegen/" target="distclean" />
1090        <ant dir="apps/jrobin/java" target="distclean" />
1091        <delete dir="core/c/jbigi/bin" />
1092        <delete dir="core/c/jbigi/lib" />
1093        <delete dir="core/c/jcpuid/lib" />
1094        <ant dir="installer/resources/locale" target="distclean" />
1095        <ant dir="installer/tools/java" target="distclean" />
1096        <!--
1097                NOTE! We need to turn off the default excludes for these
1098                patterns to work.
1099                These are the defaultexcludes in Ant as seen on
1100                http://ant.apache.org/manual/CoreTasks/defaultexcludes.html
1101                     **/*~
1102                     **/#*#
1103                     **/.#*
1104                     **/%*%
1105                     **/._*
1106                     **/CVS
1107                     **/CVS/**
1108                     **/.cvsignore
1109                     **/SCCS
1110                     **/SCCS/**
1111                     **/vssver.scc
1112                     **/.svn
1113                     **/.svn/**
1114                     **/.DS_Store
1115                The only recourse is to remove the offending ones.
1116                We do this here, as we only need one change, and then put it
1117                back after we are done with it.
1118        -->
1119        <defaultexcludes remove="**/*~"/>
1120
1121        <delete>
1122            <fileset dir="." includes="**/*.class **/*.java~ **/*.txt~ **/*.xml~ **/*.sh~ **/*.SlackBuild~" />
1123            <!--
1124                Less common, but they pollute my workspace here, so we
1125                might as well nuke these as well. Are there any others?
1126
1127                !!??? Why don't we just nuke "**/*~" ???!!
1128
1129                ++Sponge
1130            -->
1131        </delete>
1132        <!--
1133                Now we put the defaults back
1134        -->
1135        <defaultexcludes default="true"/>
1136    </target>
1137
1138    <target name="webappDistclean">
1139        <ant dir="apps/i2ptunnel/java/" target="distclean" />
1140        <ant dir="apps/routerconsole/java/" target="distclean" />
1141        <ant dir="apps/addressbook/" target="distclean" />
1142        <ant dir="apps/susimail/" target="distclean" />
1143        <ant dir="apps/susidns/src/" target="distclean" />
1144        <ant dir="apps/i2psnark/java/" target="distclean" />
1145        <ant dir="apps/imagegen/" target="distclean" />
1146    </target>
1147
1148    <target name="pkg" depends="distclean, updater, preppkg, installer" />
1149
1150    <target name="pkg200" depends="distclean, updater200, preppkg, installer" />
1151
1152    <target name="pkgclean" depends="deletepkg-temp">
1153        <delete>
1154            <fileset dir="." includes="i2p.tar.bz2 install.jar i2pupdate.zip i2pupdate200.zip" />
1155        </delete>
1156    </target>
1157
1158    <target name="preppkg" depends="preppkg-linux, preppkg-freebsd, preppkg-osx, preppkg-windows, jbigi">
1159        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
1160        <copy todir="pkg-temp/lib/wrapper/solaris/">
1161            <fileset dir="installer/lib/wrapper/solaris/" excludes="*.txt" />
1162        </copy>
1163     <!-- Force using the new wrapper.jar.
1164          The new jar with the old windows binaries will output a warning on windows.
1165          We do not generate release files from this target.
1166          See preppkg-windows-only target below.
1167      -->
1168        <copy overwrite="true" file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
1169    </target>
1170
1171    <target name="preppkg-nowindows" depends="preppkg-linux, preppkg-freebsd, preppkg-osx, jbigi-nowindows">
1172        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
1173        <copy todir="pkg-temp/lib/wrapper/solaris/">
1174            <fileset dir="installer/lib/wrapper/solaris/" excludes="*.txt" />
1175        </copy>
1176        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
1177    </target>
1178
1179    <target name="preppkgRepack" depends="preppkg-linux, preppkg-freebsd, preppkg-osx, preppkg-windows, jbigi">
1180        <ant target="repack200" />
1181        <!-- no use doing repack200 on jbigi.jar -->
1182        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
1183        <copy todir="pkg-temp/lib/wrapper/solaris/">
1184            <fileset dir="installer/lib/wrapper/solaris/" excludes="*.txt" />
1185        </copy>
1186    </target>
1187
1188    <target name="preppkg-freebsd" depends="preppkg-unix">
1189        <copy todir="pkg-temp/lib/wrapper/freebsd/">
1190            <fileset dir="installer/lib/wrapper/freebsd/" excludes="*.txt" />
1191        </copy>
1192        <copy todir="pkg-temp/lib/wrapper/freebsd64/">
1193            <fileset dir="installer/lib/wrapper/freebsd64" excludes="*.txt" />
1194        </copy>
1195    </target>
1196
1197    <target name="preppkg-freebsd-only" depends="preppkg-freebsd, jbigi-freebsd-only" >
1198        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
1199        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
1200    </target>
1201
1202    <!-- only what is needed for debian, etc. -->
1203    <target name="preppkg-linux-only" depends="preppkg-linux, jbigi-linux-only" >
1204        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
1205        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
1206    </target>
1207
1208    <!-- This is the target called by debian/rules -->
1209    <target name="preppkg-unix" depends="preppkg-base, prep-script-translation" >
1210        <copy file="installer/resources/runplain.sh" todir="pkg-temp/" />
1211        <copy file="installer/resources/eepget" todir="pkg-temp/" />
1212        <copy file="installer/resources/i2prouter" todir="pkg-temp/" />
1213        <copy file="installer/resources/osid" todir="pkg-temp/" />
1214        <copy file="installer/resources/postinstall.sh" todir="pkg-temp/" />
1215        <copy todir="pkg-temp/man/">
1216            <fileset dir="installer/resources/man/" />
1217        </copy>
1218    </target>
1219
1220    <target name="preppkg-linux" depends="preppkg-linux-x86,preppkg-linux-nonx86" />
1221
1222    <target name="preppkg-linux-x86" depends="preppkg-unix">
1223        <copy todir="pkg-temp/lib/wrapper/linux/">
1224            <fileset dir="installer/lib/wrapper/linux/" excludes="*.txt" />
1225        </copy>
1226        <copy todir="pkg-temp/lib/wrapper/linux64/">
1227            <fileset dir="installer/lib/wrapper/linux64/" excludes="*.txt" />
1228        </copy>
1229    </target>
1230
1231    <target name="preppkg-linux-nonx86" depends="preppkg-unix">
1232        <copy todir="pkg-temp/lib/wrapper/linux-ppc/">
1233            <fileset dir="installer/lib/wrapper/linux-ppc/" excludes="*.txt" />
1234        </copy>
1235        <copy todir="pkg-temp/lib/wrapper/linux-armv5/">
1236            <fileset dir="installer/lib/wrapper/linux-armv5/" excludes="*.txt" />
1237        </copy>
1238        <copy todir="pkg-temp/lib/wrapper/linux-armv6/">
1239            <fileset dir="installer/lib/wrapper/linux-armv6/" excludes="*.txt" />
1240        </copy>
1241    </target>
1242
1243    <target name="preppkg-osx" depends="preppkg-unix">
1244        <!--<copy file="installer/resources/I2P Router Console.webloc" todir="pkg-temp/" />-->
1245        <copy todir="pkg-temp/Start I2P Router.app">
1246            <fileset dir="installer/resources/Start I2P Router.app" />
1247        </copy>
1248        <copy todir="pkg-temp/lib/wrapper/macosx/">
1249            <fileset dir="installer/lib/wrapper/macosx/" excludes="*.txt" />
1250        </copy>
1251        <copy file="installer/resources/net.i2p.router.plist.template" todir="pkg-temp/" />
1252        <copy file="installer/resources/install_i2p_service_osx.command" todir="pkg-temp/" />
1253        <copy file="installer/resources/uninstall_i2p_service_osx.command" todir="pkg-temp/" />
1254    </target>
1255
1256    <target name="preppkg-osx-only" depends="preppkg-osx, jbigi-osx-only" >
1257        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
1258        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
1259    </target>
1260
1261    <target name="preppkg-windows" depends="preppkg-base, preplicenses-windows, buildUtilityJar, buildexe">
1262        <copy file="build/i2p.exe" todir="pkg-temp/" failonerror="false" />
1263        <copy file="installer/resources/eepget.bat" todir="pkg-temp/" />
1264        <copy file="installer/resources/i2prouter.bat" todir="pkg-temp/" />
1265        <copy file="installer/resources/fixperms.bat" todir="pkg-temp/" />
1266        <copy file="installer/resources/install_i2p_service_winnt.bat" todir="pkg-temp/" />
1267        <copy file="installer/resources/set_config_dir_for_nt_service.bat" todir="pkg-temp/" />
1268        <copy file="installer/resources/uninstall_i2p_service_winnt.bat" todir="pkg-temp/" />
1269        <copy file="build/utility.jar" todir="pkg-temp" />
1270        <copy todir="pkg-temp/lib/wrapper/win32/">
1271            <fileset dir="installer/lib/wrapper/win32/" excludes="*.txt" />
1272        </copy>
1273        <copy todir="pkg-temp/lib/wrapper/win64/">
1274            <fileset dir="installer/lib/wrapper/win64/" excludes="*.txt" />
1275        </copy>
1276    </target>
1277
1278    <target name="preppkg-windows-only" depends="preppkg-windows, jbigi-windows-only">
1279        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
1280     <!-- Win binaries are down-rev from the others, so use the old jar.
1281          This will not overwrite, so preppkg (for all OSes) will get the new jar with
1282          the old binaries, which will probably work but will output a warning.
1283          The windows-only installer will get the correct jar.
1284        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
1285      -->
1286        <copy overwrite="true" file="installer/lib/wrapper/win-all/wrapper.jar" todir="pkg-temp/lib" />
1287    </target>
1288
1289    <!-- see targets below for conditional copying -->
1290    <target name="preppkg-base" depends="build, preplicenses, prepConsoleDocs, prepthemeupdates, prepCertificates, prepRouterInfos, copyjetty, copytomcat-unlesspkg, copyjstl-unlesspkg, copystandard-unlesspkg, copyflags-unlesspkg, truncatehistory">
1291        <!-- if updater200 was run previously, it left *.pack files in pkg-temp -->
1292        <!-- Also remove deletelist.txt used for updater only -->
1293        <delete>
1294            <fileset dir="pkg-temp" includes="**/*.jar.pack **/*.war.pack deletelist.txt" />
1295        </delete>
1296        <copy file="build/i2p.jar" todir="pkg-temp/lib/" />
1297        <copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
1298        <copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
1299        <copy file="build/streaming.jar" todir="pkg-temp/lib/" />
1300        <copy file="build/router.jar" todir="pkg-temp/lib/" />
1301        <copy file="build/desktopgui.jar" todir="pkg-temp/lib/" />
1302        <copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
1303        <!-- Updated in 0.9.28; name without version so we can overwrite if we upgrade  -->
1304        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
1305        <copy file="build/sam.jar" todir="pkg-temp/lib/" />
1306        <copy file="build/BOB.jar" todir="pkg-temp/lib/" />
1307        <copy file="build/systray.jar" todir="pkg-temp/lib" />
1308        <copy file="build/i2psnark.jar" todir="pkg-temp/lib/" />
1309        <copy file="build/i2ptunnel.war" todir="pkg-temp/webapps/" />
1310        <copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
1311        <copy file="build/addressbook.jar" todir="pkg-temp/lib/" />
1312        <copy file="build/susimail.war" todir="pkg-temp/webapps/" />
1313        <copy file="build/susidns.war" todir="pkg-temp/webapps/" />
1314        <copy file="build/imagegen.war" todir="pkg-temp/webapps/" />
1315        <copy file="build/i2psnark.war" todir="pkg-temp/webapps/" />
1316        <copy file="apps/i2psnark/i2psnark.config" todir="pkg-temp/" />
1317        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
1318        <copy file="installer/resources/clients.config" todir="pkg-temp/" />
1319        <copy file="installer/resources/i2ptunnel.config" todir="pkg-temp/" />
1320        <copy file="installer/resources/systray.config" todir="pkg-temp/" />
1321        <copy file="installer/resources/wrapper.config" todir="pkg-temp/" />
1322        <copy file="installer/resources/hosts.txt" todir="pkg-temp/" />
1323        <copy file="INSTALL-headless.txt" todir="pkg-temp/" />
1324        <mkdir dir="pkg-temp/scripts" />
1325        <copy file="apps/proxyscript/i2pProxy.pac" todir="pkg-temp/scripts/" />
1326        <copy file="apps/apparmor/home.i2p.i2prouter" todir="pkg-temp/scripts/" />
1327        <copy file="installer/resources/startconsole.html" todir="pkg-temp/docs/" />
1328        <copy file="installer/resources/start.ico" todir="pkg-temp/docs/" />
1329        <copy file="installer/resources/console.ico" todir="pkg-temp/docs/" />
1330        <copy file="installer/resources/uninstall.ico" todir="pkg-temp/docs/" />
1331        <!-- Eepsite stuff here -->
1332        <mkdir dir="pkg-temp/eepsite" />
1333        <copy todir="pkg-temp/eepsite/" >
1334            <fileset dir="installer/resources/eepsite/" excludes="**/.placeholder" />
1335        </copy>
1336        <copy file="installer/resources/themes/console/images/favicon.ico" tofile="pkg-temp/eepsite/docroot/favicon.ico" />
1337    </target>
1338
1339    <target name="copyflags-unlesspkg" unless="${with-famfamfam-flag-png}" >
1340        <copy todir="pkg-temp/eepsite/docroot/help/lib/" >
1341            <fileset dir="installer/resources/icons/flags/" includes="az.png cn.png de.png es.png fr.png ir.png it.png jp.png nl.png pl.png pt.png ru.png se.png us.png" />
1342        </copy>
1343        <copy todir="pkg-temp/docs/icons/flags" >
1344          <!-- base flags/ dir only. flags16x11/ and flags48x48/ dirs already copied by prepConsoleDocs target -->
1345          <fileset dir="installer/resources/icons/flags" />
1346        </copy>
1347    </target>
1348
1349    <target name="copyjetty" depends="copyjetty-unlesspkg" >
1350        <copy file="build/jetty-i2p.jar" todir="pkg-temp/lib" />
1351    </target>
1352
1353    <target name="copyjetty-unlesspkg" unless="${with-libjetty9-java}" >
1354        <copy todir="pkg-temp/lib" >
1355            <fileset dir="build" includes="javax.servlet.jar jetty*.jar org.mortbay.*.jar" excludes="jetty-i2p.jar" />
1356        </copy>
1357    </target>
1358
1359    <target name="settomcatprop" >
1360        <condition property="with-libtomcat-java" >
1361            <or>
1362                <istrue value="${with-libtomcat6-java}" />
1363                <istrue value="${with-libtomcat7-java}" />
1364                <istrue value="${with-libtomcat8-java}" />
1365            </or>
1366        </condition>
1367    </target>
1368
1369    <target name="copytomcat-unlesspkg" depends="settomcatprop" unless="${with-libtomcat-java}" >
1370        <copy todir="pkg-temp/lib" >
1371            <fileset dir="build" includes="commons*.jar jasper*.jar javax*.jar" />
1372        </copy>
1373    </target>
1374
1375    <!--
1376       jstl.jar
1377       glassfish-javaee.jar has ancient and conflicting classes, e.g. javax.mail,
1378       and libjstl1.1-java isn't sufficient,
1379       so we only skip it with libtaglibs-standard
1380    -->
1381    <target name="copyjstl-unlesspkg" unless="${with-libtaglibs-standard}" >
1382        <copy file="apps/susidns/src/lib/jstl.jar" todir="pkg-temp/lib/" />
1383    </target>
1384
1385    <!-- standard.jar -->
1386    <target name="copystandard-unlesspkg" depends="copystandard-unlesspkg1, copystandard-unlesspkg2" />
1387    <target name="copystandard-unlesspkg1" >
1388        <condition property="with-any-standard-pkg" >
1389            <or>
1390                <istrue value="${with-libtaglibs-standard}" />
1391                <istrue value="${with-glassfish-javaee}" />
1392                <istrue value="${libjakarta-taglibs-standard-java}" />
1393            </or>
1394
1395        </condition>
1396    </target>
1397    <target name="copystandard-unlesspkg2" unless="${with-any-standard-pkg}" >
1398        <copy file="apps/susidns/src/lib/standard.jar" todir="pkg-temp/lib/" />
1399    </target>
1400
1401    <!-- does NOT include launch4j licenses for Windows builds -->
1402    <target name="preplicenses" depends="preplicenses-unlesspkg" >
1403        <copy file="LICENSE.txt" todir="pkg-temp/" />
1404        <copy todir="pkg-temp/licenses/" >
1405          <fileset dir="licenses/" />
1406        </copy>
1407        <copy file="apps/imagegen/identicon/README.md" tofile="pkg-temp/licenses/LICENSE-Identicon.txt" />
1408        <copy file="apps/desktopgui/LICENSE" tofile="pkg-temp/licenses/LICENSE-DesktopGUI.txt" />
1409    </target>
1410
1411    <target name="preplicenses-unlesspkg" depends="settomcatprop" unless="${with-libtomcat-java}" >
1412        <copy file="apps/jetty/apache-tomcat-${tomcat.ver}/NOTICE" tofile="pkg-temp/licenses/NOTICE-Tomcat.txt" />
1413    </target>
1414
1415    <!-- DOES include launch4j licenses for Windows builds -->
1416    <target name="preplicenses-windows" depends="preplicenses">
1417        <!--
1418              The license in launch4j/ is a BSD license for launch4j
1419              The license in launch4j/head is a MIT license for the code that is actually wrapped around the jars
1420              So we include the MIT one in our binary package
1421         -->
1422        <copy file="installer/lib/launch4j/head/LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-Launch4j.txt" />
1423        <!--  Not sure if these are used or should be included -->
1424        <copy file="installer/lib/launch4j/lib/foxtrot.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-Foxtrot.txt" />
1425        <copy file="installer/lib/launch4j/lib/JGoodies.Forms.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-JGoodies-Forms.txt" />
1426        <copy file="installer/lib/launch4j/lib/JGoodies.Looks.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-JGoodies-Looks.txt" />
1427        <copy file="installer/lib/launch4j/lib/XStream.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-XStream.txt" />
1428    </target>
1429
1430    <target name="prepthemeupdates">
1431        <copy todir="pkg-temp/docs/themes/" >
1432            <fileset dir="installer/resources/themes/" />
1433        </copy>
1434    </target>
1435
1436    <!-- SSL Certs -->
1437    <target name="prepCertificates">
1438        <copy todir="pkg-temp/certificates/" >
1439          <fileset dir="installer/resources/certificates/" />
1440        </copy>
1441    </target>
1442
1443    <condition property="no.bundle.routerInfos">
1444        <isfalse value="${bundle.routerInfos}" />
1445    </condition>
1446
1447    <target name="prepRouterInfos" depends="buildrouter, buildTools" unless="no.bundle.routerInfos">
1448        <delete dir="pkg-temp/netDb" />
1449        <mkdir dir="pkg-temp/netDb" />
1450        <java classname="net.i2p.router.networkdb.kademlia.BundleRouterInfos" fork="true" failonerror="true">
1451            <classpath>
1452                <pathelement location="build/i2p.jar" />
1453                <pathelement location="core/java/build/gnu-getopt.jar" />
1454                <pathelement location="build/router.jar" />
1455                <pathelement location="build/tools.jar" />
1456            </classpath>
1457            <arg value="-i" />
1458            <arg value="${bundle.routerInfos.i2pConfigDir}" />
1459            <arg value="-o" />
1460            <arg value="pkg-temp/netDb" />
1461            <arg value="-c" />
1462            <arg value="${bundle.routerInfos.count}" />
1463        </java>
1464    </target>
1465
1466    <target name="-areRouterInfosEnabled">
1467        <fail message="Option requires &quot;bundle.routerInfos&quot; to be configured. Please read &quot;build.properties&quot; for more info." >
1468            <condition>
1469                <isfalse value="${bundle.routerInfos}" />
1470            </condition>
1471        </fail>
1472    </target>
1473
1474    <target name="i2pseeds" depends="-setepoch, -areRouterInfosEnabled, prepRouterInfos">
1475        <delete file="i2pseeds.zip" />
1476        <delete file="i2pseeds.su3" />
1477        <zip destfile="i2pseeds.zip" basedir="pkg-temp/netDb" whenempty="fail" />
1478        <su3sign infile="i2pseeds.zip" sigtype="RESEED" outfile="i2pseeds.su3" su3.ver="${epoch}" />
1479    </target>
1480
1481    <!-- this is no longer required, izpack 4.3.0 supports headless installs with java -jar i2pinstall.exe -console -->
1482    <!-- and this is no longer used by the SlackBuild -->
1483    <target name="tarball" depends="preppkg">
1484        <tar compression="bzip2" destfile="i2p.tar.bz2">
1485            <tarfileset dir="pkg-temp" includes="**/*" prefix="i2p" />
1486        </tar>
1487    </target>
1488
1489    <target name="deletepkg-temp">
1490        <delete dir="pkg-temp" />
1491        <delete dir="./pkg-mavencentral" />
1492    </target>
1493
1494    <!-- readme and proxy error page files, initialNews.xml files, GeoIP files, and flag icons -->
1495    <target name="prepConsoleDocs" depends="prepConsoleDocUpdates, prepgeoupdate" >
1496        <copy todir="pkg-temp/docs/initialNews/">
1497          <fileset dir="installer/resources/initialNews/" />
1498        </copy>
1499        <!-- ensure the proxy files have the correct line endings -->
1500        <fixcrlf srcdir="pkg-temp/docs" includes="*.ht" encoding="utf8" eol="crlf" />
1501    </target>
1502
1503    <!-- readme and proxy error page files -->
1504    <target name="prepConsoleDocUpdates">
1505        <copy todir="pkg-temp/docs/" >
1506          <fileset dir="installer/resources/readme/" includes="readme*.html" />
1507          <fileset dir="installer/resources/proxy/" includes="*.ht" />
1508          <!--
1509               As of 0.9.36:
1510               All new and changed flags must go in the flags16x11/ dir,
1511               which will be checked first by flags.jsp.
1512               The flags/ dir is the original set from famfamfam,
1513               which may be symlinked in package installs.
1514           -->
1515          <fileset dir="installer/resources/" includes="icons/flags16x11/*" />
1516          <!-- flags48x48 added in 0.9.32 -->
1517          <fileset dir="installer/resources/" includes="icons/flags48x48/*" />
1518        </copy>
1519    </target>
1520
1521    <target name="consoleDocs" depends="deletepkg-temp, prepConsoleDocs">
1522        <zip destfile="docs.zip" basedir="pkg-temp" whenempty="fail" />
1523    </target>
1524
1525    <target name="copyJavadoc" depends="javadoc">
1526        <copy todir="pkg-temp/docs/javadoc" >
1527          <fileset dir="build/javadoc/" />
1528        </copy>
1529    </target>
1530
1531    <target name="updater200" depends="prepupdate, preplicenses, pack200, zipit200" />
1532    <target name="updater200WithJetty" depends="prepjupdate, preplicenses, pack200, zipit200" />
1533    <target name="updater200WithJettyAndJbigi" depends="prepjupdate, prepjbigiupdate, preplicenses, pack200, zipit200" />
1534    <target name="updater200WithJettyAndGeoIP" depends="prepjupdate, prepgeoupdate, preplicenses, pack200, zipit200" />
1535    <target name="updater200WithJettyFixes" depends="prepjupdatefixes, preplicenses, pack200, zipit200" />
1536    <target name="updater200WithJettyFixesAndJbigi" depends="prepjupdatefixes, prepjbigiupdate, preplicenses, pack200, zipit200" />
1537    <target name="updater200WithJbigi" depends="prepupdate, prepjbigiupdate, preplicenses, pack200, zipit200" />
1538    <target name="updater" depends="prepupdate, preplicenses, zipit" />
1539    <target name="updaterRepack" depends="prepupdate, preplicenses, repack200, zipit" />
1540    <target name="updaterWithJavadoc" depends="prepupdate, preplicenses, copyJavadoc, zipit" />
1541    <target name="updater200WithJavadoc" depends="prepupdate, preplicenses, copyJavadoc, pack200, zipit200" />
1542    <target name="updaterWithJavadocAndJetty" depends="prepjupdate, preplicenses, copyJavadoc, zipit" />
1543    <target name="updater200WithJavadocAndJetty" depends="prepjupdate, preplicenses, copyJavadoc, pack200, zipit200" />
1544    <target name="updaterWithGeoIP" depends="prepupdate, prepgeoupdate, preplicenses, zipit" />
1545    <target name="updaterWithJetty" depends="prepjupdate, preplicenses, zipit" />
1546    <target name="updaterWithJettyRepack" depends="prepjupdate, preplicenses, repack200, zipit" />
1547    <target name="updaterWithJettyAndJbigiRepack" depends="prepjupdate, prepjbigiupdate, preplicenses, repack200, zipit" />
1548    <target name="updaterWithJettyAndGeoIPRepack" depends="prepjupdate, prepgeoupdate, preplicenses, repack200, zipit" />
1549    <target name="updaterWithJettyFixes" depends="prepjupdatefixes, preplicenses, zipit" />
1550    <target name="updaterWithJettyFixesAndJbigi" depends="prepjupdatefixes, prepjbigiupdate, preplicenses, zipit" />
1551    <target name="updaterWithJettyFixesAndGeoIP" depends="prepjupdatefixes, prepgeoupdate, preplicenses, zipit" />
1552    <target name="updaterWithJbigi" depends="prepupdate, prepjbigiupdate, preplicenses, zipit" />
1553    <target name="updaterSmall" depends="prepupdateSmall, zipit" />
1554    <target name="updaterRouter" depends="prepupdateRouter, zipit" />
1555
1556    <target name="-sign-update" depends="buildrouter">
1557        <su3sign infile="i2pupdate200.zip" sigtype="ROUTER" outfile="i2pupdate.su3" su3.ver="${full.version}" />
1558    </target>
1559
1560    <target name="signed-updater200" depends="-pre-sign, updater200, -sign-update" />
1561    <target name="signed-updater200WithJetty" depends="-pre-sign, updater200WithJetty, -sign-update" />
1562    <target name="signed-updater200WithJettyAndGeoIP" depends="-pre-sign, updater200WithJettyAndGeoIP, -sign-update" />
1563    <target name="signed-updater200WithJavadoc" depends="-pre-sign, updater200WithJavadoc, -sign-update" />
1564    <target name="signed-updater200WithJavadocAndJetty" depends="-pre-sign, updater200WithJavadocAndJetty, -sign-update" />
1565
1566    <target name="zipit" depends="getReleaseNumber">
1567        <!--
1568             As of release 0.8.8, the router will enforce a zipfile comment equal to the
1569             version number in the sud/su2 header, since the version in the header is NOT
1570             covered by the signature.
1571         -->
1572        <zip destfile="i2pupdate.zip" basedir="pkg-temp" whenempty="fail" comment="${release.number}" />
1573       <!-- just a test, makes almost no difference
1574        <tar destfile="i2pupdate.tgz" basedir="pkg-temp" compression="gzip" />
1575        <tar destfile="i2pupdate.tbz" basedir="pkg-temp" compression="bzip2" />
1576       -->
1577    </target>
1578
1579    <target name="zipit200" depends="getReleaseNumber" >
1580        <zip destfile="i2pupdate200.zip" basedir="pkg-temp" whenempty="fail" comment="${release.number}" />
1581    </target>
1582
1583    <target name="pack200">
1584        <!-- pack200 will only pack to a .pack file, and only from a .jar file, so we put another .jar on the end -->
1585        <!-- can't pack an empty jar or one without classes, it will fail to unpack on Java 5;
1586          -  see http://bugs.sun.com/view_bug.do?bug_id=6712743
1587          -->
1588        <!-- *nix here -->
1589        <exec executable="sh" osfamily="unix" failonerror="true">
1590            <arg value="-c" />
1591            <arg value="for i in pkg-temp/lib/*.jar pkg-temp/webapps/*war; do if [ $i = pkg-temp/lib/commons-logging.jar -o $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 -o $i = pkg-temp/webapps/addressbook.war ]; then continue; fi; echo pack200 $i; mv $i $i.jar; pack200 -g $i.pack $i.jar; rm -f $i.jar; done" />
1592        </exec>
1593        <exec executable="sh" osfamily="mac" failonerror="true">
1594            <arg value="-c" />
1595            <arg value="for i in pkg-temp/lib/*.jar pkg-temp/webapps/*war; do if [ $i = pkg-temp/lib/commons-logging.jar -o $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 -o $i = pkg-temp/webapps/addressbook.war ]; then continue; fi; echo pack200 $i; mv $i $i.jar; pack200 -g $i.pack $i.jar; rm -f $i.jar; done" />
1596        </exec>
1597        <!-- windoz here : i admit, i hate escaped symbols in xml, indeed = =! -->
1598        <exec executable="cmd" osfamily="windows" failonerror="true">
1599            <arg value="/c" />
1600            <!-- TODO implement fix above -->
1601            <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" />
1602        </exec>
1603        <exec executable="cmd" osfamily="windows" failonerror="true">
1604                <arg value="/c" />
1605                <arg value="for %i in (pkg-temp\lib\*.jar) do pack200 -g %i.pack %i &amp;&amp; del %i" />
1606        </exec>
1607    </target>
1608
1609    <!-- saves about 1% on average (more on jars with multiple compiled po files since they have lots of common strings) -->
1610    <target name="repack200">
1611        <!-- pack200 will only repack a .jar file, so we put another .jar on the end -->
1612        <!-- *nix here -->
1613        <exec executable="sh" osfamily="unix" failonerror="true">
1614            <arg value="-c" />
1615            <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" />
1616        </exec>
1617        <exec executable="sh" osfamily="mac" failonerror="true">
1618            <arg value="-c" />
1619            <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" />
1620        </exec>
1621        <!-- windoz here : i admit, i hate escaped symbols in xml, indeed = =! -->
1622        <exec executable="cmd" osfamily="windows" failonerror="true">
1623            <arg value="/c" />
1624            <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" />
1625        </exec>
1626        <exec executable="cmd" osfamily="windows" failonerror="true">
1627                <arg value="/c" />
1628                <arg value="for %i in (pkg-temp\lib\*.jar) do pack200 -r %i" />
1629        </exec>
1630    </target>
1631
1632    <target name="prepupdate" depends="build2, prepupdateSmall, prepConsoleDocUpdates, prepCertificates, prep-script-translation, truncatehistory">
1633        <copy file="build/BOB.jar" todir="pkg-temp/lib/" />
1634        <copy file="build/sam.jar" todir="pkg-temp/lib/" />
1635        <copy file="build/i2psnark.jar" todir="pkg-temp/lib" />
1636        <!-- include systray changes in 0.7.5 -->
1637        <copy file="build/systray.jar" todir="pkg-temp/lib/" />
1638       <!-- removed from updater in 0.9, added back in 0.9.26 -->
1639        <copy file="build/desktopgui.jar" todir="pkg-temp/lib/" />
1640        <copy file="build/susimail.war" todir="pkg-temp/webapps/" />
1641        <copy file="build/susidns.war" todir="pkg-temp/webapps/" />
1642        <copy file="build/imagegen.war" todir="pkg-temp/webapps/" />
1643        <!-- as of 0.7.12; last changed in 0.9; removed from update in 0.9.26 -->
1644      <!--
1645        <copy file="apps/susidns/src/lib/jstl.jar" todir="pkg-temp/lib/" />
1646        <copy file="apps/susidns/src/lib/standard.jar" todir="pkg-temp/lib/" />
1647       -->
1648        <copy file="build/i2psnark.war" todir="pkg-temp/webapps/" />
1649        <copy file="installer/resources/deletelist.txt" todir="pkg-temp/" />
1650        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
1651        <copy todir="pkg-temp/man/">
1652            <fileset dir="installer/resources/man/" />
1653        </copy>
1654    </target>
1655
1656    <target name="truncatehistory">
1657        <copy file="history.txt" todir="pkg-temp/" />
1658        <!-- the following overwrites history.txt on unix to shrink the update file -->
1659        <copy file="history.txt" tofile="pkg-temp/history.txt" overwrite="true">
1660            <filterchain>
1661                <headfilter lines="1500" />
1662            </filterchain>
1663        </copy>
1664        <concat append="true" destfile="pkg-temp/history.txt">&#10;&#10;----------------&#10;&#10;EARLIER HISTORY IS AVAILABLE IN THE SOURCE PACKAGE</concat>
1665    </target>
1666
1667    <target name="prepupdateSmall" depends="buildSmall, prepupdateRouter, prepjupdatefixes, prepthemeupdates">
1668        <copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
1669        <copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
1670        <copy file="build/streaming.jar" todir="pkg-temp/lib/" />
1671        <copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
1672        <!-- Updated in 0.9.28 -->
1673        <!-- name without version so we can overwrite if we upgrade  -->
1674        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
1675        <copy file="build/i2ptunnel.war" todir="pkg-temp/webapps/" />
1676        <copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
1677        <copy file="build/addressbook.jar" todir="pkg-temp/lib/" />
1678        <copy file="build/addressbook.war" todir="pkg-temp/webapps/" />
1679        <!-- decapitalized the file in 0.7.8 -->
1680        <copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
1681        <!-- small enough to include for now -->
1682        <copy file="installer/resources/geoipv6.dat.gz" todir="pkg-temp/geoip/" />
1683        <copy file="installer/resources/continents.txt" todir="pkg-temp/geoip/" />
1684      <!--
1685        <copy file="installer/resources/public-suffix-list.txt" todir="pkg-temp/geoip/" />
1686       -->
1687    </target>
1688
1689    <target name="prepupdateRouter" depends="buildrouter, deletepkg-temp">
1690        <copy file="build/i2p.jar" todir="pkg-temp/lib/" />
1691        <copy file="build/router.jar" todir="pkg-temp/lib/" />
1692    </target>
1693
1694    <!-- jbigi.jar -->
1695    <target name="prepjbigiupdate" depends="jbigi">
1696        <copy file="build/jbigi.jar" todir="pkg-temp/lib/" />
1697    </target>
1698
1699    <!-- GeoIP files -->
1700    <target name="prepgeoupdate" depends="prepgeoupdate-unlesspkg" >
1701        <copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
1702        <copy file="installer/resources/continents.txt" todir="pkg-temp/geoip/" />
1703      <!--
1704        <copy file="installer/resources/public-suffix-list.txt" todir="pkg-temp/geoip/" />
1705       -->
1706    </target>
1707
1708    <!-- GeoIP files, set withGeoIPDatabase=true in override.properties to prevent -->
1709    <!-- As of 0.9.26, the files are not included in Debian/Ubuntu builds. -->
1710    <target name="prepgeoupdate-unlesspkg" unless="${with-geoip-database}" >
1711        <copy file="installer/resources/geoip.txt" todir="pkg-temp/geoip/" />
1712        <copy file="installer/resources/geoipv6.dat.gz" todir="pkg-temp/geoip/" />
1713    </target>
1714
1715    <!-- All jetty jars required for update.
1716         TODO do we need to bother updating jasper?
1717      -->
1718    <target name="prepjupdate" depends="prepupdate, buildWEB">
1719        <copy todir="pkg-temp/lib" >
1720            <fileset dir="build" includes="commons*.jar jasper*.jar javax*.jar jetty*.jar jsp*.jar org.mortbay.*.jar" />
1721        </copy>
1722        <!--  We have to package the new eepsite files for MigrateJetty.java, but we
1723              can't overwrite an existing eepsite dir in a non-split configuration.
1724          -->
1725        <copy todir="pkg-temp/eepsite-jetty9" >
1726            <fileset dir="installer/resources/eepsite" includes="*.xml contexts/* etc/*" />
1727        </copy>
1728    </target>
1729
1730    <target name="delete-j6-update">
1731        <delete dir="pkg-temp/eepsite-jetty9" />
1732    </target>
1733
1734    <!-- Jetty 6 I2P logging addons, not really fixes -->
1735    <target name="prepjupdatefixes" depends="buildWEB">
1736        <copy file="build/jetty-i2p.jar" todir="pkg-temp/lib/" />
1737    </target>
1738
1739    <target name="util-list-changes" depends="checkForMtn" if="mtn.available" >
1740        <exec executable="mtn" outputproperty="workspace.changes.util" errorproperty="mtn.error.util" failifexecutionfails="false" >
1741            <arg value="list" />
1742            <arg value="changed" />
1743            <arg value="core/java/src/net/i2p/util" />
1744        </exec>
1745        <!-- \n in an attribute value generates an invalid manifest -->
1746        <exec executable="tr" inputstring="${workspace.changes.util}" outputproperty="workspace.changes.util.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
1747            <arg value="-s" />
1748            <arg value="[:space:]" />
1749            <arg value="," />
1750        </exec>
1751    </target>
1752
1753    <target name="izpack-patches" >
1754            <taskdef name="izpack"
1755                     classpath="${basedir}/installer/lib/izpack/patches.jar:${basedir}/installer/lib/izpack/standalone-compiler.jar"
1756                     classname="com.izforge.izpack.ant.IzPackTask" />
1757        <jar destfile="${basedir}/installer/lib/izpack/patches.jar"
1758             basedir="${basedir}/installer/lib/izpack/patches" />
1759    </target>
1760
1761    <target name="buildUtilityJar" depends="buildCore">
1762        <ant dir="installer/java" target="build" />
1763    </target>
1764
1765    <!-- IzPack 4 -->
1766    <target name="installer" depends="preppkg, buildProperties, util-list-changes, izpack-patches, buildUtilityJar" >
1767        <izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
1768        <ant target="installerexe" />
1769    </target>
1770
1771    <!-- IzPack 5 -->
1772    <target name="ensureIzpack5" >
1773        <!-- set if unset -->
1774        <property name="izpack5.home" value="${user.home}/IzPack" />
1775        <condition property="izpack5.available" >
1776            <available file="${izpack5.home}" type="dir" />
1777        </condition>
1778        <fail message="Error - IzPack 5.1.x must be installed at ${izpack5.home}, or set izpack5.home=/PATH/TO/IzPack in override.properties, or download from http://izpack.org/downloads/ and install" >
1779            <condition>
1780                <not>
1781                    <isset property="izpack5.available" />
1782                </not>
1783            </condition>
1784        </fail>
1785        <path id="izpack5.lib.path">
1786            <fileset dir="${izpack5.home}/lib" includes="*.jar"/>
1787        </path>
1788        <taskdef name="izpack5"
1789                 classpathref="izpack5.lib.path"
1790                 classname="com.izforge.izpack.ant.IzPackTask" />
1791    </target>
1792
1793    <target name="installer5" depends="ensureIzpack5, preppkg, buildProperties, util-list-changes, buildUtilityJar" >
1794        <izpack5 input="${basedir}/installer/install5.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
1795        <ant target="installerexe" />
1796    </target>
1797
1798    <!-- this makes i2pinstall.exe from install.jar -->
1799    <target name="installerexe" depends="launch4j" unless="noExe">
1800        <echo message="See the file &quot;build.properties&quot; if this step fails." />
1801        <!-- now the installer exe -->
1802        <launch4j configFile="./installer/i2pinstaller.xml" />
1803        <!-- thazzit -->
1804    </target>
1805
1806    <!-- Custom installers -->
1807    <target name="installer-nowindows" depends="clean, preppkg-nowindows, izpack-patches" >
1808        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1809        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}.jar" installerType="standard" basedir="${basedir}" />
1810    </target>
1811
1812
1813    <target name="installer-freebsd" depends="clean, preppkg-freebsd-only, izpack-patches" >
1814        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1815        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_freebsd-only.jar" installerType="standard" basedir="${basedir}" />
1816    </target>
1817
1818    <target name="installer-linux" depends="clean, preppkg-linux-only, izpack-patches" >
1819        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1820        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_linux-only.jar" installerType="standard" basedir="${basedir}" />
1821    </target>
1822
1823
1824    <target name="installer-osx" depends="clean, checkForIzpack2App, preppkg-osx-only, izpack-patches">
1825        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1826        <mkdir dir="pkg-temp/osx" />
1827        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_osx-only.jar" installerType="standard" basedir="${basedir}" />
1828        <ant target="installer2app" />
1829        <delete dir="pkg-temp/osx" />
1830    </target>
1831
1832    <target name="checkForIzpack2App">
1833        <!-- we'll set the izpack2app binary name if it's not been set elsewhere yet -->
1834        <property name="izpack2app.binary" value="${user.home}/IzPack/utils/wrappers/izpack2app/izpack2app.py" />
1835        <available property="izpack2app.available" file="${izpack2app.binary}" />
1836    </target>
1837
1838    <target name="installer2app" if="izpack2app.available">
1839        <mkdir dir="pkg-temp/osx" />
1840        <exec executable="python" failonerror="true">
1841            <arg value="${izpack2app.binary}" />
1842            <arg value="${basedir}/i2pinstall_${full.version}_osx-only.jar" />
1843            <arg value="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" />
1844        </exec>
1845
1846        <tar longfile="gnu" destfile="${basedir}/i2pinstall_${full.version}_osx.tar.bz2" compression="bzip2">
1847            <tarfileset dir="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" prefix="/i2p-${full.version}_osx-install.app" filemode="644">
1848                <include name="**/**" />
1849                <exclude name="Contents/MacOS/*" />
1850            </tarfileset>
1851            <tarfileset dir="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" prefix="/i2p-${full.version}_osx-install.app" filemode="755">
1852                <include name="Contents/MacOS/*" />
1853            </tarfileset>
1854        </tar>
1855    </target>
1856
1857    <!-- call between installer-xxx and installer-windows -->
1858    <target name="delete-nonwindows">
1859        <delete dir="pkg-temp/lib/wrapper/" />
1860        <delete dir="pkg-temp/locale/" />
1861        <delete dir="pkg-temp/man/" />
1862        <delete dir="pkg-temp/Start I2P Router.app/" />
1863        <delete dir="pkg-temp" includes="eepget i2prouter INSTALL-headless.txt osid postinstall.sh runplain.sh" />
1864    </target>
1865
1866    <!-- IzPack 4 -->
1867    <target name="installer-windows" depends="clean, preppkg-windows-only, util-list-changes, izpack-patches, buildUtilityJar" >
1868        <fixcrlf srcdir="pkg-temp" includes="*.config *.bat *.cmd **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="crlf"/>
1869        <izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
1870        <ant target="installerexe" />
1871        <delete file="${basedir}/install.jar" />
1872        <move file="${basedir}/i2pinstall.exe" tofile="${basedir}/i2pinstall_${full.version}_windows.exe" />
1873    </target>
1874
1875    <!-- IzPack 5 -->
1876    <target name="installer5-windows" depends="ensureIzpack5, clean, preppkg-windows-only, util-list-changes, buildUtilityJar" >
1877        <fixcrlf srcdir="pkg-temp" includes="*.config *.bat *.cmd **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="crlf"/>
1878        <izpack5 input="${basedir}/installer/install5.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
1879        <ant target="installerexe" />
1880        <delete file="${basedir}/install.jar" />
1881        <move file="${basedir}/i2pinstall.exe" tofile="${basedir}/i2pinstall_${full.version}_windows.exe" />
1882    </target>
1883
1884    <!-- this is broken as installer-xxx targets may delete (or not delete) things in pkg-temp -->
1885    <target name="installer-all" depends="installer-freebsd, installer-linux, installer-osx, installer-windows, installer-nowindows, installer" >
1886    </target>
1887    <!-- end custom installers -->
1888
1889    <!-- unit tests -->
1890    <target name="buildTest">
1891        <ant dir="core/java/" target="jarTest" />
1892        <ant dir="router/java/" target="jarTest" />
1893        <copy file="core/java/build/i2ptest.jar" todir="build" />
1894        <copy file="router/java/build/routertest.jar" todir="build" />
1895        <!-- broken -->
1896      <!--
1897        <ant dir="apps/ministreaming/java/" target="junit.compileTest" />
1898        <ant dir="apps/streaming/java/" target="junit.compileTest" />
1899       -->
1900    </target>
1901    <target name="prepTest" depends="prepupdate, buildTest">
1902        <!-- overwrite i2p.jar and router.jar with the test versions -->
1903        <copy file="build/i2ptest.jar" tofile="pkg-temp/lib/i2p.jar" overwrite="true" />
1904        <copy file="build/routertest.jar" tofile="pkg-temp/lib/router.jar" overwrite="true" />
1905    </target>
1906    <target name="updateTest" depends="prepTest, zipit" />
1907    <target name="junit.test" depends="buildProperties, jbigi" >
1908        <ant dir="core/java/" target="junit.test" />
1909        <ant dir="router/java/" target="junit.test" />
1910        <ant dir="apps/ministreaming/java/" target="junit.test" />
1911        <ant dir="apps/streaming/java/" target="junit.test" />
1912    </target>
1913    <target name="scalatest.test" depends="buildProperties, jbigi" >
1914        <ant dir="core/java/" target="scalatest.test" />
1915        <!-- note there are no router scala tests yet -->
1916        <ant dir="router/java/" target="scalatest.test" />
1917    </target>
1918    <!-- both junit and scala -->
1919    <target name="test" depends="testCore, testRouter, testMinistreaming, testStreaming" />
1920    <target name="testCore" depends="buildProperties, jbigi" >
1921        <ant dir="core/java/" target="test" />
1922    </target>
1923    <target name="testRouter" depends="buildProperties, jbigi" >
1924        <ant dir="router/java/" target="test" />
1925    </target>
1926    <target name="testMinistreaming" depends="buildProperties, jbigi" >
1927        <ant dir="apps/ministreaming/java/" target="test" />
1928    </target>
1929    <target name="testStreaming" depends="buildProperties" >
1930        <ant dir="apps/streaming/java/" target="test" />
1931    </target>
1932    <target name="scalatest.report" depends="buildProperties" >
1933        <ant dir="core/java/" target="scalatest.report" />
1934        <ant dir="router/java/" target="scalatest.report" />
1935    </target>
1936    <target name="junit.report" depends="buildProperties" >
1937        <ant dir="core/java/" target="junit.report" />
1938        <ant dir="router/java/" target="junit.report" />
1939        <ant dir="apps/ministreaming/java/" target="junit.report" />
1940        <ant dir="apps/streaming/java/" target="junit.report" />
1941    </target>
1942    <target name="clover.report" depends="buildProperties" if="with.clover">
1943        <ant dir="core/java/" target="clover.report" />
1944        <ant dir="router/java/" target="clover.report" />
1945        <ant dir="apps/ministreaming/java" target="clover.report" />
1946        <ant dir="apps/streaming/java" target="clover.report" />
1947    </target>
1948    <target name="cobertura.report" depends="buildProperties" if="with.cobertura">
1949        <ant dir="core/java/" target="cobertura.report" />
1950        <ant dir="router/java/" target="cobertura.report" />
1951        <ant dir="apps/ministreaming/java" target="cobertura.report" />
1952        <ant dir="apps/streaming/java" target="cobertura.report" />
1953    </target>
1954    <target name="test.report" depends="junit.report, scalatest.report, clover.report, cobertura.report"/>
1955    <target name="fulltest" depends="buildProperties, jbigi" >
1956        <ant dir="core/java/" target="fulltest" />
1957        <ant dir="router/java/" target="fulltest" />
1958        <ant dir="apps/ministreaming/java" target="fulltest" />
1959        <ant dir="apps/streaming/java" target="fulltest" />
1960    </target>
1961    <target name="jenkins.cobertura.report" depends="cobertura.report">
1962        <!--
1963             The jenkins cobertura plugin couldn't find the source files.
1964         -->
1965        <replaceregexp byline="true" file="reports/core/cobertura/coverage.xml"
1966            match='filename="net' replace='filename="core/java/src/net'/>
1967        <replaceregexp byline="true" file="reports/core/cobertura/coverage.xml"
1968            match="&lt;source&gt;./src" replace='&lt;source&gt;./core/java/src'/>
1969
1970        <replaceregexp byline="true" file="reports/router/cobertura/coverage.xml"
1971            match='filename="net' replace='filename="router/java/src/net'/>
1972        <replaceregexp byline="true" file="reports/router/cobertura/coverage.xml"
1973            match="&lt;source&gt;./src" replace="&lt;source&gt;router/java/src"/>
1974
1975        <replaceregexp byline="true" file="reports/ministreaming/cobertura/coverage.xml"
1976            match='filename="net' replace='filename="apps/ministreaming/java/src/net'/>
1977        <replaceregexp byline="true" file="reports/ministreaming/cobertura/coverage.xml"
1978            match="&lt;source&gt;./src" replace="&lt;source&gt;apps/ministreaming/java/src"/>
1979
1980        <replaceregexp byline="true" file="reports/streaming/cobertura/coverage.xml"
1981            match='filename="net' replace='filename="apps/streaming/java/src/net'/>
1982        <replaceregexp byline="true" file="reports/streaming/cobertura/coverage.xml"
1983            match="&lt;source&gt;./src" replace="&lt;source&gt;apps/streaming/java/src"/>
1984    </target>
1985    <!-- end unit tests -->
1986
1987    <target name="testscripts" >
1988        <exec executable="tests/scripts/checkcerts.sh" failonerror="true" />
1989        <exec executable="tests/scripts/checkpo.sh" failonerror="true" />
1990        <exec executable="tests/scripts/checkutf8.sh" failonerror="true" />
1991        <exec executable="tests/scripts/checkxml.sh" failonerror="true" />
1992        <exec executable="tests/scripts/checkscripts.sh" failonerror="true" />
1993    </target>
1994
1995
1996    <target name="testscripts-net" >
1997        <exec executable="tests/scripts/checkremotecerts.sh" failonerror="true" />
1998    </target>
1999
2000    <target name="testscripts-all" depends="testscripts,testscripts-net" />
2001
2002    <target name="bench" depends="jbigi" >
2003        <ant dir="core/java/" target="bench.jar" />
2004    </target>
2005
2006    <!-- <target name="syndie" >
2007        <ant dir="apps/syndie/java/" target="standalone" />
2008        <copy file="apps/syndie/java/syndie-standalone.zip" todir="." />
2009    </target> -->
2010
2011    <!-- standalone i2psnark zip -->
2012    <target name="i2psnark" depends="buildStreaming, buildJetty, buildSystray" >
2013        <ant dir="apps/i2psnark/java" target="standalone" />
2014        <copy file="apps/i2psnark/java/i2psnark-standalone.zip" todir="." />
2015    </target>
2016
2017    <target name="slackpkg">
2018        <ant dir="Slackware/i2p/" target="slackpkg" />
2019    </target>
2020    <target name="justBOB" depends="builddepSmall, jbigi">
2021        <ant dir="apps/BOB/" target="onejar" />
2022        <copy file="apps/BOB/dist/BOB-one.jar" todir="." />
2023    </target>
2024
2025    <target name="sloccount.report">
2026        <property name="sloccount.report.file" value="sloccount.sc" />
2027        <echo message="Generating sloccount report (this will take awhile)" />
2028        <exec executable="sloccount" failonerror="true">
2029            <arg value="--details"/>
2030            <arg value="--wide"/>
2031            <arg value="${basedir}"/>
2032            <redirector output="${sloccount.report.file}">
2033                <outputfilterchain>
2034                    <linecontainsregexp negate="true">
2035                        <regexp pattern="(Warning: |lib/launch4j|_MTN|reports|pkg-temp|licenses|i2p\.fba|gmp-|WEB-INF)" />
2036                    </linecontainsregexp>
2037                    <linecontains negate="true">
2038                        <contains value="${sloccount.report.file}" />
2039                    </linecontains>
2040                </outputfilterchain>
2041            </redirector>
2042        </exec>
2043        <echo message="sloccount report saved to the file &quot;${sloccount.report.file}&quot;" />
2044    </target>
2045
2046    <target name="findbugs" depends="build2, buildUtilityJar">
2047        <echo message="Starting findbugs, this will take a while..." />
2048        <exec executable="nice" failonerror="true">
2049            <arg value="findbugs"/>
2050            <arg value="-textui"/>
2051            <arg value="-projectName"/>
2052            <arg value="i2p"/>
2053            <arg value="-sortByClass"/>
2054            <arg value="-xml"/>
2055            <arg value="-output"/>
2056            <arg value="i2p.fba"/>
2057            <arg value="-auxclasspath"/>
2058            <arg value="build/commons-el.jar:build/jasper-runtime.jar:build/javax.servlet.jar:build/org.mortbay.jetty.jar:apps/jrobin/jrobin-1.5.9.1.jar:installer/lib/wrapper/all/wrapper.jar:apps/susidns/src/lib/standard.jar:apps/susidns/src/lib/jstl.jar:apps/jrobin/jrobin-1.5.9.1.jar"/>
2059            <arg value="-sourcepath"/>
2060            <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"/>
2061            <!-- start of the files to be analyzed -->
2062            <arg value="build/BOB.jar"/>
2063            <arg value="build/addressbook.jar"/>
2064            <arg value="build/i2p.jar"/>
2065            <arg value="build/i2psnark.jar"/>
2066            <arg value="build/i2psnark.war"/>
2067            <arg value="build/i2ptunnel.jar"/>
2068            <arg value="build/i2ptunnel.war"/>
2069            <arg value="build/imagegen.war"/>
2070            <arg value="build/jetty-i2p.jar"/>
2071            <arg value="build/mstreaming.jar"/>
2072            <arg value="build/router.jar/"/>
2073            <arg value="build/desktopgui.jar"/>
2074            <arg value="build/routerconsole.jar"/>
2075            <arg value="build/routerconsole.war"/>
2076            <arg value="build/sam.jar"/>
2077            <arg value="build/streaming.jar"/>
2078            <arg value="build/susidns.war"/>
2079            <arg value="build/susimail.war"/>
2080            <arg value="build/systray.jar"/>
2081            <arg value="build/utility.jar"/>
2082        </exec>
2083        <echo message="Findbugs output stored in i2p.fba" />
2084        <echo message="Now run: findbugs i2p.fba" />
2085    </target>
2086
2087    <!-- this is the same dependency as pkg, but with updater200 in the middle,
2088         since preppkg puts too much stuff in pkg-temp -->
2089<!--
2090    <target name="release" depends="distclean, updaterWithJettyFixesAndJbigi , updater200WithJettyFixes, preppkg, installer, getReleaseNumber" >
2091    <target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyAndJbigiRepack, updater200WithJettyAndJbigi, delete-j6-update, installer-nowindows, delete-nonwindows, installer-windows">
2092    <target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyAndGeoIPRepack, updater200WithJettyAndGeoIP, delete-j6-update, installer-nowindows, delete-nonwindows, installer-windows">
2093-->
2094    <target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyRepack, updater200WithJetty, delete-j6-update, installer-nowindows, delete-nonwindows, installer-windows">
2095        <echo message="New version number is ${release.number}" />
2096        <copy file="i2pupdate.zip" tofile="i2pupdate_${release.number}.zip" />
2097        <copy file="i2pinstall_${full.version}.jar" tofile="i2pinstall_${release.number}.jar" />
2098        <copy file="i2pinstall_${full.version}_windows.exe" tofile="i2pinstall_${release.number}_windows.exe" />
2099        <!-- remove these, we don't build them anymore -->
2100        <delete file="i2pupdate.sud" />
2101        <delete file="i2pupdate.su2" />
2102        <!-- make this a lot easier by putting release.privkey.su3=/path/to/su3keystore.ks in override.properties -->
2103
2104        <!-- now build and verify the packed su3 from the packed zip -->
2105        <su3sign infile="i2pupdate200.zip" sigtype="ROUTER" outfile="i2pupdate.su3" su3.ver="${release.number}" />
2106        <!-- this will use the monotonerc file in the current workspace -->
2107        <echo message="Checking out fresh copy into ../i2p-${release.number} for tarballing:" />
2108        <delete dir="../i2p-${release.number}" />
2109        <exec executable="mtn" failonerror="true">
2110            <arg value="co" />
2111            <!-- w: is the revision of the current workspace -->
2112            <arg value="-r" />
2113            <arg value="w:" />
2114            <arg value="../i2p-${release.number}/" />
2115        </exec>
2116        <exec executable="tar" failonerror="true">
2117            <arg value="cjf" />
2118            <arg value="i2psource_${release.number}.tar.bz2" />
2119            <arg value="-C" />
2120            <arg value=".." />
2121            <arg value="--exclude" />
2122            <arg value="i2p-${release.number}/_MTN*" />
2123            <arg value="i2p-${release.number}/" />
2124        </exec>
2125        <echo message="Sign the files:" />
2126        <input message="Enter GPG key ID (e.g. 0x12345678) for signing:" addproperty="release.gpg.keyid" />
2127        <fail message="You must enter a key ID." >
2128            <condition>
2129                <equals arg1="${release.gpg.keyid}" arg2=""/>
2130            </condition>
2131        </fail>
2132
2133        <!-- the gpgsign macro sets the permission of signed files and the sigs themselves to 444 -->
2134        <gpgsign file="i2pinstall_${release.number}_windows.exe" />
2135        <gpgsign file="i2pinstall_${release.number}.jar" />
2136        <gpgsign file="i2psource_${release.number}.tar.bz2" />
2137        <gpgsign file="i2pupdate_${release.number}.zip" />
2138
2139        <chmod perm="444" type="file">
2140            <fileset dir="${basedir}">
2141                <include name="i2pupdate.su3" />
2142            </fileset>
2143        </chmod>
2144        <echo message="File sizes:" />
2145        <exec executable="ls" failonerror="true">
2146            <arg value="-l" />
2147            <arg value="i2pinstall_${release.number}_windows.exe" />
2148            <arg value="i2pinstall_${release.number}.jar" />
2149            <arg value="i2psource_${release.number}.tar.bz2" />
2150            <arg value="i2pupdate_${release.number}.zip" />
2151            <arg value="i2pupdate.su3" />
2152            <arg value="i2pinstall_${release.number}_windows.exe.sig" />
2153            <arg value="i2pinstall_${release.number}.jar.sig" />
2154            <arg value="i2psource_${release.number}.tar.bz2.sig" />
2155            <arg value="i2pupdate_${release.number}.zip.sig" />
2156        </exec>
2157        <echo message="SHA256 sums:" />
2158        <sha256sum file="i2pinstall_${release.number}_windows.exe" />
2159        <sha256sum file="i2pinstall_${release.number}.jar" />
2160        <sha256sum file="i2psource_${release.number}.tar.bz2" />
2161        <sha256sum file="i2pupdate_${release.number}.zip" />
2162        <sha256sum file="i2pupdate.su3" />
2163        <!-- make torrent files -->
2164        <copy file="i2pupdate.su3" tofile="i2pupdate-${release.number}.su3" />
2165        <mktorrent file="i2pupdate-${release.number}.su3" />
2166        <echo message="Don't forget to mtn tag w: i2p-${release.number}" />
2167        <echo message="... and mtn cert t:i2p-${release.number} branch i2p.i2p.release" />
2168    </target>
2169
2170    <target name="mavenCentral.deps" depends="buildRouter, buildStreaming">
2171        <ant dir="core/java/">
2172            <target name="javadocJar" />
2173            <target name="sourcesJar" />
2174        </ant>
2175        <ant dir="router/java/">
2176            <target name="javadocJar" />
2177            <target name="sourcesJar" />
2178        </ant>
2179        <ant dir="apps/ministreaming/java/">
2180            <target name="javadocJar" />
2181            <target name="sourcesJar" />
2182        </ant>
2183        <ant dir="apps/streaming/java/">
2184            <target name="javadocJar" />
2185            <target name="sourcesJar" />
2186        </ant>
2187        <ant dir="apps/jetty/">
2188            <target name="servletJar" />
2189            <target name="servletJavadocJar" />
2190            <target name="servletSourcesJar" />
2191        </ant>
2192    </target>
2193
2194    <target name="mavenCentral" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, mavenCentral.deps">
2195        <mkdir dir="./pkg-mavencentral" />
2196        <!-- Libraries -->
2197        <copy file="build/i2p.jar" tofile="pkg-mavencentral/i2p-${release.number}.jar" />
2198        <copy file="build/router.jar" tofile="pkg-mavencentral/router-${release.number}.jar" />
2199        <copy file="build/mstreaming.jar" tofile="pkg-mavencentral/mstreaming-${release.number}.jar" />
2200        <copy file="build/streaming.jar" tofile="pkg-mavencentral/streaming-${release.number}.jar" />
2201        <copy file="apps/jetty/build/servlet-i2p-${release.number}.jar" todir="pkg-mavencentral/" />
2202        <!-- JavaDocs -->
2203        <copy file="core/java/build/i2p-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
2204        <copy file="router/java/build/router-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
2205        <copy file="apps/ministreaming/java/build/mstreaming-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
2206        <copy file="apps/streaming/java/build/streaming-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
2207        <copy file="apps/jetty/build/servlet-i2p-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
2208        <!-- Sources -->
2209        <copy file="core/java/build/i2p-${release.number}-sources.jar" todir="pkg-mavencentral/" />
2210        <copy file="router/java/build/router-${release.number}-sources.jar" todir="pkg-mavencentral/" />
2211        <copy file="apps/ministreaming/java/build/mstreaming-${release.number}-sources.jar" todir="pkg-mavencentral/" />
2212        <copy file="apps/streaming/java/build/streaming-${release.number}-sources.jar" todir="pkg-mavencentral/" />
2213        <copy file="apps/jetty/build/servlet-i2p-${release.number}-sources.jar" todir="pkg-mavencentral/" />
2214        <!-- POMs -->
2215        <artifact:pom id="i2ppom" groupId="net.i2p" artifactId="i2p" version="${release.number}"
2216                name="I2P Core"
2217                description="The core I2P APIs"
2218                url="https://geti2p.net/">
2219            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
2220            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
2221            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/"/>
2222            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
2223                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
2224                 url="git@github.com:i2p/i2p.i2p.git" />
2225        </artifact:pom>
2226        <artifact:pom id="routerpom" groupId="net.i2p" artifactId="router" version="${release.number}"
2227                name="I2P Router"
2228                description="The I2P router"
2229                url="https://geti2p.net/">
2230            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
2231            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
2232            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/"/>
2233            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
2234                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
2235                 url="git@github.com:i2p/i2p.i2p.git" />
2236            <dependency groupId="net.i2p" artifactId="i2p" version="${release.number}" />
2237        </artifact:pom>
2238        <artifact:pom id="mstreamingpom" groupId="net.i2p.client" artifactId="mstreaming" version="${release.number}"
2239                name="I2P Ministreaming"
2240                description="API, interfaces, and factory for a TCP-like set of sockets for communicating over I2P."
2241                url="https://geti2p.net/en/docs/api/streaming">
2242            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
2243            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
2244            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/" />
2245            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
2246                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
2247                 url="git@github.com:i2p/i2p.i2p.git" />
2248            <dependency groupId="net.i2p" artifactId="i2p" version="${release.number}" />
2249        </artifact:pom>
2250        <artifact:pom id="streamingpom" groupId="net.i2p.client" artifactId="streaming" version="${release.number}"
2251                name="I2P Streaming"
2252                description="Implementation of a TCP-like set of sockets for communicating over I2P."
2253                url="https://geti2p.net/en/docs/api/streaming">
2254            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
2255            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
2256            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/" />
2257            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
2258                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
2259                 url="git@github.com:i2p/i2p.i2p.git" />
2260            <dependency groupId="net.i2p" artifactId="i2p" version="${release.number}" />
2261            <dependency groupId="net.i2p.client" artifactId="mstreaming" version="${release.number}" />
2262        </artifact:pom>
2263        <artifact:pom id="servletpom" groupId="net.i2p" artifactId="servlet-i2p" version="${release.number}"
2264                name="I2P Servlet classes"
2265                description="Various servlet classes provided to plugins by Java I2P."
2266                url="https://geti2p.net/">
2267            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
2268            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
2269            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/" />
2270            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
2271                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
2272                 url="git@github.com:i2p/i2p.i2p.git" />
2273            <dependency groupId="net.i2p" artifactId="i2p" version="${release.number}" />
2274            <dependency groupId="org.apache.tomcat" artifactId="tomcat-servlet-api" version="8.0.33" />
2275        </artifact:pom>
2276        <artifact:writepom pomRefId="i2ppom" file="pkg-mavencentral/i2p-${release.number}.pom"/>
2277        <artifact:writepom pomRefId="routerpom" file="pkg-mavencentral/router-${release.number}.pom"/>
2278        <artifact:writepom pomRefId="mstreamingpom" file="pkg-mavencentral/mstreaming-${release.number}.pom" />
2279        <artifact:writepom pomRefId="streamingpom" file="pkg-mavencentral/streaming-${release.number}.pom" />
2280        <artifact:writepom pomRefId="servletpom" file="pkg-mavencentral/servlet-i2p-${release.number}.pom" />
2281        <!-- Signatures -->
2282        <echo message="Sign the files:" />
2283        <input message="Enter GPG key ID (e.g. 0x12345678) for signing:" addproperty="release.gpg.keyid" />
2284        <fail message="You must enter a key ID." >
2285            <condition>
2286                <equals arg1="${release.gpg.keyid}" arg2=""/>
2287            </condition>
2288        </fail>
2289        <!-- the gpgsign macro sets the permission of signed files and the sigs themselves to 444 -->
2290        <gpgsignasc file="pkg-mavencentral/i2p-${release.number}.jar" />
2291        <gpgsignasc file="pkg-mavencentral/i2p-${release.number}.pom" />
2292        <gpgsignasc file="pkg-mavencentral/i2p-${release.number}-javadoc.jar" />
2293        <gpgsignasc file="pkg-mavencentral/i2p-${release.number}-sources.jar" />
2294        <gpgsignasc file="pkg-mavencentral/router-${release.number}.jar" />
2295        <gpgsignasc file="pkg-mavencentral/router-${release.number}.pom" />
2296        <gpgsignasc file="pkg-mavencentral/router-${release.number}-javadoc.jar" />
2297        <gpgsignasc file="pkg-mavencentral/router-${release.number}-sources.jar" />
2298        <gpgsignasc file="pkg-mavencentral/mstreaming-${release.number}.jar" />
2299        <gpgsignasc file="pkg-mavencentral/mstreaming-${release.number}.pom" />
2300        <gpgsignasc file="pkg-mavencentral/mstreaming-${release.number}-javadoc.jar" />
2301        <gpgsignasc file="pkg-mavencentral/mstreaming-${release.number}-sources.jar" />
2302        <gpgsignasc file="pkg-mavencentral/streaming-${release.number}.jar" />
2303        <gpgsignasc file="pkg-mavencentral/streaming-${release.number}.pom" />
2304        <gpgsignasc file="pkg-mavencentral/streaming-${release.number}-javadoc.jar" />
2305        <gpgsignasc file="pkg-mavencentral/streaming-${release.number}-sources.jar" />
2306        <gpgsignasc file="pkg-mavencentral/servlet-i2p-${release.number}.jar" />
2307        <gpgsignasc file="pkg-mavencentral/servlet-i2p-${release.number}.pom" />
2308        <gpgsignasc file="pkg-mavencentral/servlet-i2p-${release.number}-javadoc.jar" />
2309        <gpgsignasc file="pkg-mavencentral/servlet-i2p-${release.number}-sources.jar" />
2310        <!-- Bundle -->
2311        <jar destfile="mavencentral-i2p.jar">
2312            <fileset dir="./pkg-mavencentral">
2313                <include name="i2p-*" />
2314            </fileset>
2315        </jar>
2316        <jar destfile="mavencentral-router.jar">
2317            <fileset dir="./pkg-mavencentral">
2318                <include name="router-*" />
2319            </fileset>
2320        </jar>
2321        <jar destfile="mavencentral-mstreaming.jar">
2322            <fileset dir="./pkg-mavencentral">
2323                <include name="mstreaming-*" />
2324            </fileset>
2325        </jar>
2326        <jar destfile="mavencentral-streaming.jar">
2327            <fileset dir="./pkg-mavencentral">
2328                <include name="streaming-*" />
2329            </fileset>
2330        </jar>
2331        <jar destfile="mavencentral-servlet-i2p.jar">
2332            <fileset dir="./pkg-mavencentral">
2333                <include name="servlet-i2p-*" />
2334            </fileset>
2335        </jar>
2336        <echo message="Now upload mavencentral-*.jar to Maven Central." />
2337    </target>
2338
2339    <target name="debian" depends="debian-clean, debchange, debian-binary" />
2340
2341    <target name="getExtendedVersion" depends="buildProperties, trimMtnRev">
2342        <property name="MtnShortHash" value="unknown" />
2343        <condition property="Extended.Version" value="${full.version}-${MtnShortHash}">
2344            <not>
2345                <or>
2346                    <equals arg1="${MtnShortHash}" arg2="" />
2347                    <equals arg1="${MtnShortHash}" arg2="unknown" />
2348                </or>
2349            </not>
2350        </condition>
2351        <!-- if not set above we'll set it here -->
2352        <property name="Extended.Version" value="${full.version}" />
2353    </target>
2354
2355    <target name="debchange" depends="getExtendedVersion" unless="noAutoDebchange">
2356        <echo message= "Debian version is ${Extended.Version}-1" />
2357        <exec executable="dch" failonerror="true">
2358            <arg value="-b" />
2359            <arg value="--check-dirname-level" />
2360            <arg value="0" />
2361            <arg value="-v" />
2362            <arg value="${Extended.Version}-1" />
2363            <arg value="Unofficial Debian package built using &quot;ant debian&quot;" />
2364        </exec>
2365    </target>
2366
2367    <target name="debian-binary" depends="getExtendedVersion">
2368        <exec executable="fakeroot" failonerror="true">
2369            <arg value="debian/rules" />
2370            <arg value="patch" />
2371            <arg value="binary" />
2372            <arg value="clean" />
2373        </exec>
2374        <delete dir=".pc" />
2375        <move todir=".">
2376            <fileset dir=".." includes="libjbigi*${release.number}*.deb i2p*${release.number}*.deb" />
2377        </move>
2378        <echo message="" />
2379        <echo message="====================" />
2380        <echo message="Packages have been built and moved to ${basedir}" />
2381        <echo message="====================" />
2382    </target>
2383
2384    <target name="debian-clean" depends="getExtendedVersion" >
2385        <exec executable="fakeroot" failonerror="true">
2386            <arg value="debian/rules" />
2387            <arg value="clean" />
2388        </exec>
2389        <delete dir="./.pc" />
2390    </target>
2391
2392    <!-- stretch+, zesty+ -->
2393    <target name="debian-tarball" depends="getExtendedVersion, failIfNoMtn">
2394        <!-- this will use the monotonerc file in the current workspace -->
2395        <property name="debian.tarball.name" value="i2p_${Extended.Version}.orig.tar.bz2" />
2396        <echo message="Checking out fresh copy into ../i2p-${Extended.Version} for tarballing:" />
2397        <delete dir="../i2p-${Extended.Version}" />
2398        <exec executable="mtn" failonerror="true">
2399            <arg value="co" />
2400            <!-- w: is the revision of the current workspace -->
2401            <arg value="-r" />
2402            <arg value="w:" />
2403            <arg value="../i2p-${Extended.Version}" />
2404        </exec>
2405        <delete includeemptydirs="true" quiet="false" failonerror="false">
2406            <fileset dir="../i2p-${Extended.Version}/debian-alt/" />
2407            <fileset dir="../i2p-${Extended.Version}/installer/" includes="*.xml" />
2408            <fileset dir="../i2p-${Extended.Version}/installer/c/" />
2409            <fileset dir="../i2p-${Extended.Version}/installer/doc/" />
2410            <fileset dir="../i2p-${Extended.Version}/installer/lib/" />
2411            <fileset dir="../i2p-${Extended.Version}/installer/resources" includes="checklist.md deletelist.txt install_* geoipv6-extras.csv makegeoip* po4a.config uninstall_* *.bat net.i2p.router.plist.template" />
2412            <fileset dir="../i2p-${Extended.Version}/installer/resources/Start I2P Router.app/" />
2413            <fileset dir="../i2p-${Extended.Version}/installer/resources/portable/" />
2414            <fileset dir="../i2p-${Extended.Version}/installer/resources/small/" />
2415            <fileset dir="../i2p-${Extended.Version}/Slackware" />
2416            <fileset dir="../i2p-${Extended.Version}/_MTN" />
2417            <fileset dir="../i2p-${Extended.Version}/.idea" />
2418            <fileset dir="../i2p-${Extended.Version}/.tx" />
2419            <file name="../i2p-${Extended.Version}/.mtn-ignore" />
2420            <fileset dir="../i2p-${Extended.Version}/" includes="Docker*" />
2421            <file name="../i2p-${Extended.Version}/Makefile.gcj" />
2422            <fileset dir="../i2p-${Extended.Version}/docs" />
2423            <fileset dir="../i2p-${Extended.Version}/launchers" />
2424            <file name="../i2p-${Extended.Version}/.travis.yml" />
2425            <file name="../i2p-${Extended.Version}/.gitignore" />
2426            <!-- gradle files -->
2427            <fileset dir="../i2p-${Extended.Version}/" includes="**/build.gradle" />
2428            <fileset dir="../i2p-${Extended.Version}/gradle" />
2429            <file name="../i2p-${Extended.Version}/gradlew" />
2430            <file name="../i2p-${Extended.Version}/gradlew.bat" />
2431            <file name="../i2p-${Extended.Version}/gradle.properties" />
2432            <file name="../i2p-${Extended.Version}/settings.gradle" />
2433            <!-- gettext-base -->
2434            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/gettext" />
2435            <!-- libgetopt-java -->
2436            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/getopt" />
2437            <!-- libhttpclient-java and libhttpcore-java -->
2438          <!--
2439            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/apache/http" />
2440           -->
2441            <!-- geoip-database -->
2442            <file name="../i2p-${Extended.Version}/installer/resources/geoip.txt" />
2443            <file name="../i2p-${Extended.Version}/installer/resources/geoipv6.dat.gz" />
2444            <!-- libjetty9-java -->
2445            <fileset dir="../i2p-${Extended.Version}/apps/jetty/jetty-distribution-${jetty.ver}" />
2446            <!-- libtomcat8-java -->
2447            <fileset dir="../i2p-${Extended.Version}/apps/jetty/apache-tomcat-${tomcat.ver}" />
2448            <!-- libjstl1.1-java or glassfish-javaee or libtaglibs-standard -->
2449            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/jstl.jar" />
2450            <!-- libjakarta-taglibs-standard-java or glassfish-javaee or libtaglibs-standard -->
2451            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/standard.jar" />
2452            <fileset dir="../i2p-${Extended.Version}/installer/resources/icons/flags" />
2453            <!-- anything added above, add in debian-release-tarball also -->
2454        </delete>
2455        <tar longfile="gnu" destfile="../${debian.tarball.name}" compression="bzip2">
2456            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${Extended.Version}">
2457                <include name="**/**" />
2458                <exclude name="debian/**"/>
2459                <exclude name="**/*.sh"/>
2460                <!-- anything added above, add in debian-release-tarball also -->
2461            </tarfileset>
2462            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${Extended.Version}" filemode="755">
2463                <exclude name="debian/**" />
2464                <include name="**/*.sh" />
2465            </tarfileset>
2466        </tar>
2467    </target>
2468
2469    <!-- same as debian-release-tarball but with bundled jetty
2470      -  We add a 'p' to the release name and tarball since the source package is different;
2471      -  Launchpad does not allow different source packages with the same name.
2472      -->
2473    <target name="precise-release-tarball" depends="getExtendedVersion, failIfNoMtn">
2474        <property name="debian.tarball.name" value="i2p_${release.number}p.orig.tar.bz2" />
2475        <echo message="Checking out fresh copy into ../i2p-${Extended.Version} for tarballing:" />
2476        <delete dir="../i2p-${Extended.Version}" />
2477        <exec executable="mtn" failonerror="true">
2478            <arg value="co" />
2479            <!-- w: is the revision of the current workspace -->
2480            <arg value="-r" />
2481            <arg value="w:" />
2482            <arg value="-b" />
2483            <arg value="i2p.i2p" />
2484            <arg value="../i2p-${Extended.Version}" />
2485        </exec>
2486        <delete includeemptydirs="true" quiet="false" failonerror="false">
2487            <fileset dir="../i2p-${Extended.Version}/debian-alt/" />
2488            <fileset dir="../i2p-${Extended.Version}/installer/" includes="*.xml" />
2489            <fileset dir="../i2p-${Extended.Version}/installer/c/" />
2490            <fileset dir="../i2p-${Extended.Version}/installer/doc/" />
2491            <fileset dir="../i2p-${Extended.Version}/installer/lib/" />
2492            <fileset dir="../i2p-${Extended.Version}/installer/resources" includes="checklist.md deletelist.txt install_* geoipv6-extras.csv makegeoip* po4a.config uninstall_* *.bat net.i2p.router.plist.template" />
2493            <fileset dir="../i2p-${Extended.Version}/installer/resources/Start I2P Router.app/" />
2494            <fileset dir="../i2p-${Extended.Version}/installer/resources/portable/" />
2495            <fileset dir="../i2p-${Extended.Version}/installer/resources/small/" />
2496            <fileset dir="../i2p-${Extended.Version}/Slackware" />
2497            <fileset dir="../i2p-${Extended.Version}/_MTN" />
2498            <fileset dir="../i2p-${Extended.Version}/.idea" />
2499            <fileset dir="../i2p-${Extended.Version}/.tx" />
2500            <file name="../i2p-${Extended.Version}/.mtn-ignore" />
2501            <fileset dir="../i2p-${Extended.Version}/" includes="Docker*" />
2502            <file name="../i2p-${Extended.Version}/Makefile.gcj" />
2503            <fileset dir="../i2p-${Extended.Version}/docs" />
2504            <fileset dir="../i2p-${Extended.Version}/launchers" />
2505            <file name="../i2p-${Extended.Version}/.travis.yml" />
2506            <file name="../i2p-${Extended.Version}/.gitignore" />
2507            <!-- gradle files -->
2508            <fileset dir="../i2p-${Extended.Version}/" includes="**/build.gradle" />
2509            <fileset dir="../i2p-${Extended.Version}/gradle" />
2510            <file name="../i2p-${Extended.Version}/gradlew" />
2511            <file name="../i2p-${Extended.Version}/gradlew.bat" />
2512            <file name="../i2p-${Extended.Version}/gradle.properties" />
2513            <file name="../i2p-${Extended.Version}/settings.gradle" />
2514            <!-- gettext-base -->
2515            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/gettext" />
2516            <!-- libgetopt-java -->
2517            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/getopt" />
2518            <!-- libhttpclient-java and libhttpcore-java -->
2519          <!--
2520            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/apache/http" />
2521           -->
2522            <!-- geoip-database -->
2523            <file name="../i2p-${Extended.Version}/installer/resources/geoip.txt" />
2524            <file name="../i2p-${Extended.Version}/installer/resources/geoipv6.dat.gz" />
2525            <!-- libjetty9-java -->
2526          <!--
2527            <fileset dir="../i2p-${Extended.Version}/apps/jetty/jetty-distribution-${jetty.ver}" />
2528            <fileset dir="../i2p-${Extended.Version}/apps/jetty/apache-tomcat-${tomcat.ver}" />
2529           -->
2530            <!-- libjstl1.1-java or glassfish-javaee -->
2531          <!--
2532            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/jstl.jar" />
2533           -->
2534            <!-- libjakarta-taglibs-standard-java or glassfish-javaee -->
2535            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/standard.jar" />
2536            <!-- famfamfam-flag-png is in trusty but not precise, so leave them in the source package for both -->
2537            <!-- anything added above, add in debian-release-tarball also -->
2538        </delete>
2539        <tar longfile="gnu" destfile="../${debian.tarball.name}" compression="bzip2">
2540            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${Extended.Version}">
2541                <include name="**/**" />
2542                <exclude name="debian/**"/>
2543                <exclude name="**/*.sh"/>
2544                <!-- anything added above, add in debian-release-tarball also -->
2545            </tarfileset>
2546            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${Extended.Version}" filemode="755">
2547                <exclude name="debian/**" />
2548                <include name="**/*.sh" />
2549            </tarfileset>
2550        </tar>
2551    </target>
2552
2553    <!-- xenial/yakkety only -->
2554    <!-- same as debian-release-tarball but with bundled jstl.jar
2555         (there's no libtaglibs-standard-* packages)
2556      -  We add a 'x' to the release name and tarball since the source package is different;
2557      -  Launchpad does not allow different source packages with the same name.
2558      -->
2559    <target name="xenial-release-tarball" depends="getExtendedVersion, failIfNoMtn">
2560        <property name="debian.tarball.name" value="i2p_${release.number}x.orig.tar.bz2" />
2561        <echo message="Checking out fresh copy into ../i2p-${Extended.Version} for tarballing:" />
2562        <delete dir="../i2p-${Extended.Version}" />
2563        <exec executable="mtn" failonerror="true">
2564            <arg value="co" />
2565            <!-- w: is the revision of the current workspace -->
2566            <arg value="-r" />
2567            <arg value="w:" />
2568            <arg value="-b" />
2569            <arg value="i2p.i2p" />
2570            <arg value="../i2p-${Extended.Version}" />
2571        </exec>
2572        <delete includeemptydirs="true" quiet="false" failonerror="false">
2573            <fileset dir="../i2p-${Extended.Version}/debian-alt/" />
2574            <fileset dir="../i2p-${Extended.Version}/installer/" includes="*.xml" />
2575            <fileset dir="../i2p-${Extended.Version}/installer/c/" />
2576            <fileset dir="../i2p-${Extended.Version}/installer/doc/" />
2577            <fileset dir="../i2p-${Extended.Version}/installer/lib/" />
2578            <fileset dir="../i2p-${Extended.Version}/installer/resources" includes="checklist.md deletelist.txt install_* geoipv6-extras.csv makegeoip* po4a.config uninstall_* *.bat net.i2p.router.plist.template" />
2579            <fileset dir="../i2p-${Extended.Version}/installer/resources/Start I2P Router.app/" />
2580            <fileset dir="../i2p-${Extended.Version}/installer/resources/portable/" />
2581            <fileset dir="../i2p-${Extended.Version}/installer/resources/small/" />
2582            <fileset dir="../i2p-${Extended.Version}/Slackware" />
2583            <fileset dir="../i2p-${Extended.Version}/_MTN" />
2584            <fileset dir="../i2p-${Extended.Version}/.idea" />
2585            <fileset dir="../i2p-${Extended.Version}/.tx" />
2586            <file name="../i2p-${Extended.Version}/.mtn-ignore" />
2587            <fileset dir="../i2p-${Extended.Version}/" includes="Docker*" />
2588            <file name="../i2p-${Extended.Version}/Makefile.gcj" />
2589            <fileset dir="../i2p-${Extended.Version}/docs" />
2590            <fileset dir="../i2p-${Extended.Version}/launchers" />
2591            <file name="../i2p-${Extended.Version}/.travis.yml" />
2592            <file name="../i2p-${Extended.Version}/.gitignore" />
2593            <!-- gradle files -->
2594            <fileset dir="../i2p-${Extended.Version}/" includes="**/build.gradle" />
2595            <fileset dir="../i2p-${Extended.Version}/gradle" />
2596            <file name="../i2p-${Extended.Version}/gradlew" />
2597            <file name="../i2p-${Extended.Version}/gradlew.bat" />
2598            <file name="../i2p-${Extended.Version}/gradle.properties" />
2599            <file name="../i2p-${Extended.Version}/settings.gradle" />
2600            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/gettext" />
2601            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/getopt" />
2602          <!--
2603            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/apache/http" />
2604           -->
2605            <file name="../i2p-${Extended.Version}/installer/resources/geoip.txt" />
2606            <file name="../i2p-${Extended.Version}/installer/resources/geoipv6.dat.gz" />
2607            <fileset dir="../i2p-${Extended.Version}/apps/jetty/jetty-distribution-${jetty.ver}" />
2608            <fileset dir="../i2p-${Extended.Version}/apps/jetty/apache-tomcat-${tomcat.ver}" />
2609          <!--
2610            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/jstl.jar" />
2611           -->
2612            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/standard.jar" />
2613            <fileset dir="../i2p-${Extended.Version}/installer/resources/icons/flags" />
2614            <!-- anything added above, add in debian-tarball also -->
2615        </delete>
2616        <tar longfile="gnu" destfile="../${debian.tarball.name}" compression="bzip2">
2617            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${release.number}">
2618                <include name="**/**" />
2619                <exclude name="debian/**"/>
2620                <exclude name="**/*.sh"/>
2621                <!-- anything added above, add in debian-tarball also -->
2622            </tarfileset>
2623            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${release.number}" filemode="755">
2624                <exclude name="debian/**" />
2625                <include name="**/*.sh" />
2626            </tarfileset>
2627        </tar>
2628    </target>
2629
2630    <!-- stretch+, zesty+ -->
2631    <!-- same as debian-tarball but with a release tar.bz2 file name and tar prefix -->
2632    <target name="debian-release-tarball" depends="getExtendedVersion, failIfNoMtn">
2633        <property name="debian.tarball.name" value="i2p_${release.number}.orig.tar.bz2" />
2634        <echo message="Checking out fresh copy into ../i2p-${Extended.Version} for tarballing:" />
2635        <delete dir="../i2p-${Extended.Version}" />
2636        <exec executable="mtn" failonerror="true">
2637            <arg value="co" />
2638            <!-- w: is the revision of the current workspace -->
2639            <arg value="-r" />
2640            <arg value="w:" />
2641            <arg value="-b" />
2642            <arg value="i2p.i2p" />
2643            <arg value="../i2p-${Extended.Version}" />
2644        </exec>
2645        <delete includeemptydirs="true" quiet="false" failonerror="false">
2646            <fileset dir="../i2p-${Extended.Version}/debian-alt/" />
2647            <fileset dir="../i2p-${Extended.Version}/installer/" includes="*.xml" />
2648            <fileset dir="../i2p-${Extended.Version}/installer/c/" />
2649            <fileset dir="../i2p-${Extended.Version}/installer/doc/" />
2650            <fileset dir="../i2p-${Extended.Version}/installer/lib/" />
2651            <fileset dir="../i2p-${Extended.Version}/installer/resources" includes="checklist.md deletelist.txt install_* geoipv6-extras.csv makegeoip* po4a.config uninstall_* *.bat net.i2p.router.plist.template" />
2652            <fileset dir="../i2p-${Extended.Version}/installer/resources/Start I2P Router.app/" />
2653            <fileset dir="../i2p-${Extended.Version}/installer/resources/portable/" />
2654            <fileset dir="../i2p-${Extended.Version}/installer/resources/small/" />
2655            <fileset dir="../i2p-${Extended.Version}/Slackware" />
2656            <fileset dir="../i2p-${Extended.Version}/_MTN" />
2657            <fileset dir="../i2p-${Extended.Version}/.idea" />
2658            <fileset dir="../i2p-${Extended.Version}/.tx" />
2659            <file name="../i2p-${Extended.Version}/.mtn-ignore" />
2660            <fileset dir="../i2p-${Extended.Version}/" includes="Docker*" />
2661            <file name="../i2p-${Extended.Version}/Makefile.gcj" />
2662            <fileset dir="../i2p-${Extended.Version}/docs" />
2663            <fileset dir="../i2p-${Extended.Version}/launchers" />
2664            <file name="../i2p-${Extended.Version}/.travis.yml" />
2665            <file name="../i2p-${Extended.Version}/.gitignore" />
2666            <!-- gradle files -->
2667            <fileset dir="../i2p-${Extended.Version}/" includes="**/build.gradle" />
2668            <fileset dir="../i2p-${Extended.Version}/gradle" />
2669            <file name="../i2p-${Extended.Version}/gradlew" />
2670            <file name="../i2p-${Extended.Version}/gradlew.bat" />
2671            <file name="../i2p-${Extended.Version}/gradle.properties" />
2672            <file name="../i2p-${Extended.Version}/settings.gradle" />
2673            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/gettext" />
2674            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/getopt" />
2675          <!--
2676            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/apache/http" />
2677           -->
2678            <file name="../i2p-${Extended.Version}/installer/resources/geoip.txt" />
2679            <file name="../i2p-${Extended.Version}/installer/resources/geoipv6.dat.gz" />
2680            <fileset dir="../i2p-${Extended.Version}/apps/jetty/jetty-distribution-${jetty.ver}" />
2681            <fileset dir="../i2p-${Extended.Version}/apps/jetty/apache-tomcat-${tomcat.ver}" />
2682            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/jstl.jar" />
2683            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/standard.jar" />
2684            <fileset dir="../i2p-${Extended.Version}/installer/resources/icons/flags" />
2685            <!-- anything added above, add in debian-tarball also -->
2686        </delete>
2687        <tar longfile="gnu" destfile="../${debian.tarball.name}" compression="bzip2">
2688            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${release.number}">
2689                <include name="**/**" />
2690                <exclude name="debian/**"/>
2691                <exclude name="**/*.sh"/>
2692                <!-- anything added above, add in debian-tarball also -->
2693            </tarfileset>
2694            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${release.number}" filemode="755">
2695                <exclude name="debian/**" />
2696                <include name="**/*.sh" />
2697            </tarfileset>
2698        </tar>
2699    </target>
2700
2701    <target name="debian-patch" depends="getExtendedVersion" >
2702        <exec executable="quilt" failonerror="true">
2703            <arg value="-a" />
2704            <arg value="push" />
2705        </exec>
2706        <echo message="====================" />
2707    </target>
2708    <target name="debian-unpatch" depends="buildProperties">
2709        <exec executable="quilt" failonerror="false">
2710            <arg value="-a" />
2711            <arg value="pop" />
2712        </exec>
2713    </target>
2714
2715    <target name="debianrepo" depends="debian">
2716        <exec dir="debian" executable="./makerepo.sh" failonerror="true"/>
2717    </target>
2718
2719<!-- the following are appened to help build barebone portable version,
2720     none of the above is modified for this purpose -->
2721        <target name = "pkg-portable-clean">
2722                <delete dir="build/" />
2723                <delete dir="pkg-temp/" />
2724                <delete>
2725                        <fileset dir="." includes="portable-**.zip**" />
2726                </delete>
2727        </target>
2728<!-- build a portable archive -->
2729
2730<!-- *0* Since we simply pack all files in folder "build/" into our archieve,
2731                we need to make sure its small, with NO redundent jars or wars.
2732                thus cleaning is required before each build-->
2733        <target name="buildSmallOnly" depends="pkg-portable-clean,buildSmall"/>
2734
2735<!-- *1* preparing the jars by OS dependent de-bloating -->
2736        <target name="preppkg-portable-win32-jbigi" depends="buildSmallOnly, jbigi-windows-only" />
2737
2738        <target name="preppkg-portable-linux-jbigi"  depends="buildSmallOnly, jbigi-linux-only" />
2739
2740<!-- *2* os independent procedure  -->
2741        <target name="preppkg-portable-basic" >
2742                <mkdir dir="pkg-temp" />
2743                        <!-- non OS dependent configurations only, dont add *nux/win stuff here -->
2744                        <copy todir="pkg-temp">
2745                                <fileset dir="installer/resources/portable/configs/" />
2746                        </copy>
2747                        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
2748                        <copy file="installer/resources/hosts.txt" todir="pkg-temp/" />
2749                        <copy file="installer/resources/readme.license.txt" todir="pkg-temp/" />
2750                <mkdir dir="pkg-temp/addressbook" />
2751                        <copy file="apps/addressbook/subscriptions.txt" todir="pkg-temp/addressbook/" />
2752                        <copy file="apps/addressbook/myhosts.txt"  todir="pkg-temp/addressbook/" />
2753                        <!-- config.txt is in installer/resources/portable -->
2754                <mkdir dir="pkg-temp/docs" />
2755                        <copy file="installer/resources/initialNews/initialNews.xml" tofile="pkg-temp/docs/news.xml" overwrite="true" />
2756                        <copy file="installer/resources/readme/readme.html" tofile="pkg-temp/docs/readme.html" />
2757                        <copy file="installer/resources/startconsole.html" todir="pkg-temp/docs/" />
2758                        <copy file="installer/resources/start.ico" todir="pkg-temp/docs/" />
2759                        <copy file="installer/resources/console.ico" todir="pkg-temp/docs/" />
2760                        <!-- HTTP Header files, english only,
2761                                if you need a different lang do it in a seperate target -->
2762                        <copy todir="pkg-temp/docs/" >
2763                                <fileset dir="installer/resources/proxy/"  includes="**-header.ht" />
2764                        </copy>
2765                        <!-- Theme light only -->
2766                        <copy todir="pkg-temp/docs/themes/console/light/" overwrite="true" >
2767                                <fileset dir="installer/resources/themes/console/light/" includes="**.css" />
2768                        </copy>
2769                        <copy file="installer/resources/themes/console/light/console_big.css" todir="portable/docs/themes/console/light/" />
2770                        <copy todir="pkg-temp/docs/themes/console/images/" >
2771                                <fileset dir="installer/resources/themes/console/images/" />
2772                        </copy>
2773                        <!-- FLAGs for language icon (not for ip)-->
2774                        <copy todir="pkg-temp/docs/icons" >
2775                                <fileset dir="installer/resources/icons" />
2776                        </copy>
2777                <mkdir dir="pkg-temp/webapps" />
2778                        <copy todir="pkg-temp/webapps/">
2779                                <fileset dir="build/" includes="**.war" />
2780                        </copy>
2781                <mkdir dir="pkg-temp/lib" />
2782                        <copy todir ="pkg-temp/lib/" >
2783                                <fileset dir="build/" includes="**.jar" />
2784                        </copy>
2785                        <!-- 3rd party jars from apps/  -->
2786                                <!-- jrobin - without jobin , you lost graph and get a lot error entry in logs -->
2787                        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
2788        </target>
2789<!-- *3* os dependent procedure/commands -->
2790        <target name = "preppkg-portable-win32" depends="preppkg-portable-win32-jbigi,preppkg-portable-basic">
2791                        <!--wrapper - dont even think about it. i2p cosumes appreantly more mem without it on win32-->
2792                <copy file="installer/lib/wrapper/win32/wrapper.dll" todir="pkg-temp/lib" />
2793                <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
2794                <copy file="installer/lib/wrapper/win32/I2Psvc.exe" tofile="pkg-temp/i2psvc.ex_" />
2795                        <!--  copy the unpack/start batchfiles -->
2796                <copy todir="pkg-temp">
2797                        <fileset dir="installer/resources/portable/win32/" />
2798                </copy>
2799        </target>
2800<!-- *4* command for windows package -->
2801        <target name = "pkg-portable-win32"     depends="preppkg-portable-win32, pack200" >
2802                <!-- i need the portable\ folder in .zip so basedir is set to . -->
2803                <move file="pkg-temp" tofile="portable"/>
2804                <zip destfile="portable-win32.zip" basedir="." level="9" includes="portable\**" />
2805                <checksum file="portable-win32.zip" forceOverwrite="yes"/>
2806                <move file="portable" tofile="pkg-temp"/>
2807        </target>
2808</project>
Note: See TracBrowser for help on using the repository browser.