source: build.xml @ 1f92232

Last change on this file since 1f92232 was 1f92232, checked in by zzz <zzz@…>, 20 months ago

Findbugs all over

  • Property mode set to 100644
File size: 147.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.25.v20180606" />
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="  installer5, installer5-linux, installer5-nowindows, installer5-windows: use IzPack 5" />
28        <echo message="  osxLauncher: build the Mac OS X router/GUI launcher (OSX only)" />
29        <echo message="  bbLauncher: build the Browser Bundle router launcher" />
30        <echo message="  tarball:   tar the full install into i2p.tar.bz2 (extracts to build a new clean install)" />
31        <echo message="  updater:   Package the built files in i2pupdate.zip (extracts safely over existing installs)" />
32        <echo message="  updater200: Updater compressed with pack200 (creates i2pupdate200.zip, 60% smaller)" />
33        <echo message="  signed-updater200: Signed updater compressed with pack200 (creates i2pupdate.su3, 60% smaller)" />
34        <echo message="  updaterWithJavadoc: updater including the javadocs, for display in the console" />
35        <echo message="  updater200WithJavadoc: updater including the javadocs, for display in the console (creates i2pupdate200.zip)" />
36        <echo message="  signed-updater200WithJavadoc: Signed updater including the javadocs, for display in the console (creates i2pupdate.su3)" />
37        <echo message="  updaterWithJavadocAndJetty: updater including the javadocs, for display in the console, and Jetty " />
38        <echo message="  updater200WithJavadocAndJetty: updater including the javadocs, for display in the console, and Jetty (creates i2pupdate200.zip)" />
39        <echo message="  signed-updater200WithJavadocAndJetty: Signed updater including the javadocs, for display in the console, and Jetty (creates i2pupdate.su3)" />
40        <echo message="  updaterWithJetty: Updater including Jetty" />
41        <echo message="  updater200WithJetty: Updater including Jetty" />
42        <echo message="  signed-updater200withJetty: Signed updater including Jetty" />
43        <echo message="  updaterWithJettyFixes: updater including local jetty patches" />
44        <echo message="  updaterWithGeoIP: updater including GeoIP Files" />
45        <echo message="  updaterWithJettyFixesAndGeoIP" />
46        <echo message="  updaterWithJettyFixesAndJbigi" />
47        <echo message="  updaterWithJbigi" />
48        <echo message="  updater200WithJbigi" />
49        <echo message="  updaterSmall:   updater with the essentials only - no SAM, i2psnark, SusiMail, SusiDNS, or history.txt" />
50        <echo message="  updaterRouter:  updater with the i2p.jar and router.jar only" />
51        <echo message="  distclean: clean up all derived files" />
52        <!-- <echo message="  syndie:    generate a standalone syndie install" /> -->
53        <echo message="  desktopgui: generate a standalone desktopgui install" />
54        <echo message="  i2psnark:  generate a standalone i2psnark install" />
55        <echo message="  justBOB:  generate a standalone BOB-one.jar" />
56        <echo message="  javadoc:   generate javadoc for the entire project into ./build/javadoc and ./javadoc.zip" />
57        <echo message="  javadoc-test: Javadocs for unit test classes (build/javadoc-test)" />
58        <echo message="  slackpkg:  generate Slackware package in ./Slackware/i2p" />
59        <echo message="  debianhowto: instructions on building Debian packages" />
60        <echo message="  debian: generate Debian packages in ../" />
61        <echo message="          run &quot;ant debianhowto&quot; for instructions" />
62        <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)" />
63        <!-- <echo message="  debianrepo: build a Debian repository (reprepro required)" /> -->
64        <echo message="  poupdate: update the .po files for translators" />
65        <echo message="  pkg-portable-win32:  build a minimum portable version for win32" />
66        <echo message="  bench: build the benchmarks" />
67   </target>
68    <target name="debianhowto">
69            <echo message="To build debian packages, you must make sure that you have" />
70            <echo message="the necessary build-dependencies installed." />
71            <echo message="The packages required to build can be found in the file "/>
72            <echo message="&quot;debian/control&quot; in the &quot;Build-Depends&quot; field."/>
73            <echo message="In addition to those packages, be sure to install &quot;fakeroot&quot;,"/>
74            <echo message="&quot;quilt&quot; and &quot;build-essential&quot;!" />
75            <echo message="" />
76            <echo message="The following command will install the build dependencies for you:" />
77            <echo message=" " />
78            <echo message="sudo apt-get install debhelper ant debconf default-jdk gettext libgmp-dev po-debconf fakeroot \" />
79            <echo message="  build-essential quilt dh-apparmor dh-systemd libservice-wrapper-java \"  />
80            <echo message="  devscripts libjetty9-java libtomcat8-java libtaglibs-standard-jstlel-java libgetopt-java"  />
81            <echo message=" " />
82            <echo message="The following command will install the additional runtime dependencies:" />
83            <echo message="sudo apt-get install geoip-database famfamfam-flag-png" />
84            <echo message=" " />
85            <echo message="Once the dependencies are installed, run &quot;ant debian&quot;"/>
86            <echo message="to patch the source and build the packages." />
87    </target>
88
89    <property name="gpg" value="gpg" />
90
91    <macrodef name="gpgsign">
92        <attribute name="file" />
93        <sequential>
94            <delete file="@{file}.sig" quiet="true" />
95            <exec executable="${gpg}" failonerror="true">
96                <arg value="-u" />
97                <arg value="${release.gpg.keyid}" />
98                <arg value="-b" />
99                <arg value="@{file}" />
100            </exec>
101            <chmod type="file" perm="444">
102                <fileset dir="${basedir}">
103                    <include name="@{file} @{file}.sig" />
104                </fileset>
105            </chmod>
106        </sequential>
107    </macrodef>
108
109    <macrodef name="gpgsignasc">
110        <attribute name="file" />
111        <sequential>
112            <delete file="@{file}.asc" quiet="true" />
113            <exec executable="${gpg}" failonerror="true">
114                <arg value="-u" />
115                <arg value="${release.gpg.keyid}" />
116                <arg value="-ab" />
117                <arg value="@{file}" />
118            </exec>
119            <chmod type="file" perm="444">
120                <fileset dir="${basedir}">
121                    <include name="@{file} @{file}.asc" />
122                </fileset>
123            </chmod>
124        </sequential>
125    </macrodef>
126
127    <macrodef name="mktorrent">
128        <attribute name="file" />
129        <sequential>
130            <delete file="@{file}.torrent" quiet="true"/>
131            <java classname="org.klomp.snark.Storage" fork="true" failonerror="true">
132                <classpath>
133                    <pathelement location="build/i2p.jar" />
134                    <pathelement location="build/i2psnark.jar" />
135                </classpath>
136                <arg value="-a" />
137                <arg value="http://tracker2.postman.i2p/announce.php" />
138                <arg value="-c" />
139                <arg value="${build.built-by}" />
140                <arg value="@{file}" />
141            </java>
142        </sequential>
143    </macrodef>
144
145    <macrodef name="sha256sum">
146        <attribute name="file" />
147        <sequential>
148            <!--
149                 Note: "local" only works with ant 1.8+. This limitation shouldn't be
150                 a big deal since this macro is only called by the release
151                 target.
152             -->
153            <local name="file-sum"/>
154            <checksum format="MD5SUM" file="@{file}" property="file-sum" algorithm="sha-256"/>
155            <echo message="${file-sum}  @{file}" />
156        </sequential>
157    </macrodef>
158
159    <macrodef name="sudsign">
160        <attribute name="infile" />
161        <attribute name="outfile" />
162        <sequential>
163            <input message="Enter sud/su2 private signing key file:" addproperty="release.privkey" />
164            <fail message="You must enter an existing file path." >
165                <condition>
166                    <or>
167                        <equals arg1="${release.privkey}" arg2=""/>
168                        <not>
169                            <length file="${release.privkey}" when="greater" length="0" />
170                        </not>
171                    </or>
172                </condition>
173            </fail>
174            <echo message="Key file is ${release.privkey}" />
175            <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
176                <classpath>
177                    <pathelement location="build/i2p.jar" />
178                </classpath>
179                <arg value="sign" />
180                <arg value="@{infile}" />
181                <arg value="@{outfile}" />
182                <arg value="${release.privkey}" />
183                <arg value="${release.number}" />
184            </java>
185            <echo message="Verify version and VALID signature:" />
186            <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
187                <classpath>
188                    <pathelement location="build/i2p.jar" />
189                </classpath>
190                <arg value="verifysig" />
191                <arg value="@{outfile}" />
192            </java>
193            <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
194                <classpath>
195                    <pathelement location="build/i2p.jar" />
196                </classpath>
197                <arg value="verifyversion" />
198                <arg value="@{outfile}" />
199            </java>
200            <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
201                <classpath>
202                    <pathelement location="build/i2p.jar" />
203                </classpath>
204                <arg value="showversion" />
205                <arg value="@{outfile}" />
206            </java>
207        </sequential>
208    </macrodef>
209
210    <macrodef name="su3sign">
211        <attribute name="infile" />
212        <attribute name="outfile" />
213        <attribute name="sigtype" />
214        <attribute name="su3.ver" />
215        <sequential>
216        <input message="Enter su3 private signing key store:" addproperty="release.privkey.su3" />
217        <fail message="You must enter an existing file path." >
218            <condition>
219                <or>
220                    <equals arg1="${release.privkey.su3}" arg2=""/>
221                    <not>
222                        <length file="${release.privkey.su3}" when="greater" length="0" />
223                    </not>
224                </or>
225            </condition>
226        </fail>
227        <input message="Enter su3 key name (you@mail.i2p):" addproperty="release.signer.su3" />
228        <fail message="You must enter a name." >
229            <condition>
230                <equals arg1="${release.signer.su3}" arg2=""/>
231            </condition>
232        </fail>
233        <input message="Enter su3 key password for ${release.signer.su3}:" addproperty="release.password.su3" />
234        <fail message="You must enter a password." >
235            <condition>
236                <equals arg1="${release.password.su3}" arg2=""/>
237            </condition>
238        </fail>
239            <java classname="net.i2p.crypto.SU3File" inputstring="${release.password.su3}" fork="true" failonerror="true">
240                <classpath>
241                    <pathelement location="build/i2p.jar" />
242                </classpath>
243                <arg value="sign" />
244                <arg value="-c" />
245                <arg value="@{sigtype}" />
246                <arg value="-t" />
247                <arg value="RSA_SHA512_4096" />
248                <arg value="@{infile}" />
249                <arg value="@{outfile}" />
250                <arg value="${release.privkey.su3}" />
251                <arg value="@{su3.ver}" />
252                <arg value="${release.signer.su3}" />
253            </java>
254            <echo message="Verify version and VALID signature:" />
255            <java classname="net.i2p.crypto.SU3File" fork="true" failonerror="true">
256                <classpath>
257                    <pathelement location="build/i2p.jar" />
258                </classpath>
259                <!-- set base dir so it can find the pubkey cert -->
260                <jvmarg value="-Di2p.dir.base=installer/resources" />
261                <arg value="verifysig" />
262                <arg value="@{outfile}" />
263            </java>
264            <java classname="net.i2p.crypto.SU3File" fork="true" failonerror="true">
265                <classpath>
266                    <pathelement location="build/i2p.jar" />
267                </classpath>
268                <!-- set base dir so it can find the pubkey cert -->
269                <jvmarg value="-Di2p.dir.base=installer/resources" />
270                <arg value="showversion" />
271                <arg value="@{outfile}" />
272            </java>
273        </sequential>
274    </macrodef>
275
276    <target name="dist" depends="pkg, javadoc" />
277    <target name="dist200" depends="pkg200, javadoc" />
278    <target name="build" depends="build2">
279        <!-- so we don't build standalone for the updater -->
280        <!-- This builds apps/i2psnark/java/i2psnark-standalone.zip,
281          -   which we don't distribute anywhere...
282        <ant dir="apps/i2psnark/java/" target="standalone" />
283        -->
284    </target>
285    <target name="build2" depends="builddep, jar, buildWEB" />
286    <target name="buildSmall" depends="builddepSmall, jarSmall, buildWEB" />
287    <target name="buildclean" depends="distclean, build" />
288
289    <target name="builddep" depends="builddepSmall, buildBOB, buildSAM, buildSusiMail, buildSusiDNS, buildI2PSnark" />
290
291    <target name="builddepSmall" depends="buildrouter, buildSystray, buildDesktopGui, buildRouterConsole, buildStreaming, buildI2PTunnel, buildAddressbook" />
292
293    <!-- start of buildX, one for each sub-build.xml.
294         Do not put ant tasks in the sub-build.xmls anymore,
295         so the build will go faster.
296      -->
297
298    <target name="-setepoch">
299        <script language="javascript">
300            <![CDATA[
301              property = project.setProperty("epoch",Math.floor((new Date()).getTime()/1000));
302            ]]>
303        </script>
304    </target>
305
306    <target name="bbLauncher" depends="build">
307        <sequential>
308            <exec executable="./sbt" dir="launchers" failonerror="true">
309                <arg value="browserbundle:clean" />
310            </exec>
311            <exec executable="./sbt" dir="launchers" failonerror="true">
312                <arg value="browserbundle:assembly" />
313            </exec>
314        </sequential>
315    </target>
316
317    <target name="osxLauncher" depends="build,preppkg-osx">
318        <sequential>
319            <exec executable="./sbt" dir="launchers" failonerror="true">
320                <arg value="macosx:cleanAllTask" />
321            </exec>
322            <exec executable="./sbt" dir="launchers" failonerror="true">
323                <arg value="macosx:buildAppBundleTask" />
324            </exec>
325        </sequential>
326    </target>
327
328    <target name="buildBOB" depends="buildStreaming" >
329        <ant dir="apps/BOB/" target="jar" />
330        <copy file="apps/BOB/dist/BOB.jar" todir="build/" />
331    </target>
332
333    <target name="buildSAM" depends="buildStreaming" >
334        <ant dir="apps/sam/java/" target="jar" />
335        <copy file="apps/sam/java/build/sam.jar" todir="build/" />
336    </target>
337
338    <target name="buildSusiMail" depends="buildCore, buildJetty" >
339        <ant dir="apps/susimail/" target="war" />
340        <copy file="apps/susimail/susimail.war" todir="build/" />
341    </target>
342
343    <!-- jar (not war) for testing only -->
344    <target name="buildSusiMailJar" depends="buildCore, buildJetty" >
345        <ant dir="apps/susimail/" target="jar" />
346        <copy file="apps/susimail/susimail.jar" todir="build/" />
347    </target>
348
349    <target name="buildSusiDNS" depends="buildCore, buildJetty, buildImagegen, buildAddressbook" >
350        <ant dir="apps/susidns/src" target="all" />
351        <copy file="apps/susidns/src/susidns.war" todir="build/" />
352    </target>
353
354    <target name="buildImagegen" depends="buildCore, buildJetty" >
355        <ant dir="apps/imagegen" target="build" />
356        <copy file="apps/imagegen/imagegen/build/imagegen.war" todir="build/" />
357    </target>
358
359    <target name="buildI2PSnark" depends="buildStreaming, buildJetty, buildSystray" >
360        <ant dir="apps/i2psnark/java/" target="war" />
361        <copy file="apps/i2psnark/i2psnark.war" todir="build/" />
362        <copy file="apps/i2psnark/java/build/i2psnark.jar" todir="build/" />
363    </target>
364
365    <!-- jar (not war) for Android -->
366    <target name="buildAddressbookJar" depends="buildCore" >
367        <ant dir="apps/addressbook/" target="jar" />
368        <copy file="apps/addressbook/dist/addressbook.jar" todir="build/" />
369    </target>
370
371    <target name="buildAddressbook" depends="buildCore" >
372        <ant dir="apps/addressbook/" target="all" />
373        <copy file="apps/addressbook/dist/addressbook.jar" todir="build/" />
374        <!-- war is empty, only for updates -->
375        <copy file="apps/addressbook/dist/addressbook.war" todir="build/" />
376    </target>
377
378    <!-- Both jars and no war, for Android -->
379    <target name="buildI2PTunnelJars" depends="buildStreaming" >
380        <ant dir="apps/i2ptunnel/java/" target="uiJar" />
381        <copy file="apps/i2ptunnel/java/build/i2ptunnel.jar" todir="build/" />
382        <copy file="apps/i2ptunnel/java/build/i2ptunnel-ui.jar" todir="build/" />
383    </target>
384
385    <target name="buildI2PTunnel" depends="buildStreaming, buildJetty, buildImagegen" >
386        <ant dir="apps/i2ptunnel/java/" target="build" />
387        <copy file="apps/i2ptunnel/java/build/i2ptunnel.jar" todir="build/" />
388        <copy file="apps/i2ptunnel/java/build/i2ptunnel.war" todir="build/" />
389    </target>
390
391    <target name="buildDesktopGui" depends="buildCore, buildrouter" >
392<!--
393        <ant dir="apps/desktopgui" target="clean" />
394-->
395        <ant dir="apps/desktopgui" target="jar" />
396        <copy file="apps/desktopgui/dist/desktopgui.jar" todir="build/" />
397    </target>
398
399    <target name="buildRouterConsole" depends="buildrouter, buildSystray, buildDesktopGui, buildJetty, buildJrobin" >
400        <ant dir="apps/routerconsole/java/" target="jar" />
401    </target>
402
403    <!-- newsxml.jar only (subset of routerconsole, no war) for Android -->
404    <target name="buildNewsXMLJar" depends="buildRouter" >
405        <ant dir="apps/routerconsole/java/" target="newsxmljar" />
406    </target>
407
408    <target name="buildJetty" depends="buildCore" >
409        <ant dir="apps/jetty" target="build" />
410        <copy todir="build/" >
411            <fileset dir="apps/jetty/jettylib" excludes="ant.jar" />
412        </copy>
413    </target>
414
415    <target name="buildSystray" depends="buildCore" >
416        <ant dir="apps/systray/java/" target="jar" />
417        <copy file="apps/systray/java/build/systray.jar" todir="build/" />
418    </target>
419
420    <target name="buildStreaming" depends="buildMinistreaming" >
421        <ant dir="apps/streaming/java/" target="jar" />
422        <copy file="apps/streaming/java/build/streaming.jar" todir="build/" />
423    </target>
424
425    <target name="buildMinistreaming" depends="buildCore" >
426        <ant dir="apps/ministreaming/java/" target="jar" />
427        <copy file="apps/ministreaming/java/build/mstreaming.jar" todir="build/" />
428    </target>
429
430    <target name="buildRouter" depends="buildrouter" />
431    <target name="buildrouter" depends="buildCore" >
432        <ant dir="router/java/" target="jar" />
433        <copy file="router/java/build/router.jar" todir="build/" />
434    </target>
435
436    <target name="buildCore" depends="buildProperties" >
437        <ant dir="core/java/" target="jar" />
438        <copy file="core/java/build/i2p.jar" todir="build/" />
439    </target>
440
441    <target name="buildJrobin" depends="buildCore" >
442        <ant dir="apps/jrobin/java/" target="jar" />
443        <copy file="apps/jrobin/java/build/jrobin.jar" todir="build/" />
444    </target>
445
446    <target name="buildProperties" depends="getMtnRev, getReleaseNumber, getBuildNumber, setBuildTimestamp" >
447        <!-- default if not set above -->
448        <property name="workspace.version" value="unknown" />
449        <!-- default if not set by setBuildTimestamp -->
450        <property name="build.timestamp" value="reproducible" />
451        <property name="full.version" value="${release.number}-${i2p.build.number}${build.extra}" />
452        <echo message="Building version ${full.version} (mtn rev ${workspace.version})" />
453    </target>
454
455    <target name="setBuildTimestamp" unless="${build.reproducible}" >
456        <tstamp>
457            <format property="build.timestamp" pattern="yyyy-MM-dd HH:mm:ss z" timezone="UTC" locale="en" />
458        </tstamp>
459    </target>
460
461    <target name="buildWEB" depends="buildRouterConsole" >
462        <copy file="apps/routerconsole/java/build/routerconsole.jar" todir="build/" />
463        <copy file="apps/routerconsole/java/build/routerconsole.war" todir="build/" />
464    </target>
465
466    <target name="buildTools" depends="buildrouter" >
467        <ant dir="installer/tools/java" target="jar" />
468        <copy file="installer/tools/java/build/tools.jar" todir="build/" />
469    </target>
470
471    <!-- end of sub-build.xml targets -->
472
473    <!-- monotone targets -->
474
475    <target name="checkForMtn" >
476        <available property="mtn.available" file="_MTN" type="dir" />
477    </target>
478
479    <target name="failIfNoMtn" depends="checkForMtn">
480        <fail message="This target cannot be used without Monotone! Use &quot;fakeroot debian/rules get-orig-source&quot; instead.">
481            <condition>
482                <not>
483                    <isset property="mtn.available" />
484                </not>
485            </condition>
486        </fail>
487    </target>
488
489    <target name="getMtnRev" depends="checkForMtn" if="mtn.available" >
490        <exec executable="mtn" outputproperty="workspace.version" errorproperty="mtn.error1" failifexecutionfails="false" >
491            <arg value="automate" />
492            <arg value="get_base_revision_id" />
493        </exec>
494    </target>
495
496    <target name="trimMtnRev" depends="getMtnRev">
497        <script language="javascript">
498            <![CDATA[
499            var MtnRev = project.getProperty("workspace.version");
500            if (MtnRev != 'unknown' && MtnRev != null) {
501                echo = project.createTask("echo");
502                var MtnShortHash = MtnRev.substring(0,8);
503                project.setProperty("MtnShortHash", MtnShortHash);
504                echo.setMessage("Trimmed hash: " + MtnShortHash);
505                echo.perform();
506            } else {
507                project.setProperty("MtnShortHash", 'unknown');
508            }
509            ]]>
510        </script>
511    </target>
512
513    <target name="checkIfBumped">
514        <exec executable="mtn" outputproperty="bumped" errorproperty="mtn.error2" failifexecutionfails="false" >
515            <arg value="ls" />
516            <arg value="ch" />
517            <arg value="router/java/src/net/i2p/router/RouterVersion.java" />
518        </exec>
519        <condition property="bumped.already">
520            <not>
521                <equals arg1="${bumped}" arg2=""/>
522            </not>
523        </condition>
524    </target>
525
526    <target name="bump" depends="bumpBuild" />
527    <target name="bumpBuild" depends="checkIfBumped, getBuildNumber" unless="bumped.already">
528        <script language="javascript">
529            <![CDATA[
530            var newBuildNumber = (Number(project.getProperty("i2p.build.number")) + 1);
531            if (newBuildNumber != 'unknown' && newBuildNumber != null) {
532                echo = project.createTask("echo");
533                project.setProperty("new.i2p.build.number", newBuildNumber);
534                echo.setMessage("Build number is now: " + newBuildNumber + project.getProperty("build.extra"));
535                echo.perform();
536            }
537            ]]>
538        </script>
539        <replaceregexp byline="true" file="router/java/src/net/i2p/router/RouterVersion.java"
540            match='(^\s+public\s+final\s+static\s+long\s+BUILD\s+=\s+)[0-9]+;' replace='\1${new.i2p.build.number};'/>
541    </target>
542
543    <target name="revisions" depends="getReleaseNumber, getBuildNumber">
544        <!-- mtn log __brief __no-graph __to t:i2p-0.9.xx | cut -d ' ' -f 2 | sort | uniq -c | sort -rn -->
545        <exec executable="mtn" outputproperty="getrevisions1" errorproperty="reverror1" failifexecutionfails="true" >
546            <arg value="log" />
547            <arg value="--brief" />
548            <arg value="--no-graph" />
549            <arg value="--to" />
550            <arg value="t:i2p-${release.number}" />
551        </exec>
552        <exec executable="cut" inputstring="${getrevisions1}" outputproperty="getrevisions2" failifexecutionfails="true" >
553            <arg value="-d" />
554            <arg value=" " />
555            <arg value="-f" />
556            <arg value="2" />
557        </exec>
558        <exec executable="sort" inputstring="${getrevisions2}" outputproperty="getrevisions3" failifexecutionfails="true" >
559        </exec>
560        <exec executable="uniq" inputstring="${getrevisions3}" outputproperty="getrevisions4" failifexecutionfails="true" >
561            <arg value="-c" />
562        </exec>
563        <exec executable="sort" inputstring="${getrevisions4}" outputproperty="getrevisions5" failifexecutionfails="true" >
564            <arg value="-rn" />
565        </exec>
566        <echo message="Revisions since ${release.number}:" />
567        <echo message="${getrevisions5}" />
568    </target>
569
570    <!-- end monotone targets -->
571
572    <!-- launch4j targets -->
573
574    <condition property="noExe">
575        <not>
576            <!-- We only have launch4j binaries for the following systems -->
577            <and>
578                <or>
579                    <os arch="x86" />
580                    <os arch="i386" />
581                    <os arch="i586" />
582                    <os arch="i686" />
583                    <os arch="amd64" />
584                    <os arch="x86_64" />
585                </or>
586                <or>
587                    <os name="Linux" />
588                    <os family="windows" />
589                </or>
590            </and>
591        </not>
592    </condition>
593
594    <!-- this makes an empty build/launchi2p.jar and the build/i2p.exe for the no-wrapper windows startup, if possible -->
595    <target name="buildexe" depends="buildProperties, launch4j" unless="noExe">
596        <echo message="See the file &quot;build.properties&quot; if this step fails." />
597        <jar destfile="./build/launchi2p.jar">
598            <manifest>
599                <attribute name="Main-Class" value="net.i2p.router.RouterLaunch" />
600                <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" />
601                <attribute name="Built-By" value="${build.built-by}" />
602                <attribute name="Build-Date" value="${build.timestamp}" />
603                <attribute name="Base-Revision" value="${workspace.version}" />
604            </manifest>
605        </jar>
606        <!-- now the standalone launcher exe -->
607        <launch4j configFile="./installer/i2pstandalone.xml" />
608        <!-- thazzit -->
609    </target>
610
611    <target name="launch4j">
612        <taskdef name="launch4j"
613                 classname="net.sf.launch4j.ant.Launch4jTask"
614                 classpath="${basedir}/installer/lib/launch4j/launch4j.jar:${basedir}/installer/lib/launch4j/lib/xstream.jar" />
615     </target>
616
617    <!-- end launch4j targets -->
618
619     <!--
620          the files are now copied to the build directory
621          in the build* targets
622      -->
623     <target name="jar" depends="jarSmall" />
624     <target name="jarSmall" depends="builddepSmall" />
625
626    <!-- Custom target to collect the jars that I2P-Bote needs to compile, so it can compile from source. -->
627    <target name="jarBote" depends="buildRouter, buildStreaming, buildJetty" >
628        <copy file="apps/susidns/src/lib/jstl.jar" todir="build/" />
629        <copy file="apps/susidns/src/lib/standard.jar" todir="build/" />
630    </target>
631
632    <!-- jbigi targets -->
633
634    <target name="jbigi-list-changes" depends="checkForMtn" if="mtn.available">
635        <exec executable="mtn" outputproperty="workspace.changes.jbigi" errorproperty="mtn.error.jbigi" failifexecutionfails="false" >
636            <arg value="list" />
637            <arg value="changed" />
638            <arg value="installer/lib/jbigi" />
639        </exec>
640        <!-- \n in an attribute value generates an invalid manifest -->
641        <exec executable="tr" inputstring="${workspace.changes.jbigi}" outputproperty="workspace.changes.jbigi.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
642            <arg value="-s" />
643            <arg value="&quot;[:space:]&quot;" />
644            <arg value="," />
645        </exec>
646    </target>
647
648    <target name="jbigi" depends="buildProperties, jbigi-list-changes">
649        <!-- set if unset -->
650        <property name="workspace.changes.jbigi.tr" value="" />
651        <mkdir dir="./build" />
652        <jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
653            <fileset dir="installer/lib/jbigi" includes="*.so *.dll *.jnilib" />
654            <manifest>
655                <attribute name="Built-By" value="${build.built-by}" />
656                <attribute name="Build-Date" value="${build.timestamp}" />
657                <attribute name="Base-Revision" value="${workspace.version}" />
658                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
659            </manifest>
660        </jar>
661    </target>
662
663    <target name="jbigi-nowindows" depends="buildProperties, jbigi-list-changes">
664        <!-- set if unset -->
665        <property name="workspace.changes.jbigi.tr" value="" />
666        <delete file="build/jbigi.jar" failonerror="false" quiet="true" />
667        <jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
668            <fileset dir="installer/lib/jbigi" includes="*.so *.jnilib" />
669            <manifest>
670                <attribute name="Built-By" value="${build.built-by}" />
671                <attribute name="Build-Date" value="${build.timestamp}" />
672                <attribute name="Base-Revision" value="${workspace.version}" />
673                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
674            </manifest>
675        </jar>
676    </target>
677
678    <!-- Now system-specific jbigis in alphabetical order -->
679    <target name="jbigi-freebsd-only"  depends="buildProperties, jbigi-list-changes">
680        <!-- set if unset -->
681        <property name="workspace.changes.jbigi.tr" value="" />
682        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
683            <fileset dir="installer/lib/jbigi" includes="*bsd*.so" />
684            <manifest>
685                <attribute name="Built-By" value="${build.built-by}" />
686                <attribute name="Build-Date" value="${build.timestamp}" />
687                <attribute name="Base-Revision" value="${workspace.version}" />
688                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
689            </manifest>
690        </jar>
691    </target>
692
693    <target name="jbigi-linux-only"  depends="buildProperties, jbigi-list-changes">
694        <!-- set if unset -->
695        <property name="workspace.changes.jbigi.tr" value="" />
696        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
697            <fileset dir="installer/lib/jbigi" includes="*linux*.so" />
698            <manifest>
699                <attribute name="Built-By" value="${build.built-by}" />
700                <attribute name="Build-Date" value="${build.timestamp}" />
701                <attribute name="Base-Revision" value="${workspace.version}" />
702                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
703            </manifest>
704        </jar>
705    </target>
706
707    <target name="jbigi-linux-x86-only"  depends="buildProperties, jbigi-list-changes">
708        <!-- set if unset -->
709        <property name="workspace.changes.jbigi.tr" value="" />
710        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
711            <fileset dir="installer/lib/jbigi" includes="*linux*.so" excludes="*linux-arm*.so,*linux-ppc*.so" />
712            <manifest>
713                <attribute name="Built-By" value="${build.built-by}" />
714                <attribute name="Build-Date" value="${build.timestamp}" />
715                <attribute name="Base-Revision" value="${workspace.version}" />
716                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
717            </manifest>
718        </jar>
719    </target>
720
721
722    <target name="jbigi-linux-nonx86-only"  depends="buildProperties, jbigi-list-changes">
723        <!-- set if unset -->
724        <property name="workspace.changes.jbigi.tr" value="" />
725        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
726            <fileset dir="installer/lib/jbigi" includes="*linux-arm*.so,*linux-ppc*.so" />
727            <manifest>
728                <attribute name="Built-By" value="${build.built-by}" />
729                <attribute name="Build-Date" value="${build.timestamp}" />
730                <attribute name="Base-Revision" value="${workspace.version}" />
731                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
732            </manifest>
733        </jar>
734    </target>
735
736    <target name="jbigi-osx-only"  depends="buildProperties, jbigi-list-changes" >
737        <!-- set if unset -->
738        <property name="workspace.changes.jbigi.tr" value="" />
739        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
740            <fileset dir="installer/lib/jbigi" includes="*.jnilib" />
741            <manifest>
742                <attribute name="Built-By" value="${build.built-by}" />
743                <attribute name="Build-Date" value="${build.timestamp}" />
744                <attribute name="Base-Revision" value="${workspace.version}" />
745                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
746            </manifest>
747        </jar>
748    </target>
749
750    <target name="jbigi-windows-only" depends="buildProperties, jbigi-list-changes" >
751        <!-- set if unset -->
752        <property name="workspace.changes.jbigi.tr" value="" />
753        <delete file="build/jbigi.jar" failonerror="false" quiet="true" />
754        <jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
755            <fileset dir="installer/lib/jbigi" includes="*windows*.dll" />
756            <manifest>
757                <attribute name="Built-By" value="${build.built-by}" />
758                <attribute name="Build-Date" value="${build.timestamp}" />
759                <attribute name="Base-Revision" value="${workspace.version}" />
760                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
761            </manifest>
762        </jar>
763    </target>
764
765    <!-- end jbigi targets -->
766
767    <target name="poupdate-source" depends="set-lg2-en, poupdate" />
768
769    <target name="set-lg2-en" >
770        <property name="lg2" value="en" />
771    </target>
772
773    <!-- the apps need to compile the jsps to poupdate -->
774    <target name="poupdate" depends="buildRouter, buildStreaming, buildSystray, buildJetty, buildDesktopGui, buildJrobin" >
775        <echo message="Setting environment variable LG2 to a lang code (eg: de,zh,nl etc)" />
776        <echo message=" will restrict language update to the language you specified, leaving other language untact." />
777        <!-- set if unset -->
778        <property name="lg2" value="" />
779        <ant dir="apps/routerconsole/java/" >
780            <target name="poupdate" />
781            <target name="poupdate-news" />
782            <target name="poupdate-countries" />
783        </ant>
784        <ant dir="apps/i2psnark/java/" target="poupdate" />
785        <ant dir="apps/i2ptunnel/java/" >
786            <target name="poupdate" />
787            <target name="poupdate-proxy" />
788        </ant>
789        <ant dir="apps/susidns/src/" target="poupdate" />
790        <ant dir="apps/susimail/" target="poupdate" />
791        <ant dir="apps/desktopgui" target="poupdate" />
792        <ant dir="installer/resources/locale" target="poupdate" />
793        <ant dir="apps/ministreaming/java" target="poupdate" />
794    </target>
795
796    <condition property="no.bundle">
797        <isfalse value="${require.gettext}" />
798    </condition>
799
800    <target name="prep-script-translation" unless="no.bundle" >
801        <!-- script translation added in 0.8.13, enabled in 0.9.5. -->
802        <ant dir="installer/resources/locale" target="bundle" />
803        <copy todir="pkg-temp/locale/">
804            <fileset dir="installer/resources/locale/mo/" />
805        </copy>
806    </target>
807
808    <target name="javadoc" depends="getReleaseNumber, getBuildNumber" >
809        <ant dir="apps/jetty" target="ensureJettylib" />
810        <mkdir dir="./build" />
811        <mkdir dir="./build/javadoc" />
812        <javadoc access="package"
813            destdir="./build/javadoc"
814            packagenames="*"
815            use="true"
816            splitindex="true"
817            failonerror="true"
818            additionalparam="-notimestamp"
819            doctitle="I2P Javadocs for Release ${release.number} Build ${i2p.build.number}${build.extra}"
820            windowtitle="I2P Anonymous Network - Java Documentation - Version ${release.number}">
821            <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.*" />
822            <group title="Streaming Library" packages="net.i2p.client.streaming:net.i2p.client.streaming.impl" />
823            <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.*" />
824            <group title="Router Console" packages="net.i2p.router.web:net.i2p.router.web.*:net.i2p.router.update:net.i2p.router.news" />
825            <!-- apps and bridges starting here, alphabetical please -->
826            <group title="Addressbook Application" packages="net.i2p.addressbook:net.i2p.router.naming:net.metanotion:net.metanotion.*" />
827            <group title="BOB Bridge" packages="net.i2p.BOB" />
828            <group title="BOB Demos" packages="net.i2p.BOB.Demos.echo.echoclient:net.i2p.BOB.Demos.echo.echoserver" />
829            <group title="Desktopgui Application" packages="net.i2p.desktopgui:net.i2p.desktopgui.*" />
830            <group title="I2PSnark Application" packages="org.klomp.snark:org.klomp.snark.*" />
831            <group title="I2PTunnel Application" packages="net.i2p.i2ptunnel:net.i2p.i2ptunnel.*" />
832            <group title="Imagegen Application" packages="com.docuverse.identicon:com.google.zxing:com.google.zxing.*:net.i2p.imagegen" />
833            <group title="Installer Utilities" packages="net.i2p.installer" />
834            <group title="Jetty Utilities" packages="net.i2p.jetty:net.i2p.servlet:net.i2p.servlet.*" />
835            <group title="JRobin Library" packages="org.jrobin:org.jrobin.*:engine.misc" />
836            <group title="SAM Bridge" packages="net.i2p.sam" />
837            <group title="SAM Demos" packages="net.i2p.sam.client" />
838            <group title="SusiDNS Application" packages="i2p.susi.dns:net.i2p.addressbook.servlet" />
839            <group title="SusiMail Application" packages="i2p.susi.webmail:i2p.susi.webmail.*:i2p.susi.debug:i2p.susi.util" />
840            <group title="Systray Application" packages="net.i2p.apps.systray" />
841            <sourcepath>
842                <pathelement location="core/java/src" />
843                <pathelement location="router/java/src" />
844                <pathelement location="apps/ministreaming/java/src" />
845                <pathelement location="apps/streaming/java/src" />
846                <pathelement location="apps/i2ptunnel/java/src" />
847                <pathelement location="apps/systray/java/src" />
848                <pathelement location="apps/desktopgui/src" />
849                <pathelement location="apps/routerconsole/java/src" />
850                <pathelement location="apps/addressbook/java/src" />
851                <pathelement location="apps/i2psnark/java/src" />
852                <pathelement location="apps/sam/java/src" />
853                <pathelement location="apps/BOB/src" />
854                <pathelement location="apps/BOB/Demos/echo/echoclient/src" />
855                <pathelement location="apps/BOB/Demos/echo/echoserver/src" />
856                <pathelement location="apps/susidns/src/java/src" />
857                <pathelement location="apps/susimail/src/src" />
858                <pathelement location="apps/jetty/java/src" />
859                <pathelement location="apps/imagegen/imagegen/webapp/src/main/java" />
860                <pathelement location="apps/imagegen/identicon/core/src/main/java" />
861                <pathelement location="apps/imagegen/zxing/core/src/main/java" />
862                <pathelement location="apps/imagegen/zxing/javase/src/main/java" />
863                <pathelement location="apps/jrobin/java/src" />
864                <pathelement location="installer/java/src" />
865            </sourcepath>
866            <classpath>
867                <!-- warning, some entries are needed for Debian builds only -->
868                <pathelement location="apps/jetty/jettylib/org.mortbay.jetty.jar" />
869                <pathelement location="apps/jetty/jettylib/jasper-runtime.jar" />
870                <pathelement location="apps/jetty/jettylib/javax.servlet.jar" />
871                <pathelement location="apps/jetty/jettylib/jetty-http.jar" />
872                <pathelement location="apps/jetty/jettylib/jetty-security.jar" />
873                <pathelement location="apps/jetty/jettylib/jetty-servlet.jar" />
874                <pathelement location="apps/jetty/jettylib/jetty-servlets.jar" />
875                <pathelement location="apps/jetty/jettylib/jetty-start.jar" />
876                <pathelement location="apps/jetty/jettylib/jetty-util.jar" />
877                <pathelement location="apps/jetty/jettylib/jetty-webapp.jar" />
878                <pathelement location="apps/jetty/jettylib/jetty-xml.jar" />
879                <pathelement location="apps/jetty/jettylib/tomcat-api.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 tr.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    <!-- IzPack 4 -->
1808    <target name="installer-nowindows" depends="clean, preppkg-nowindows, izpack-patches" >
1809        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1810        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}.jar" installerType="standard" basedir="${basedir}" />
1811    </target>
1812
1813    <!-- IzPack 5 -->
1814    <target name="installer5-nowindows" depends="ensureIzpack5, clean, preppkg-nowindows" >
1815        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1816        <izpack5 input="${basedir}/installer/install5.xml" output="${basedir}/i2pinstall_${full.version}.jar" installerType="standard" basedir="${basedir}" />
1817    </target>
1818
1819
1820    <target name="installer-freebsd" depends="clean, preppkg-freebsd-only, izpack-patches" >
1821        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1822        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_freebsd-only.jar" installerType="standard" basedir="${basedir}" />
1823    </target>
1824
1825    <!-- IzPack 4 -->
1826    <target name="installer-linux" depends="clean, preppkg-linux-only, izpack-patches" >
1827        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1828        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_linux-only.jar" installerType="standard" basedir="${basedir}" />
1829    </target>
1830
1831    <!-- IzPack 5 -->
1832    <target name="installer5-linux" depends="ensureIzpack5, clean, preppkg-linux-only" >
1833        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1834        <izpack5 input="${basedir}/installer/install5.xml" output="${basedir}/i2pinstall_${full.version}_linux-only.jar" installerType="standard" basedir="${basedir}" />
1835    </target>
1836
1837
1838    <target name="installer-osx" depends="clean, checkForIzpack2App, preppkg-osx-only, izpack-patches">
1839        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1840        <mkdir dir="pkg-temp/osx" />
1841        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_osx-only.jar" installerType="standard" basedir="${basedir}" />
1842        <ant target="installer2app" />
1843        <delete dir="pkg-temp/osx" />
1844    </target>
1845
1846    <target name="checkForIzpack2App">
1847        <!-- we'll set the izpack2app binary name if it's not been set elsewhere yet -->
1848        <property name="izpack2app.binary" value="${user.home}/IzPack/utils/wrappers/izpack2app/izpack2app.py" />
1849        <available property="izpack2app.available" file="${izpack2app.binary}" />
1850    </target>
1851
1852    <target name="installer2app" if="izpack2app.available">
1853        <mkdir dir="pkg-temp/osx" />
1854        <exec executable="python" failonerror="true">
1855            <arg value="${izpack2app.binary}" />
1856            <arg value="${basedir}/i2pinstall_${full.version}_osx-only.jar" />
1857            <arg value="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" />
1858        </exec>
1859
1860        <tar longfile="gnu" destfile="${basedir}/i2pinstall_${full.version}_osx.tar.bz2" compression="bzip2">
1861            <tarfileset dir="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" prefix="/i2p-${full.version}_osx-install.app" filemode="644">
1862                <include name="**/**" />
1863                <exclude name="Contents/MacOS/*" />
1864            </tarfileset>
1865            <tarfileset dir="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" prefix="/i2p-${full.version}_osx-install.app" filemode="755">
1866                <include name="Contents/MacOS/*" />
1867            </tarfileset>
1868        </tar>
1869    </target>
1870
1871    <!-- call between installer-xxx and installer-windows -->
1872    <target name="delete-nonwindows">
1873        <delete dir="pkg-temp/lib/wrapper/" />
1874        <delete dir="pkg-temp/locale/" />
1875        <delete dir="pkg-temp/man/" />
1876        <delete dir="pkg-temp/Start I2P Router.app/" />
1877        <delete dir="pkg-temp" includes="eepget i2prouter INSTALL-headless.txt osid postinstall.sh runplain.sh" />
1878    </target>
1879
1880    <!-- IzPack 4 -->
1881    <target name="installer-windows" depends="clean, preppkg-windows-only, util-list-changes, izpack-patches, buildUtilityJar" >
1882        <fixcrlf srcdir="pkg-temp" includes="*.config *.bat *.cmd **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="crlf"/>
1883        <izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
1884        <ant target="installerexe" />
1885        <delete file="${basedir}/install.jar" />
1886        <move file="${basedir}/i2pinstall.exe" tofile="${basedir}/i2pinstall_${full.version}_windows.exe" />
1887    </target>
1888
1889    <!-- IzPack 5 -->
1890    <target name="installer5-windows" depends="ensureIzpack5, clean, preppkg-windows-only, util-list-changes, buildUtilityJar" >
1891        <fixcrlf srcdir="pkg-temp" includes="*.config *.bat *.cmd **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="crlf"/>
1892        <izpack5 input="${basedir}/installer/install5.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
1893        <ant target="installerexe" />
1894        <delete file="${basedir}/install.jar" />
1895        <move file="${basedir}/i2pinstall.exe" tofile="${basedir}/i2pinstall_${full.version}_windows.exe" />
1896    </target>
1897
1898    <!-- this is broken as installer-xxx targets may delete (or not delete) things in pkg-temp -->
1899    <target name="installer-all" depends="installer-freebsd, installer-linux, installer-osx, installer-windows, installer-nowindows, installer" >
1900    </target>
1901    <!-- end custom installers -->
1902
1903    <!-- unit tests -->
1904    <target name="buildTest">
1905        <ant dir="core/java/" target="jarTest" />
1906        <ant dir="router/java/" target="jarTest" />
1907        <copy file="core/java/build/i2ptest.jar" todir="build" />
1908        <copy file="router/java/build/routertest.jar" todir="build" />
1909        <!-- broken -->
1910      <!--
1911        <ant dir="apps/ministreaming/java/" target="junit.compileTest" />
1912        <ant dir="apps/streaming/java/" target="junit.compileTest" />
1913       -->
1914    </target>
1915    <target name="prepTest" depends="prepupdate, buildTest">
1916        <!-- overwrite i2p.jar and router.jar with the test versions -->
1917        <copy file="build/i2ptest.jar" tofile="pkg-temp/lib/i2p.jar" overwrite="true" />
1918        <copy file="build/routertest.jar" tofile="pkg-temp/lib/router.jar" overwrite="true" />
1919    </target>
1920    <target name="updateTest" depends="prepTest, zipit" />
1921    <target name="junit.test" depends="buildProperties, jbigi" >
1922        <ant dir="core/java/" target="junit.test" />
1923        <ant dir="router/java/" target="junit.test" />
1924        <ant dir="apps/ministreaming/java/" target="junit.test" />
1925        <ant dir="apps/streaming/java/" target="junit.test" />
1926    </target>
1927    <target name="scalatest.test" depends="buildProperties, jbigi" >
1928        <ant dir="core/java/" target="scalatest.test" />
1929        <!-- note there are no router scala tests yet -->
1930        <ant dir="router/java/" target="scalatest.test" />
1931    </target>
1932    <!-- both junit and scala -->
1933    <target name="test" depends="testCore, testRouter, testMinistreaming, testStreaming" />
1934    <target name="testCore" depends="buildProperties, jbigi" >
1935        <ant dir="core/java/" target="test" />
1936    </target>
1937    <target name="testRouter" depends="buildProperties, jbigi" >
1938        <ant dir="router/java/" target="test" />
1939    </target>
1940    <target name="testMinistreaming" depends="buildProperties, jbigi" >
1941        <ant dir="apps/ministreaming/java/" target="test" />
1942    </target>
1943    <target name="testStreaming" depends="buildProperties" >
1944        <ant dir="apps/streaming/java/" target="test" />
1945    </target>
1946    <target name="scalatest.report" depends="buildProperties" >
1947        <ant dir="core/java/" target="scalatest.report" />
1948        <ant dir="router/java/" target="scalatest.report" />
1949    </target>
1950    <target name="junit.report" depends="buildProperties" >
1951        <ant dir="core/java/" target="junit.report" />
1952        <ant dir="router/java/" target="junit.report" />
1953        <ant dir="apps/ministreaming/java/" target="junit.report" />
1954        <ant dir="apps/streaming/java/" target="junit.report" />
1955    </target>
1956    <target name="clover.report" depends="buildProperties" if="with.clover">
1957        <ant dir="core/java/" target="clover.report" />
1958        <ant dir="router/java/" target="clover.report" />
1959        <ant dir="apps/ministreaming/java" target="clover.report" />
1960        <ant dir="apps/streaming/java" target="clover.report" />
1961    </target>
1962    <target name="cobertura.report" depends="buildProperties" if="with.cobertura">
1963        <ant dir="core/java/" target="cobertura.report" />
1964        <ant dir="router/java/" target="cobertura.report" />
1965        <ant dir="apps/ministreaming/java" target="cobertura.report" />
1966        <ant dir="apps/streaming/java" target="cobertura.report" />
1967    </target>
1968    <target name="test.report" depends="junit.report, scalatest.report, clover.report, cobertura.report"/>
1969    <target name="fulltest" depends="buildProperties, jbigi" >
1970        <ant dir="core/java/" target="fulltest" />
1971        <ant dir="router/java/" target="fulltest" />
1972        <ant dir="apps/ministreaming/java" target="fulltest" />
1973        <ant dir="apps/streaming/java" target="fulltest" />
1974    </target>
1975    <target name="jenkins.cobertura.report" depends="cobertura.report">
1976        <!--
1977             The jenkins cobertura plugin couldn't find the source files.
1978         -->
1979        <replaceregexp byline="true" file="reports/core/cobertura/coverage.xml"
1980            match='filename="net' replace='filename="core/java/src/net'/>
1981        <replaceregexp byline="true" file="reports/core/cobertura/coverage.xml"
1982            match="&lt;source&gt;./src" replace='&lt;source&gt;./core/java/src'/>
1983
1984        <replaceregexp byline="true" file="reports/router/cobertura/coverage.xml"
1985            match='filename="net' replace='filename="router/java/src/net'/>
1986        <replaceregexp byline="true" file="reports/router/cobertura/coverage.xml"
1987            match="&lt;source&gt;./src" replace="&lt;source&gt;router/java/src"/>
1988
1989        <replaceregexp byline="true" file="reports/ministreaming/cobertura/coverage.xml"
1990            match='filename="net' replace='filename="apps/ministreaming/java/src/net'/>
1991        <replaceregexp byline="true" file="reports/ministreaming/cobertura/coverage.xml"
1992            match="&lt;source&gt;./src" replace="&lt;source&gt;apps/ministreaming/java/src"/>
1993
1994        <replaceregexp byline="true" file="reports/streaming/cobertura/coverage.xml"
1995            match='filename="net' replace='filename="apps/streaming/java/src/net'/>
1996        <replaceregexp byline="true" file="reports/streaming/cobertura/coverage.xml"
1997            match="&lt;source&gt;./src" replace="&lt;source&gt;apps/streaming/java/src"/>
1998    </target>
1999    <!-- end unit tests -->
2000
2001    <target name="testscripts" >
2002        <exec executable="tests/scripts/checkcerts.sh" failonerror="true" />
2003        <exec executable="tests/scripts/checkpo.sh" failonerror="true" />
2004        <exec executable="tests/scripts/checkutf8.sh" failonerror="true" />
2005        <exec executable="tests/scripts/checkxml.sh" failonerror="true" />
2006        <exec executable="tests/scripts/checkscripts.sh" failonerror="true" />
2007    </target>
2008
2009
2010    <target name="testscripts-net" >
2011        <exec executable="tests/scripts/checkremotecerts.sh" failonerror="true" />
2012    </target>
2013
2014    <target name="testscripts-all" depends="testscripts,testscripts-net" />
2015
2016    <target name="bench" depends="jbigi" >
2017        <ant dir="core/java/" target="bench.jar" />
2018    </target>
2019
2020    <!-- <target name="syndie" >
2021        <ant dir="apps/syndie/java/" target="standalone" />
2022        <copy file="apps/syndie/java/syndie-standalone.zip" todir="." />
2023    </target> -->
2024
2025    <!-- standalone i2psnark zip -->
2026    <target name="i2psnark" depends="buildStreaming, buildJetty, buildSystray" >
2027        <ant dir="apps/i2psnark/java" target="standalone" />
2028        <copy file="apps/i2psnark/java/i2psnark-standalone.zip" todir="." />
2029    </target>
2030
2031    <target name="slackpkg">
2032        <ant dir="Slackware/i2p/" target="slackpkg" />
2033    </target>
2034    <target name="justBOB" depends="builddepSmall, jbigi">
2035        <ant dir="apps/BOB/" target="onejar" />
2036        <copy file="apps/BOB/dist/BOB-one.jar" todir="." />
2037    </target>
2038
2039    <target name="sloccount.report">
2040        <property name="sloccount.report.file" value="sloccount.sc" />
2041        <echo message="Generating sloccount report (this will take awhile)" />
2042        <exec executable="sloccount" failonerror="true">
2043            <arg value="--details"/>
2044            <arg value="--wide"/>
2045            <arg value="${basedir}"/>
2046            <redirector output="${sloccount.report.file}">
2047                <outputfilterchain>
2048                    <linecontainsregexp negate="true">
2049                        <regexp pattern="(Warning: |lib/launch4j|_MTN|reports|pkg-temp|licenses|i2p\.fba|gmp-|WEB-INF)" />
2050                    </linecontainsregexp>
2051                    <linecontains negate="true">
2052                        <contains value="${sloccount.report.file}" />
2053                    </linecontains>
2054                </outputfilterchain>
2055            </redirector>
2056        </exec>
2057        <echo message="sloccount report saved to the file &quot;${sloccount.report.file}&quot;" />
2058    </target>
2059
2060    <target name="findbugs" depends="build2, buildUtilityJar">
2061        <echo message="Starting findbugs, this will take a while..." />
2062        <!-- ref: https://github.com/spotbugs/spotbugs/issues/148 -->
2063        <echo message="If this doesn't work with Java 9+. try Java 8" />
2064        <exec executable="nice" failonerror="true">
2065            <arg value="findbugs"/>
2066            <arg value="-textui"/>
2067            <arg value="-projectName"/>
2068            <arg value="i2p"/>
2069            <arg value="-sortByClass"/>
2070            <arg value="-xml"/>
2071            <arg value="-output"/>
2072            <arg value="i2p.fba"/>
2073            <arg value="-auxclasspath"/>
2074            <arg value="build/commons-el.jar:build/jasper-runtime.jar:build/javax.servlet.jar:build/org.mortbay.jetty.jar:build/jrobin.jar:installer/lib/wrapper/all/wrapper.jar:apps/susidns/src/lib/standard.jar:apps/susidns/src/lib/jstl.jar"/>
2075            <arg value="-sourcepath"/>
2076            <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"/>
2077            <!-- start of the files to be analyzed -->
2078            <arg value="build/BOB.jar"/>
2079            <arg value="build/addressbook.jar"/>
2080            <arg value="build/i2p.jar"/>
2081            <arg value="build/i2psnark.jar"/>
2082            <arg value="build/i2psnark.war"/>
2083            <arg value="build/i2ptunnel.jar"/>
2084            <arg value="build/i2ptunnel.war"/>
2085            <arg value="build/imagegen.war"/>
2086            <arg value="build/jetty-i2p.jar"/>
2087            <arg value="build/mstreaming.jar"/>
2088            <arg value="build/router.jar/"/>
2089            <arg value="build/desktopgui.jar"/>
2090            <arg value="build/routerconsole.jar"/>
2091            <arg value="build/routerconsole.war"/>
2092            <arg value="build/sam.jar"/>
2093            <arg value="build/streaming.jar"/>
2094            <arg value="build/susidns.war"/>
2095            <arg value="build/susimail.war"/>
2096            <arg value="build/systray.jar"/>
2097            <arg value="build/utility.jar"/>
2098        </exec>
2099        <echo message="Findbugs output stored in i2p.fba" />
2100        <echo message="Now run: findbugs i2p.fba" />
2101    </target>
2102
2103    <!-- this is the same dependency as pkg, but with updater200 in the middle,
2104         since preppkg puts too much stuff in pkg-temp -->
2105<!--
2106    <target name="release" depends="distclean, updaterWithJettyFixesAndJbigi , updater200WithJettyFixes, preppkg, installer, getReleaseNumber" >
2107    <target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyAndJbigiRepack, updater200WithJettyAndJbigi, delete-j6-update, installer-nowindows, delete-nonwindows, installer-windows">
2108    <target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyAndGeoIPRepack, updater200WithJettyAndGeoIP, delete-j6-update, installer-nowindows, delete-nonwindows, installer-windows">
2109-->
2110    <target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyRepack, updater200WithJetty, delete-j6-update, installer-nowindows, delete-nonwindows, installer-windows">
2111        <echo message="New version number is ${release.number}" />
2112        <copy file="i2pupdate.zip" tofile="i2pupdate_${release.number}.zip" />
2113        <copy file="i2pinstall_${full.version}.jar" tofile="i2pinstall_${release.number}.jar" />
2114        <copy file="i2pinstall_${full.version}_windows.exe" tofile="i2pinstall_${release.number}_windows.exe" />
2115        <!-- remove these, we don't build them anymore -->
2116        <delete file="i2pupdate.sud" />
2117        <delete file="i2pupdate.su2" />
2118        <!-- make this a lot easier by putting release.privkey.su3=/path/to/su3keystore.ks in override.properties -->
2119
2120        <!-- now build and verify the packed su3 from the packed zip -->
2121        <su3sign infile="i2pupdate200.zip" sigtype="ROUTER" outfile="i2pupdate.su3" su3.ver="${release.number}" />
2122        <!-- this will use the monotonerc file in the current workspace -->
2123        <echo message="Checking out fresh copy into ../i2p-${release.number} for tarballing:" />
2124        <delete dir="../i2p-${release.number}" />
2125        <exec executable="mtn" failonerror="true">
2126            <arg value="co" />
2127            <!-- w: is the revision of the current workspace -->
2128            <arg value="-r" />
2129            <arg value="w:" />
2130            <arg value="../i2p-${release.number}/" />
2131        </exec>
2132        <exec executable="tar" failonerror="true">
2133            <arg value="cjf" />
2134            <arg value="i2psource_${release.number}.tar.bz2" />
2135            <arg value="-C" />
2136            <arg value=".." />
2137            <arg value="--exclude" />
2138            <arg value="i2p-${release.number}/_MTN*" />
2139            <arg value="i2p-${release.number}/" />
2140        </exec>
2141        <echo message="Sign the files:" />
2142        <input message="Enter GPG key ID (e.g. 0x12345678) for signing:" addproperty="release.gpg.keyid" />
2143        <fail message="You must enter a key ID." >
2144            <condition>
2145                <equals arg1="${release.gpg.keyid}" arg2=""/>
2146            </condition>
2147        </fail>
2148
2149        <!-- the gpgsign macro sets the permission of signed files and the sigs themselves to 444 -->
2150        <gpgsign file="i2pinstall_${release.number}_windows.exe" />
2151        <gpgsign file="i2pinstall_${release.number}.jar" />
2152        <gpgsign file="i2psource_${release.number}.tar.bz2" />
2153        <gpgsign file="i2pupdate_${release.number}.zip" />
2154
2155        <chmod perm="444" type="file">
2156            <fileset dir="${basedir}">
2157                <include name="i2pupdate.su3" />
2158            </fileset>
2159        </chmod>
2160        <echo message="File sizes:" />
2161        <exec executable="ls" failonerror="true">
2162            <arg value="-l" />
2163            <arg value="i2pinstall_${release.number}_windows.exe" />
2164            <arg value="i2pinstall_${release.number}.jar" />
2165            <arg value="i2psource_${release.number}.tar.bz2" />
2166            <arg value="i2pupdate_${release.number}.zip" />
2167            <arg value="i2pupdate.su3" />
2168            <arg value="i2pinstall_${release.number}_windows.exe.sig" />
2169            <arg value="i2pinstall_${release.number}.jar.sig" />
2170            <arg value="i2psource_${release.number}.tar.bz2.sig" />
2171            <arg value="i2pupdate_${release.number}.zip.sig" />
2172        </exec>
2173        <echo message="SHA256 sums:" />
2174        <sha256sum file="i2pinstall_${release.number}_windows.exe" />
2175        <sha256sum file="i2pinstall_${release.number}.jar" />
2176        <sha256sum file="i2psource_${release.number}.tar.bz2" />
2177        <sha256sum file="i2pupdate_${release.number}.zip" />
2178        <sha256sum file="i2pupdate.su3" />
2179        <!-- make torrent files -->
2180        <copy file="i2pupdate.su3" tofile="i2pupdate-${release.number}.su3" />
2181        <mktorrent file="i2pupdate-${release.number}.su3" />
2182        <echo message="Don't forget to mtn tag w: i2p-${release.number}" />
2183        <echo message="... and mtn cert t:i2p-${release.number} branch i2p.i2p.release" />
2184    </target>
2185
2186    <target name="mavenCentral.deps" depends="buildRouter, buildStreaming">
2187        <ant dir="core/java/">
2188            <target name="javadocJar" />
2189            <target name="sourcesJar" />
2190        </ant>
2191        <ant dir="router/java/">
2192            <target name="javadocJar" />
2193            <target name="sourcesJar" />
2194        </ant>
2195        <ant dir="apps/ministreaming/java/">
2196            <target name="javadocJar" />
2197            <target name="sourcesJar" />
2198        </ant>
2199        <ant dir="apps/streaming/java/">
2200            <target name="javadocJar" />
2201            <target name="sourcesJar" />
2202        </ant>
2203        <ant dir="apps/jetty/">
2204            <target name="servletJar" />
2205            <target name="servletJavadocJar" />
2206            <target name="servletSourcesJar" />
2207        </ant>
2208    </target>
2209
2210    <target name="mavenCentral" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, mavenCentral.deps">
2211        <mkdir dir="./pkg-mavencentral" />
2212        <!-- Libraries -->
2213        <copy file="build/i2p.jar" tofile="pkg-mavencentral/i2p-${release.number}.jar" />
2214        <copy file="build/router.jar" tofile="pkg-mavencentral/router-${release.number}.jar" />
2215        <copy file="build/mstreaming.jar" tofile="pkg-mavencentral/mstreaming-${release.number}.jar" />
2216        <copy file="build/streaming.jar" tofile="pkg-mavencentral/streaming-${release.number}.jar" />
2217        <copy file="apps/jetty/build/servlet-i2p-${release.number}.jar" todir="pkg-mavencentral/" />
2218        <!-- JavaDocs -->
2219        <copy file="core/java/build/i2p-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
2220        <copy file="router/java/build/router-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
2221        <copy file="apps/ministreaming/java/build/mstreaming-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
2222        <copy file="apps/streaming/java/build/streaming-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
2223        <copy file="apps/jetty/build/servlet-i2p-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
2224        <!-- Sources -->
2225        <copy file="core/java/build/i2p-${release.number}-sources.jar" todir="pkg-mavencentral/" />
2226        <copy file="router/java/build/router-${release.number}-sources.jar" todir="pkg-mavencentral/" />
2227        <copy file="apps/ministreaming/java/build/mstreaming-${release.number}-sources.jar" todir="pkg-mavencentral/" />
2228        <copy file="apps/streaming/java/build/streaming-${release.number}-sources.jar" todir="pkg-mavencentral/" />
2229        <copy file="apps/jetty/build/servlet-i2p-${release.number}-sources.jar" todir="pkg-mavencentral/" />
2230        <!-- POMs -->
2231        <artifact:pom id="i2ppom" groupId="net.i2p" artifactId="i2p" version="${release.number}"
2232                name="I2P Core"
2233                description="The core I2P APIs"
2234                url="https://geti2p.net/">
2235            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
2236            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
2237            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/"/>
2238            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
2239                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
2240                 url="git@github.com:i2p/i2p.i2p.git" />
2241        </artifact:pom>
2242        <artifact:pom id="routerpom" groupId="net.i2p" artifactId="router" version="${release.number}"
2243                name="I2P Router"
2244                description="The I2P router"
2245                url="https://geti2p.net/">
2246            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
2247            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
2248            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/"/>
2249            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
2250                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
2251                 url="git@github.com:i2p/i2p.i2p.git" />
2252            <dependency groupId="net.i2p" artifactId="i2p" version="${release.number}" />
2253        </artifact:pom>
2254        <artifact:pom id="mstreamingpom" groupId="net.i2p.client" artifactId="mstreaming" version="${release.number}"
2255                name="I2P Ministreaming"
2256                description="API, interfaces, and factory for a TCP-like set of sockets for communicating over I2P."
2257                url="https://geti2p.net/en/docs/api/streaming">
2258            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
2259            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
2260            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/" />
2261            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
2262                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
2263                 url="git@github.com:i2p/i2p.i2p.git" />
2264            <dependency groupId="net.i2p" artifactId="i2p" version="${release.number}" />
2265        </artifact:pom>
2266        <artifact:pom id="streamingpom" groupId="net.i2p.client" artifactId="streaming" version="${release.number}"
2267                name="I2P Streaming"
2268                description="Implementation of a TCP-like set of sockets for communicating over I2P."
2269                url="https://geti2p.net/en/docs/api/streaming">
2270            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
2271            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
2272            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/" />
2273            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
2274                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
2275                 url="git@github.com:i2p/i2p.i2p.git" />
2276            <dependency groupId="net.i2p" artifactId="i2p" version="${release.number}" />
2277            <dependency groupId="net.i2p.client" artifactId="mstreaming" version="${release.number}" />
2278        </artifact:pom>
2279        <artifact:pom id="servletpom" groupId="net.i2p" artifactId="servlet-i2p" version="${release.number}"
2280                name="I2P Servlet classes"
2281                description="Various servlet classes provided to plugins by Java I2P."
2282                url="https://geti2p.net/">
2283            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
2284            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
2285            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/" />
2286            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
2287                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
2288                 url="git@github.com:i2p/i2p.i2p.git" />
2289            <dependency groupId="net.i2p" artifactId="i2p" version="${release.number}" />
2290            <dependency groupId="org.apache.tomcat" artifactId="tomcat-servlet-api" version="8.0.33" />
2291        </artifact:pom>
2292        <artifact:writepom pomRefId="i2ppom" file="pkg-mavencentral/i2p-${release.number}.pom"/>
2293        <artifact:writepom pomRefId="routerpom" file="pkg-mavencentral/router-${release.number}.pom"/>
2294        <artifact:writepom pomRefId="mstreamingpom" file="pkg-mavencentral/mstreaming-${release.number}.pom" />
2295        <artifact:writepom pomRefId="streamingpom" file="pkg-mavencentral/streaming-${release.number}.pom" />
2296        <artifact:writepom pomRefId="servletpom" file="pkg-mavencentral/servlet-i2p-${release.number}.pom" />
2297        <!-- Signatures -->
2298        <echo message="Sign the files:" />
2299        <input message="Enter GPG key ID (e.g. 0x12345678) for signing:" addproperty="release.gpg.keyid" />
2300        <fail message="You must enter a key ID." >
2301            <condition>
2302                <equals arg1="${release.gpg.keyid}" arg2=""/>
2303            </condition>
2304        </fail>
2305        <!-- the gpgsign macro sets the permission of signed files and the sigs themselves to 444 -->
2306        <gpgsignasc file="pkg-mavencentral/i2p-${release.number}.jar" />
2307        <gpgsignasc file="pkg-mavencentral/i2p-${release.number}.pom" />
2308        <gpgsignasc file="pkg-mavencentral/i2p-${release.number}-javadoc.jar" />
2309        <gpgsignasc file="pkg-mavencentral/i2p-${release.number}-sources.jar" />
2310        <gpgsignasc file="pkg-mavencentral/router-${release.number}.jar" />
2311        <gpgsignasc file="pkg-mavencentral/router-${release.number}.pom" />
2312        <gpgsignasc file="pkg-mavencentral/router-${release.number}-javadoc.jar" />
2313        <gpgsignasc file="pkg-mavencentral/router-${release.number}-sources.jar" />
2314        <gpgsignasc file="pkg-mavencentral/mstreaming-${release.number}.jar" />
2315        <gpgsignasc file="pkg-mavencentral/mstreaming-${release.number}.pom" />
2316        <gpgsignasc file="pkg-mavencentral/mstreaming-${release.number}-javadoc.jar" />
2317        <gpgsignasc file="pkg-mavencentral/mstreaming-${release.number}-sources.jar" />
2318        <gpgsignasc file="pkg-mavencentral/streaming-${release.number}.jar" />
2319        <gpgsignasc file="pkg-mavencentral/streaming-${release.number}.pom" />
2320        <gpgsignasc file="pkg-mavencentral/streaming-${release.number}-javadoc.jar" />
2321        <gpgsignasc file="pkg-mavencentral/streaming-${release.number}-sources.jar" />
2322        <gpgsignasc file="pkg-mavencentral/servlet-i2p-${release.number}.jar" />
2323        <gpgsignasc file="pkg-mavencentral/servlet-i2p-${release.number}.pom" />
2324        <gpgsignasc file="pkg-mavencentral/servlet-i2p-${release.number}-javadoc.jar" />
2325        <gpgsignasc file="pkg-mavencentral/servlet-i2p-${release.number}-sources.jar" />
2326        <!-- Bundle -->
2327        <jar destfile="mavencentral-i2p.jar">
2328            <fileset dir="./pkg-mavencentral">
2329                <include name="i2p-*" />
2330            </fileset>
2331        </jar>
2332        <jar destfile="mavencentral-router.jar">
2333            <fileset dir="./pkg-mavencentral">
2334                <include name="router-*" />
2335            </fileset>
2336        </jar>
2337        <jar destfile="mavencentral-mstreaming.jar">
2338            <fileset dir="./pkg-mavencentral">
2339                <include name="mstreaming-*" />
2340            </fileset>
2341        </jar>
2342        <jar destfile="mavencentral-streaming.jar">
2343            <fileset dir="./pkg-mavencentral">
2344                <include name="streaming-*" />
2345            </fileset>
2346        </jar>
2347        <jar destfile="mavencentral-servlet-i2p.jar">
2348            <fileset dir="./pkg-mavencentral">
2349                <include name="servlet-i2p-*" />
2350            </fileset>
2351        </jar>
2352        <echo message="Now upload mavencentral-*.jar to Maven Central." />
2353    </target>
2354
2355    <target name="debian" depends="debian-clean, debchange, debian-binary" />
2356
2357    <target name="getExtendedVersion" depends="buildProperties, trimMtnRev">
2358        <property name="MtnShortHash" value="unknown" />
2359        <condition property="Extended.Version" value="${full.version}-${MtnShortHash}">
2360            <not>
2361                <or>
2362                    <equals arg1="${MtnShortHash}" arg2="" />
2363                    <equals arg1="${MtnShortHash}" arg2="unknown" />
2364                </or>
2365            </not>
2366        </condition>
2367        <!-- if not set above we'll set it here -->
2368        <property name="Extended.Version" value="${full.version}" />
2369    </target>
2370
2371    <target name="debchange" depends="getExtendedVersion" unless="noAutoDebchange">
2372        <echo message= "Debian version is ${Extended.Version}-1" />
2373        <exec executable="dch" failonerror="true">
2374            <arg value="-b" />
2375            <arg value="--check-dirname-level" />
2376            <arg value="0" />
2377            <arg value="-v" />
2378            <arg value="${Extended.Version}-1" />
2379            <arg value="Unofficial Debian package built using &quot;ant debian&quot;" />
2380        </exec>
2381    </target>
2382
2383    <target name="debian-binary" depends="getExtendedVersion">
2384        <exec executable="fakeroot" failonerror="true">
2385            <arg value="debian/rules" />
2386            <arg value="patch" />
2387            <arg value="binary" />
2388            <arg value="clean" />
2389        </exec>
2390        <delete dir=".pc" />
2391        <move todir=".">
2392            <fileset dir=".." includes="libjbigi*${release.number}*.deb i2p*${release.number}*.deb" />
2393        </move>
2394        <echo message="" />
2395        <echo message="====================" />
2396        <echo message="Packages have been built and moved to ${basedir}" />
2397        <echo message="====================" />
2398    </target>
2399
2400    <target name="debian-clean" depends="getExtendedVersion" >
2401        <exec executable="fakeroot" failonerror="true">
2402            <arg value="debian/rules" />
2403            <arg value="clean" />
2404        </exec>
2405        <delete dir="./.pc" />
2406    </target>
2407
2408    <!-- stretch+, zesty+ -->
2409    <target name="debian-tarball" depends="getExtendedVersion, failIfNoMtn">
2410        <!-- this will use the monotonerc file in the current workspace -->
2411        <property name="debian.tarball.name" value="i2p_${Extended.Version}.orig.tar.bz2" />
2412        <echo message="Checking out fresh copy into ../i2p-${Extended.Version} for tarballing:" />
2413        <delete dir="../i2p-${Extended.Version}" />
2414        <exec executable="mtn" failonerror="true">
2415            <arg value="co" />
2416            <!-- w: is the revision of the current workspace -->
2417            <arg value="-r" />
2418            <arg value="w:" />
2419            <arg value="../i2p-${Extended.Version}" />
2420        </exec>
2421        <delete includeemptydirs="true" quiet="false" failonerror="false">
2422            <fileset dir="../i2p-${Extended.Version}/debian-alt/" />
2423            <fileset dir="../i2p-${Extended.Version}/installer/" includes="*.xml" />
2424            <fileset dir="../i2p-${Extended.Version}/installer/c/" />
2425            <fileset dir="../i2p-${Extended.Version}/installer/doc/" />
2426            <fileset dir="../i2p-${Extended.Version}/installer/lib/" />
2427            <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" />
2428            <fileset dir="../i2p-${Extended.Version}/installer/resources/Start I2P Router.app/" />
2429            <fileset dir="../i2p-${Extended.Version}/installer/resources/portable/" />
2430            <fileset dir="../i2p-${Extended.Version}/installer/resources/small/" />
2431            <fileset dir="../i2p-${Extended.Version}/Slackware" />
2432            <fileset dir="../i2p-${Extended.Version}/_MTN" />
2433            <fileset dir="../i2p-${Extended.Version}/.idea" />
2434            <fileset dir="../i2p-${Extended.Version}/.tx" />
2435            <file name="../i2p-${Extended.Version}/.mtn-ignore" />
2436            <fileset dir="../i2p-${Extended.Version}/" includes="Docker*" />
2437            <file name="../i2p-${Extended.Version}/Makefile.gcj" />
2438            <fileset dir="../i2p-${Extended.Version}/docs" />
2439            <fileset dir="../i2p-${Extended.Version}/launchers" />
2440            <file name="../i2p-${Extended.Version}/.travis.yml" />
2441            <file name="../i2p-${Extended.Version}/.gitignore" />
2442            <!-- gradle files -->
2443            <fileset dir="../i2p-${Extended.Version}/" includes="**/build.gradle" />
2444            <fileset dir="../i2p-${Extended.Version}/gradle" />
2445            <file name="../i2p-${Extended.Version}/gradlew" />
2446            <file name="../i2p-${Extended.Version}/gradlew.bat" />
2447            <file name="../i2p-${Extended.Version}/gradle.properties" />
2448            <file name="../i2p-${Extended.Version}/settings.gradle" />
2449            <!-- gettext-base -->
2450            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/gettext" />
2451            <!-- libgetopt-java -->
2452            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/getopt" />
2453            <!-- libhttpclient-java and libhttpcore-java -->
2454          <!--
2455            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/apache/http" />
2456           -->
2457            <!-- geoip-database -->
2458            <file name="../i2p-${Extended.Version}/installer/resources/geoip.txt" />
2459            <file name="../i2p-${Extended.Version}/installer/resources/geoipv6.dat.gz" />
2460            <!-- libjetty9-java -->
2461            <fileset dir="../i2p-${Extended.Version}/apps/jetty/jetty-distribution-${jetty.ver}" />
2462            <!-- libtomcat8-java -->
2463            <fileset dir="../i2p-${Extended.Version}/apps/jetty/apache-tomcat-${tomcat.ver}" />
2464            <!-- libjstl1.1-java or glassfish-javaee or libtaglibs-standard -->
2465            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/jstl.jar" />
2466            <!-- libjakarta-taglibs-standard-java or glassfish-javaee or libtaglibs-standard -->
2467            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/standard.jar" />
2468            <fileset dir="../i2p-${Extended.Version}/installer/resources/icons/flags" />
2469            <!-- anything added above, add in debian-release-tarball also -->
2470        </delete>
2471        <tar longfile="gnu" destfile="../${debian.tarball.name}" compression="bzip2">
2472            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${Extended.Version}">
2473                <include name="**/**" />
2474                <exclude name="debian/**"/>
2475                <exclude name="**/*.sh"/>
2476                <!-- anything added above, add in debian-release-tarball also -->
2477            </tarfileset>
2478            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${Extended.Version}" filemode="755">
2479                <exclude name="debian/**" />
2480                <include name="**/*.sh" />
2481            </tarfileset>
2482        </tar>
2483    </target>
2484
2485    <!-- same as debian-release-tarball but with bundled jetty
2486      -  We add a 'p' to the release name and tarball since the source package is different;
2487      -  Launchpad does not allow different source packages with the same name.
2488      -->
2489    <target name="precise-release-tarball" depends="getExtendedVersion, failIfNoMtn">
2490        <property name="debian.tarball.name" value="i2p_${release.number}p.orig.tar.bz2" />
2491        <echo message="Checking out fresh copy into ../i2p-${Extended.Version} for tarballing:" />
2492        <delete dir="../i2p-${Extended.Version}" />
2493        <exec executable="mtn" failonerror="true">
2494            <arg value="co" />
2495            <!-- w: is the revision of the current workspace -->
2496            <arg value="-r" />
2497            <arg value="w:" />
2498            <arg value="-b" />
2499            <arg value="i2p.i2p" />
2500            <arg value="../i2p-${Extended.Version}" />
2501        </exec>
2502        <delete includeemptydirs="true" quiet="false" failonerror="false">
2503            <fileset dir="../i2p-${Extended.Version}/debian-alt/" />
2504            <fileset dir="../i2p-${Extended.Version}/installer/" includes="*.xml" />
2505            <fileset dir="../i2p-${Extended.Version}/installer/c/" />
2506            <fileset dir="../i2p-${Extended.Version}/installer/doc/" />
2507            <fileset dir="../i2p-${Extended.Version}/installer/lib/" />
2508            <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" />
2509            <fileset dir="../i2p-${Extended.Version}/installer/resources/Start I2P Router.app/" />
2510            <fileset dir="../i2p-${Extended.Version}/installer/resources/portable/" />
2511            <fileset dir="../i2p-${Extended.Version}/installer/resources/small/" />
2512            <fileset dir="../i2p-${Extended.Version}/Slackware" />
2513            <fileset dir="../i2p-${Extended.Version}/_MTN" />
2514            <fileset dir="../i2p-${Extended.Version}/.idea" />
2515            <fileset dir="../i2p-${Extended.Version}/.tx" />
2516            <file name="../i2p-${Extended.Version}/.mtn-ignore" />
2517            <fileset dir="../i2p-${Extended.Version}/" includes="Docker*" />
2518            <file name="../i2p-${Extended.Version}/Makefile.gcj" />
2519            <fileset dir="../i2p-${Extended.Version}/docs" />
2520            <fileset dir="../i2p-${Extended.Version}/launchers" />
2521            <file name="../i2p-${Extended.Version}/.travis.yml" />
2522            <file name="../i2p-${Extended.Version}/.gitignore" />
2523            <!-- gradle files -->
2524            <fileset dir="../i2p-${Extended.Version}/" includes="**/build.gradle" />
2525            <fileset dir="../i2p-${Extended.Version}/gradle" />
2526            <file name="../i2p-${Extended.Version}/gradlew" />
2527            <file name="../i2p-${Extended.Version}/gradlew.bat" />
2528            <file name="../i2p-${Extended.Version}/gradle.properties" />
2529            <file name="../i2p-${Extended.Version}/settings.gradle" />
2530            <!-- gettext-base -->
2531            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/gettext" />
2532            <!-- libgetopt-java -->
2533            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/getopt" />
2534            <!-- libhttpclient-java and libhttpcore-java -->
2535          <!--
2536            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/apache/http" />
2537           -->
2538            <!-- geoip-database -->
2539            <file name="../i2p-${Extended.Version}/installer/resources/geoip.txt" />
2540            <file name="../i2p-${Extended.Version}/installer/resources/geoipv6.dat.gz" />
2541            <!-- libjetty9-java -->
2542          <!--
2543            <fileset dir="../i2p-${Extended.Version}/apps/jetty/jetty-distribution-${jetty.ver}" />
2544            <fileset dir="../i2p-${Extended.Version}/apps/jetty/apache-tomcat-${tomcat.ver}" />
2545           -->
2546            <!-- libjstl1.1-java or glassfish-javaee -->
2547          <!--
2548            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/jstl.jar" />
2549           -->
2550            <!-- libjakarta-taglibs-standard-java or glassfish-javaee -->
2551            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/standard.jar" />
2552            <!-- famfamfam-flag-png is in trusty but not precise, so leave them in the source package for both -->
2553            <!-- anything added above, add in debian-release-tarball also -->
2554        </delete>
2555        <tar longfile="gnu" destfile="../${debian.tarball.name}" compression="bzip2">
2556            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${Extended.Version}">
2557                <include name="**/**" />
2558                <exclude name="debian/**"/>
2559                <exclude name="**/*.sh"/>
2560                <!-- anything added above, add in debian-release-tarball also -->
2561            </tarfileset>
2562            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${Extended.Version}" filemode="755">
2563                <exclude name="debian/**" />
2564                <include name="**/*.sh" />
2565            </tarfileset>
2566        </tar>
2567    </target>
2568
2569    <!-- xenial/yakkety only -->
2570    <!-- same as debian-release-tarball but with bundled jstl.jar
2571         (there's no libtaglibs-standard-* packages)
2572      -  We add a 'x' to the release name and tarball since the source package is different;
2573      -  Launchpad does not allow different source packages with the same name.
2574      -->
2575    <target name="xenial-release-tarball" depends="getExtendedVersion, failIfNoMtn">
2576        <property name="debian.tarball.name" value="i2p_${release.number}x.orig.tar.bz2" />
2577        <echo message="Checking out fresh copy into ../i2p-${Extended.Version} for tarballing:" />
2578        <delete dir="../i2p-${Extended.Version}" />
2579        <exec executable="mtn" failonerror="true">
2580            <arg value="co" />
2581            <!-- w: is the revision of the current workspace -->
2582            <arg value="-r" />
2583            <arg value="w:" />
2584            <arg value="-b" />
2585            <arg value="i2p.i2p" />
2586            <arg value="../i2p-${Extended.Version}" />
2587        </exec>
2588        <delete includeemptydirs="true" quiet="false" failonerror="false">
2589            <fileset dir="../i2p-${Extended.Version}/debian-alt/" />
2590            <fileset dir="../i2p-${Extended.Version}/installer/" includes="*.xml" />
2591            <fileset dir="../i2p-${Extended.Version}/installer/c/" />
2592            <fileset dir="../i2p-${Extended.Version}/installer/doc/" />
2593            <fileset dir="../i2p-${Extended.Version}/installer/lib/" />
2594            <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" />
2595            <fileset dir="../i2p-${Extended.Version}/installer/resources/Start I2P Router.app/" />
2596            <fileset dir="../i2p-${Extended.Version}/installer/resources/portable/" />
2597            <fileset dir="../i2p-${Extended.Version}/installer/resources/small/" />
2598            <fileset dir="../i2p-${Extended.Version}/Slackware" />
2599            <fileset dir="../i2p-${Extended.Version}/_MTN" />
2600            <fileset dir="../i2p-${Extended.Version}/.idea" />
2601            <fileset dir="../i2p-${Extended.Version}/.tx" />
2602            <file name="../i2p-${Extended.Version}/.mtn-ignore" />
2603            <fileset dir="../i2p-${Extended.Version}/" includes="Docker*" />
2604            <file name="../i2p-${Extended.Version}/Makefile.gcj" />
2605            <fileset dir="../i2p-${Extended.Version}/docs" />
2606            <fileset dir="../i2p-${Extended.Version}/launchers" />
2607            <file name="../i2p-${Extended.Version}/.travis.yml" />
2608            <file name="../i2p-${Extended.Version}/.gitignore" />
2609            <!-- gradle files -->
2610            <fileset dir="../i2p-${Extended.Version}/" includes="**/build.gradle" />
2611            <fileset dir="../i2p-${Extended.Version}/gradle" />
2612            <file name="../i2p-${Extended.Version}/gradlew" />
2613            <file name="../i2p-${Extended.Version}/gradlew.bat" />
2614            <file name="../i2p-${Extended.Version}/gradle.properties" />
2615            <file name="../i2p-${Extended.Version}/settings.gradle" />
2616            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/gettext" />
2617            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/getopt" />
2618          <!--
2619            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/apache/http" />
2620           -->
2621            <file name="../i2p-${Extended.Version}/installer/resources/geoip.txt" />
2622            <file name="../i2p-${Extended.Version}/installer/resources/geoipv6.dat.gz" />
2623            <fileset dir="../i2p-${Extended.Version}/apps/jetty/jetty-distribution-${jetty.ver}" />
2624            <fileset dir="../i2p-${Extended.Version}/apps/jetty/apache-tomcat-${tomcat.ver}" />
2625          <!--
2626            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/jstl.jar" />
2627           -->
2628            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/standard.jar" />
2629            <fileset dir="../i2p-${Extended.Version}/installer/resources/icons/flags" />
2630            <!-- anything added above, add in debian-tarball also -->
2631        </delete>
2632        <tar longfile="gnu" destfile="../${debian.tarball.name}" compression="bzip2">
2633            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${release.number}">
2634                <include name="**/**" />
2635                <exclude name="debian/**"/>
2636                <exclude name="**/*.sh"/>
2637                <!-- anything added above, add in debian-tarball also -->
2638            </tarfileset>
2639            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${release.number}" filemode="755">
2640                <exclude name="debian/**" />
2641                <include name="**/*.sh" />
2642            </tarfileset>
2643        </tar>
2644    </target>
2645
2646    <!-- stretch+, zesty+ -->
2647    <!-- same as debian-tarball but with a release tar.bz2 file name and tar prefix -->
2648    <target name="debian-release-tarball" depends="getExtendedVersion, failIfNoMtn">
2649        <property name="debian.tarball.name" value="i2p_${release.number}.orig.tar.bz2" />
2650        <echo message="Checking out fresh copy into ../i2p-${Extended.Version} for tarballing:" />
2651        <delete dir="../i2p-${Extended.Version}" />
2652        <exec executable="mtn" failonerror="true">
2653            <arg value="co" />
2654            <!-- w: is the revision of the current workspace -->
2655            <arg value="-r" />
2656            <arg value="w:" />
2657            <arg value="-b" />
2658            <arg value="i2p.i2p" />
2659            <arg value="../i2p-${Extended.Version}" />
2660        </exec>
2661        <delete includeemptydirs="true" quiet="false" failonerror="false">
2662            <fileset dir="../i2p-${Extended.Version}/debian-alt/" />
2663            <fileset dir="../i2p-${Extended.Version}/installer/" includes="*.xml" />
2664            <fileset dir="../i2p-${Extended.Version}/installer/c/" />
2665            <fileset dir="../i2p-${Extended.Version}/installer/doc/" />
2666            <fileset dir="../i2p-${Extended.Version}/installer/lib/" />
2667            <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" />
2668            <fileset dir="../i2p-${Extended.Version}/installer/resources/Start I2P Router.app/" />
2669            <fileset dir="../i2p-${Extended.Version}/installer/resources/portable/" />
2670            <fileset dir="../i2p-${Extended.Version}/installer/resources/small/" />
2671            <fileset dir="../i2p-${Extended.Version}/Slackware" />
2672            <fileset dir="../i2p-${Extended.Version}/_MTN" />
2673            <fileset dir="../i2p-${Extended.Version}/.idea" />
2674            <fileset dir="../i2p-${Extended.Version}/.tx" />
2675            <file name="../i2p-${Extended.Version}/.mtn-ignore" />
2676            <fileset dir="../i2p-${Extended.Version}/" includes="Docker*" />
2677            <file name="../i2p-${Extended.Version}/Makefile.gcj" />
2678            <fileset dir="../i2p-${Extended.Version}/docs" />
2679            <fileset dir="../i2p-${Extended.Version}/launchers" />
2680            <file name="../i2p-${Extended.Version}/.travis.yml" />
2681            <file name="../i2p-${Extended.Version}/.gitignore" />
2682            <!-- gradle files -->
2683            <fileset dir="../i2p-${Extended.Version}/" includes="**/build.gradle" />
2684            <fileset dir="../i2p-${Extended.Version}/gradle" />
2685            <file name="../i2p-${Extended.Version}/gradlew" />
2686            <file name="../i2p-${Extended.Version}/gradlew.bat" />
2687            <file name="../i2p-${Extended.Version}/gradle.properties" />
2688            <file name="../i2p-${Extended.Version}/settings.gradle" />
2689            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/gettext" />
2690            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/getopt" />
2691          <!--
2692            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/apache/http" />
2693           -->
2694            <file name="../i2p-${Extended.Version}/installer/resources/geoip.txt" />
2695            <file name="../i2p-${Extended.Version}/installer/resources/geoipv6.dat.gz" />
2696            <fileset dir="../i2p-${Extended.Version}/apps/jetty/jetty-distribution-${jetty.ver}" />
2697            <fileset dir="../i2p-${Extended.Version}/apps/jetty/apache-tomcat-${tomcat.ver}" />
2698            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/jstl.jar" />
2699            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/standard.jar" />
2700            <fileset dir="../i2p-${Extended.Version}/installer/resources/icons/flags" />
2701            <!-- anything added above, add in debian-tarball also -->
2702        </delete>
2703        <tar longfile="gnu" destfile="../${debian.tarball.name}" compression="bzip2">
2704            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${release.number}">
2705                <include name="**/**" />
2706                <exclude name="debian/**"/>
2707                <exclude name="**/*.sh"/>
2708                <!-- anything added above, add in debian-tarball also -->
2709            </tarfileset>
2710            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${release.number}" filemode="755">
2711                <exclude name="debian/**" />
2712                <include name="**/*.sh" />
2713            </tarfileset>
2714        </tar>
2715    </target>
2716
2717    <target name="debian-patch" depends="getExtendedVersion" >
2718        <exec executable="quilt" failonerror="true">
2719            <arg value="-a" />
2720            <arg value="push" />
2721        </exec>
2722        <echo message="====================" />
2723    </target>
2724    <target name="debian-unpatch" depends="buildProperties">
2725        <exec executable="quilt" failonerror="false">
2726            <arg value="-a" />
2727            <arg value="pop" />
2728        </exec>
2729    </target>
2730
2731    <target name="debianrepo" depends="debian">
2732        <exec dir="debian" executable="./makerepo.sh" failonerror="true"/>
2733    </target>
2734
2735<!-- the following are appened to help build barebone portable version,
2736     none of the above is modified for this purpose -->
2737        <target name = "pkg-portable-clean">
2738                <delete dir="build/" />
2739                <delete dir="pkg-temp/" />
2740                <delete>
2741                        <fileset dir="." includes="portable-**.zip**" />
2742                </delete>
2743        </target>
2744<!-- build a portable archive -->
2745
2746<!-- *0* Since we simply pack all files in folder "build/" into our archieve,
2747                we need to make sure its small, with NO redundent jars or wars.
2748                thus cleaning is required before each build-->
2749        <target name="buildSmallOnly" depends="pkg-portable-clean,buildSmall"/>
2750
2751<!-- *1* preparing the jars by OS dependent de-bloating -->
2752        <target name="preppkg-portable-win32-jbigi" depends="buildSmallOnly, jbigi-windows-only" />
2753
2754        <target name="preppkg-portable-linux-jbigi"  depends="buildSmallOnly, jbigi-linux-only" />
2755
2756<!-- *2* os independent procedure  -->
2757        <target name="preppkg-portable-basic" >
2758                <mkdir dir="pkg-temp" />
2759                        <!-- non OS dependent configurations only, dont add *nux/win stuff here -->
2760                        <copy todir="pkg-temp">
2761                                <fileset dir="installer/resources/portable/configs/" />
2762                        </copy>
2763                        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
2764                        <copy file="installer/resources/hosts.txt" todir="pkg-temp/" />
2765                        <copy file="installer/resources/readme.license.txt" todir="pkg-temp/" />
2766                <mkdir dir="pkg-temp/addressbook" />
2767                        <copy file="apps/addressbook/subscriptions.txt" todir="pkg-temp/addressbook/" />
2768                        <copy file="apps/addressbook/myhosts.txt"  todir="pkg-temp/addressbook/" />
2769                        <!-- config.txt is in installer/resources/portable -->
2770                <mkdir dir="pkg-temp/docs" />
2771                        <copy file="installer/resources/initialNews/initialNews.xml" tofile="pkg-temp/docs/news.xml" overwrite="true" />
2772                        <copy file="installer/resources/readme/readme.html" tofile="pkg-temp/docs/readme.html" />
2773                        <copy file="installer/resources/startconsole.html" todir="pkg-temp/docs/" />
2774                        <copy file="installer/resources/start.ico" todir="pkg-temp/docs/" />
2775                        <copy file="installer/resources/console.ico" todir="pkg-temp/docs/" />
2776                        <!-- HTTP Header files, english only,
2777                                if you need a different lang do it in a seperate target -->
2778                        <copy todir="pkg-temp/docs/" >
2779                                <fileset dir="installer/resources/proxy/"  includes="**-header.ht" />
2780                        </copy>
2781                        <!-- Theme light only -->
2782                        <copy todir="pkg-temp/docs/themes/console/light/" overwrite="true" >
2783                                <fileset dir="installer/resources/themes/console/light/" includes="**.css" />
2784                        </copy>
2785                        <copy file="installer/resources/themes/console/light/console_big.css" todir="portable/docs/themes/console/light/" />
2786                        <copy todir="pkg-temp/docs/themes/console/images/" >
2787                                <fileset dir="installer/resources/themes/console/images/" />
2788                        </copy>
2789                        <!-- FLAGs for language icon (not for ip)-->
2790                        <copy todir="pkg-temp/docs/icons" >
2791                                <fileset dir="installer/resources/icons" />
2792                        </copy>
2793                <mkdir dir="pkg-temp/webapps" />
2794                        <copy todir="pkg-temp/webapps/">
2795                                <fileset dir="build/" includes="**.war" />
2796                        </copy>
2797                <mkdir dir="pkg-temp/lib" />
2798                        <copy todir ="pkg-temp/lib/" >
2799                                <fileset dir="build/" includes="**.jar" />
2800                        </copy>
2801                        <!-- 3rd party jars from apps/  -->
2802                                <!-- jrobin - without jobin , you lost graph and get a lot error entry in logs -->
2803                        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
2804        </target>
2805<!-- *3* os dependent procedure/commands -->
2806        <target name = "preppkg-portable-win32" depends="preppkg-portable-win32-jbigi,preppkg-portable-basic">
2807                        <!--wrapper - dont even think about it. i2p cosumes appreantly more mem without it on win32-->
2808                <copy file="installer/lib/wrapper/win32/wrapper.dll" todir="pkg-temp/lib" />
2809                <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
2810                <copy file="installer/lib/wrapper/win32/I2Psvc.exe" tofile="pkg-temp/i2psvc.ex_" />
2811                        <!--  copy the unpack/start batchfiles -->
2812                <copy todir="pkg-temp">
2813                        <fileset dir="installer/resources/portable/win32/" />
2814                </copy>
2815        </target>
2816<!-- *4* command for windows package -->
2817        <target name = "pkg-portable-win32"     depends="preppkg-portable-win32, pack200" >
2818                <!-- i need the portable\ folder in .zip so basedir is set to . -->
2819                <move file="pkg-temp" tofile="portable"/>
2820                <zip destfile="portable-win32.zip" basedir="." level="9" includes="portable\**" />
2821                <checksum file="portable-win32.zip" forceOverwrite="yes"/>
2822                <move file="portable" tofile="pkg-temp"/>
2823        </target>
2824</project>
Note: See TracBrowser for help on using the repository browser.