source: build.xml @ 67e7e45

Last change on this file since 67e7e45 was 099cacd, checked in by zzz <zzz@…>, 12 months ago

Installer: Fix -console install for izpack 5 (ticket #2492)
Switch to izpack 5 for non-windows release installer

  • Property mode set to 100644
File size: 154.0 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.40" />
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 libjson-simple-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, buildI2PControl" />
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        <exec executable="date" outputproperty="epoch" errorproperty="dc.error" failifexecutionfails="true" >
300            <arg value="+%s" />
301        </exec>
302        <echo message="Epoch is: ${epoch}" />
303    </target>
304
305    <target name="bbLauncher" depends="build">
306        <sequential>
307            <exec executable="./sbt" dir="launchers" failonerror="true">
308                <arg value="browserbundle:clean" />
309            </exec>
310            <exec executable="./sbt" dir="launchers" failonerror="true">
311                <arg value="browserbundle:assembly" />
312            </exec>
313        </sequential>
314    </target>
315
316    <target name="osxLauncher" depends="build,preppkg-osx">
317        <sequential>
318            <exec executable="./sbt" dir="launchers" failonerror="true">
319                <arg value="macosx:cleanAllTask" />
320            </exec>
321            <exec executable="./sbt" dir="launchers" failonerror="true">
322                <arg value="macosx:buildAppBundleTask" />
323            </exec>
324        </sequential>
325    </target>
326
327    <target name="buildBOB" depends="buildStreaming" >
328        <ant dir="apps/BOB/" target="jar" />
329        <copy file="apps/BOB/dist/BOB.jar" todir="build/" />
330    </target>
331
332    <target name="buildSAM" depends="buildStreaming" >
333        <ant dir="apps/sam/java/" target="jar" />
334        <copy file="apps/sam/java/build/sam.jar" todir="build/" />
335    </target>
336
337    <target name="buildSusiMail" depends="buildCore, buildJetty" >
338        <ant dir="apps/susimail/" target="war" />
339        <copy file="apps/susimail/susimail.war" todir="build/" />
340    </target>
341
342    <!-- jar (not war) for testing only -->
343    <target name="buildSusiMailJar" depends="buildCore, buildJetty" >
344        <ant dir="apps/susimail/" target="jar" />
345        <copy file="apps/susimail/susimail.jar" todir="build/" />
346    </target>
347
348    <target name="buildSusiDNS" depends="buildCore, buildJetty, buildImagegen, buildAddressbook" >
349        <ant dir="apps/susidns/src" target="all" />
350        <copy file="apps/susidns/src/susidns.war" todir="build/" />
351    </target>
352
353    <target name="buildImagegen" depends="buildCore, buildJetty" >
354        <ant dir="apps/imagegen" target="build" />
355        <copy file="apps/imagegen/imagegen/build/imagegen.war" todir="build/" />
356    </target>
357
358    <target name="buildI2PControl" depends="buildRouter, buildJetty" >
359        <ant dir="apps/i2pcontrol" target="war" />
360        <copy file="apps/i2pcontrol/build/jsonrpc.war" todir="build/" />
361    </target>
362
363    <target name="buildI2PSnark" depends="buildStreaming, buildJetty, buildSystray" >
364        <ant dir="apps/i2psnark/java/" target="war" />
365        <copy file="apps/i2psnark/i2psnark.war" todir="build/" />
366        <copy file="apps/i2psnark/java/build/i2psnark.jar" todir="build/" />
367    </target>
368
369    <!-- jar (not war) for Android -->
370    <target name="buildAddressbookJar" depends="buildCore" >
371        <ant dir="apps/addressbook/" target="jar" />
372        <copy file="apps/addressbook/dist/addressbook.jar" todir="build/" />
373    </target>
374
375    <target name="buildAddressbook" depends="buildCore" >
376        <ant dir="apps/addressbook/" target="all" />
377        <copy file="apps/addressbook/dist/addressbook.jar" todir="build/" />
378        <!-- war is empty, only for updates -->
379        <copy file="apps/addressbook/dist/addressbook.war" todir="build/" />
380    </target>
381
382    <!-- Both jars and no war, for Android -->
383    <target name="buildI2PTunnelJars" depends="buildStreaming" >
384        <ant dir="apps/i2ptunnel/java/" target="uiJar" />
385        <copy file="apps/i2ptunnel/java/build/i2ptunnel.jar" todir="build/" />
386        <copy file="apps/i2ptunnel/java/build/i2ptunnel-ui.jar" todir="build/" />
387    </target>
388
389    <target name="buildI2PTunnel" depends="buildStreaming, buildJetty, buildImagegen" >
390        <ant dir="apps/i2ptunnel/java/" target="build" />
391        <copy file="apps/i2ptunnel/java/build/i2ptunnel.jar" todir="build/" />
392        <copy file="apps/i2ptunnel/java/build/i2ptunnel.war" todir="build/" />
393    </target>
394
395    <target name="buildDesktopGui" depends="buildCore, buildrouter, buildSystray" >
396        <ant dir="apps/desktopgui" target="jar" />
397        <copy file="apps/desktopgui/dist/desktopgui.jar" todir="build/" />
398    </target>
399
400    <target name="buildRouterConsole" depends="buildrouter, buildSystray, buildDesktopGui, buildJetty, buildJrobin" >
401        <ant dir="apps/routerconsole/java/" target="jar" />
402    </target>
403
404    <!-- newsxml.jar only (subset of routerconsole, no war) for Android -->
405    <target name="buildNewsXMLJar" depends="buildRouter" >
406        <ant dir="apps/routerconsole/java/" target="newsxmljar" />
407    </target>
408
409    <target name="buildJetty" depends="buildCore" >
410        <ant dir="apps/jetty" target="build" />
411        <copy todir="build/" >
412            <fileset dir="apps/jetty/jettylib" excludes="ant.jar" />
413        </copy>
414    </target>
415
416    <target name="buildSystray" depends="buildCore" >
417        <ant dir="apps/systray/java/" target="jar" />
418        <copy file="apps/systray/java/build/systray.jar" todir="build/" />
419    </target>
420
421    <target name="buildStreaming" depends="buildMinistreaming" >
422        <ant dir="apps/streaming/java/" target="jar" />
423        <copy file="apps/streaming/java/build/streaming.jar" todir="build/" />
424    </target>
425
426    <target name="buildMinistreaming" depends="buildCore" >
427        <ant dir="apps/ministreaming/java/" target="jar" />
428        <copy file="apps/ministreaming/java/build/mstreaming.jar" todir="build/" />
429    </target>
430
431    <target name="buildRouter" depends="buildrouter" />
432    <target name="buildrouter" depends="buildCore" >
433        <ant dir="router/java/" target="jar" />
434        <copy file="router/java/build/router.jar" todir="build/" />
435    </target>
436
437    <target name="buildCore" depends="buildProperties" >
438        <ant dir="core/java/" target="jar" />
439        <copy file="core/java/build/i2p.jar" todir="build/" />
440    </target>
441
442    <target name="buildJrobin" depends="buildCore" >
443        <ant dir="apps/jrobin/java/" target="jar" />
444        <copy file="apps/jrobin/java/build/jrobin.jar" todir="build/" />
445    </target>
446
447    <target name="buildProperties" depends="getMtnRev, getReleaseNumber, getBuildNumber, setBuildTimestamp, disableManifestClasspath" >
448        <!-- default if not set above -->
449        <property name="workspace.version" value="unknown" />
450        <!-- default if not set by setBuildTimestamp -->
451        <property name="build.timestamp" value="reproducible" />
452        <!-- default if not set by disableManifestClasspath -->
453        <property name="manifest.classpath.name" value="Class-Path" />
454        <property name="full.version" value="${release.number}-${i2p.build.number}${build.extra}" />
455        <echo message="Building version ${full.version} (mtn rev ${workspace.version})" />
456    </target>
457
458    <target name="setBuildTimestamp" unless="${build.reproducible}" >
459        <tstamp>
460            <format property="build.timestamp" pattern="yyyy-MM-dd HH:mm:ss z" timezone="UTC" locale="en" />
461        </tstamp>
462    </target>
463
464    <!-- Disable Class-Path in jar manifests by renaming it (Fedora) -->
465    <target name="disableManifestClasspath" if="${without-manifest-classpath}" >
466        <property name="manifest.classpath.name" value="Disabled-Class-Path" />
467    </target>
468
469    <target name="buildWEB" depends="buildRouterConsole" >
470        <copy file="apps/routerconsole/java/build/routerconsole.jar" todir="build/" />
471        <copy file="apps/routerconsole/java/build/routerconsole.war" todir="build/" />
472    </target>
473
474    <target name="buildTools" depends="buildrouter" >
475        <ant dir="installer/tools/java" target="jar" />
476        <copy file="installer/tools/java/build/tools.jar" todir="build/" />
477    </target>
478
479    <!-- end of sub-build.xml targets -->
480
481    <!-- monotone targets -->
482
483    <target name="checkForMtn" >
484        <available property="mtn.available" file="_MTN" type="dir" />
485    </target>
486
487    <target name="failIfNoMtn" depends="checkForMtn">
488        <fail message="This target cannot be used without Monotone! Use &quot;fakeroot debian/rules get-orig-source&quot; instead.">
489            <condition>
490                <not>
491                    <isset property="mtn.available" />
492                </not>
493            </condition>
494        </fail>
495    </target>
496
497    <target name="getMtnRev" depends="checkForMtn" if="mtn.available" >
498        <exec executable="mtn" outputproperty="workspace.version" errorproperty="mtn.error1" failifexecutionfails="false" >
499            <arg value="automate" />
500            <arg value="get_base_revision_id" />
501        </exec>
502    </target>
503
504    <target name="trimMtnRev" depends="getMtnRev">
505        <exec executable="cut" inputstring="${workspace.version}" outputproperty="MtnShortHash" errorproperty="cut.error1" failifexecutionfails="true" >
506            <arg value="-c" />
507            <arg value="1-8" />
508        </exec>
509        <echo message="Short version is: ${MtnShortHash}" />
510    </target>
511
512    <target name="checkIfBumped">
513        <exec executable="mtn" outputproperty="bumped" errorproperty="mtn.error2" failifexecutionfails="false" >
514            <arg value="ls" />
515            <arg value="ch" />
516            <arg value="router/java/src/net/i2p/router/RouterVersion.java" />
517        </exec>
518        <condition property="bumped.already">
519            <not>
520                <equals arg1="${bumped}" arg2=""/>
521            </not>
522        </condition>
523    </target>
524
525    <target name="bump" depends="bumpBuild" />
526    <target name="bumpBuild" depends="checkIfBumped, getBuildNumber" unless="bumped.already">
527        <exec executable="dc" outputproperty="new.i2p.build.number" errorproperty="dc.error" failifexecutionfails="true" >
528            <arg value="-e" />
529            <arg value="${i2p.build.number} 1 + n" />
530        </exec>
531        <echo message="Build number is now: ${new.i2p.build.number}${build.extra}" />
532        <replaceregexp byline="true" file="router/java/src/net/i2p/router/RouterVersion.java"
533            match='(^\s+public\s+final\s+static\s+long\s+BUILD\s+=\s+)[0-9]+;' replace='\1${new.i2p.build.number};'/>
534    </target>
535
536    <target name="revisions" depends="getReleaseNumber, getBuildNumber">
537        <!-- mtn log __brief __no-graph __to t:i2p-0.9.xx | cut -d ' ' -f 2 | sort | uniq -c | sort -rn -->
538        <exec executable="mtn" outputproperty="getrevisions1" errorproperty="reverror1" failifexecutionfails="true" >
539            <arg value="log" />
540            <arg value="--brief" />
541            <arg value="--no-graph" />
542            <arg value="--to" />
543            <arg value="t:i2p-${release.number}" />
544        </exec>
545        <exec executable="cut" inputstring="${getrevisions1}" outputproperty="getrevisions2" failifexecutionfails="true" >
546            <arg value="-d" />
547            <arg value=" " />
548            <arg value="-f" />
549            <arg value="2" />
550        </exec>
551        <exec executable="sort" inputstring="${getrevisions2}" outputproperty="getrevisions3" failifexecutionfails="true" >
552        </exec>
553        <exec executable="uniq" inputstring="${getrevisions3}" outputproperty="getrevisions4" failifexecutionfails="true" >
554            <arg value="-c" />
555        </exec>
556        <exec executable="sort" inputstring="${getrevisions4}" outputproperty="getrevisions5" failifexecutionfails="true" >
557            <arg value="-rn" />
558        </exec>
559        <echo message="Revisions since ${release.number}:" />
560        <echo message="${getrevisions5}" />
561    </target>
562
563    <!-- end monotone targets -->
564
565    <!-- launch4j targets -->
566
567    <condition property="noExe">
568        <not>
569            <!-- We only have launch4j binaries for the following systems -->
570            <and>
571                <or>
572                    <os arch="x86" />
573                    <os arch="i386" />
574                    <os arch="i586" />
575                    <os arch="i686" />
576                    <os arch="amd64" />
577                    <os arch="x86_64" />
578                </or>
579                <or>
580                    <os name="Linux" />
581                    <os family="windows" />
582                </or>
583            </and>
584        </not>
585    </condition>
586
587    <!-- this makes an empty build/launchi2p.jar and the build/i2p.exe for the no-wrapper windows startup, if possible -->
588    <target name="buildexe" depends="buildProperties, launch4j" unless="noExe">
589        <echo message="See the file &quot;build.properties&quot; if this step fails." />
590        <jar destfile="./build/launchi2p.jar">
591            <manifest>
592                <attribute name="Main-Class" value="net.i2p.router.RouterLaunch" />
593                <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" />
594                <attribute name="Built-By" value="${build.built-by}" />
595                <attribute name="Build-Date" value="${build.timestamp}" />
596                <attribute name="Base-Revision" value="${workspace.version}" />
597            </manifest>
598        </jar>
599        <!-- now the standalone launcher exe -->
600        <launch4j configFile="./installer/i2pstandalone.xml" />
601        <!-- thazzit -->
602    </target>
603
604    <target name="launch4j">
605        <taskdef name="launch4j"
606                 classname="net.sf.launch4j.ant.Launch4jTask"
607                 classpath="${basedir}/installer/lib/launch4j/launch4j.jar:${basedir}/installer/lib/launch4j/lib/xstream.jar" />
608     </target>
609
610    <!-- end launch4j targets -->
611
612     <!--
613          the files are now copied to the build directory
614          in the build* targets
615      -->
616     <target name="jar" depends="jarSmall" />
617     <target name="jarSmall" depends="builddepSmall" />
618
619    <!-- Custom target to collect the jars that I2P-Bote needs to compile, so it can compile from source. -->
620    <target name="jarBote" depends="buildRouter, buildStreaming, buildJetty" >
621        <copy file="apps/susidns/src/lib/jstl.jar" todir="build/" />
622        <copy file="apps/susidns/src/lib/standard.jar" todir="build/" />
623    </target>
624
625    <!-- jbigi targets -->
626
627    <target name="jbigi-list-changes" depends="checkForMtn" if="mtn.available">
628        <exec executable="mtn" outputproperty="workspace.changes.jbigi" errorproperty="mtn.error.jbigi" failifexecutionfails="false" >
629            <arg value="list" />
630            <arg value="changed" />
631            <arg value="installer/lib/jbigi" />
632        </exec>
633        <!-- \n in an attribute value generates an invalid manifest -->
634        <exec executable="tr" inputstring="${workspace.changes.jbigi}" outputproperty="workspace.changes.jbigi.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
635            <arg value="-s" />
636            <arg value="&quot;[:space:]&quot;" />
637            <arg value="," />
638        </exec>
639    </target>
640
641    <target name="jbigi" depends="buildProperties, jbigi-list-changes">
642        <!-- set if unset -->
643        <property name="workspace.changes.jbigi.tr" value="" />
644        <mkdir dir="./build" />
645        <jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
646            <fileset dir="installer/lib/jbigi" includes="*.so *.dll *.jnilib" />
647            <manifest>
648                <attribute name="Built-By" value="${build.built-by}" />
649                <attribute name="Build-Date" value="${build.timestamp}" />
650                <attribute name="Base-Revision" value="${workspace.version}" />
651                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
652            </manifest>
653        </jar>
654    </target>
655
656    <target name="jbigi-nowindows" depends="buildProperties, jbigi-list-changes">
657        <!-- set if unset -->
658        <property name="workspace.changes.jbigi.tr" value="" />
659        <delete file="build/jbigi.jar" failonerror="false" quiet="true" />
660        <jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
661            <fileset dir="installer/lib/jbigi" includes="*.so *.jnilib" />
662            <manifest>
663                <attribute name="Built-By" value="${build.built-by}" />
664                <attribute name="Build-Date" value="${build.timestamp}" />
665                <attribute name="Base-Revision" value="${workspace.version}" />
666                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
667            </manifest>
668        </jar>
669    </target>
670
671    <!-- Now system-specific jbigis in alphabetical order -->
672    <target name="jbigi-freebsd-only"  depends="buildProperties, jbigi-list-changes">
673        <!-- set if unset -->
674        <property name="workspace.changes.jbigi.tr" value="" />
675        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
676            <fileset dir="installer/lib/jbigi" includes="*bsd*.so" />
677            <manifest>
678                <attribute name="Built-By" value="${build.built-by}" />
679                <attribute name="Build-Date" value="${build.timestamp}" />
680                <attribute name="Base-Revision" value="${workspace.version}" />
681                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
682            </manifest>
683        </jar>
684    </target>
685
686    <target name="jbigi-linux-only"  depends="buildProperties, jbigi-list-changes">
687        <!-- set if unset -->
688        <property name="workspace.changes.jbigi.tr" value="" />
689        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
690            <fileset dir="installer/lib/jbigi" includes="*linux*.so" />
691            <manifest>
692                <attribute name="Built-By" value="${build.built-by}" />
693                <attribute name="Build-Date" value="${build.timestamp}" />
694                <attribute name="Base-Revision" value="${workspace.version}" />
695                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
696            </manifest>
697        </jar>
698    </target>
699
700    <target name="jbigi-linux-x86-only"  depends="buildProperties, jbigi-list-changes">
701        <!-- set if unset -->
702        <property name="workspace.changes.jbigi.tr" value="" />
703        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
704            <fileset dir="installer/lib/jbigi" includes="*linux*.so" excludes="*linux-arm*.so,*linux-ppc*.so" />
705            <manifest>
706                <attribute name="Built-By" value="${build.built-by}" />
707                <attribute name="Build-Date" value="${build.timestamp}" />
708                <attribute name="Base-Revision" value="${workspace.version}" />
709                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
710            </manifest>
711        </jar>
712    </target>
713
714
715    <target name="jbigi-linux-nonx86-only"  depends="buildProperties, jbigi-list-changes">
716        <!-- set if unset -->
717        <property name="workspace.changes.jbigi.tr" value="" />
718        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
719            <fileset dir="installer/lib/jbigi" includes="*linux-arm*.so,*linux-ppc*.so" />
720            <manifest>
721                <attribute name="Built-By" value="${build.built-by}" />
722                <attribute name="Build-Date" value="${build.timestamp}" />
723                <attribute name="Base-Revision" value="${workspace.version}" />
724                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
725            </manifest>
726        </jar>
727    </target>
728
729    <target name="jbigi-osx-only"  depends="buildProperties, jbigi-list-changes" >
730        <!-- set if unset -->
731        <property name="workspace.changes.jbigi.tr" value="" />
732        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
733            <fileset dir="installer/lib/jbigi" includes="*.jnilib" />
734            <manifest>
735                <attribute name="Built-By" value="${build.built-by}" />
736                <attribute name="Build-Date" value="${build.timestamp}" />
737                <attribute name="Base-Revision" value="${workspace.version}" />
738                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
739            </manifest>
740        </jar>
741    </target>
742
743    <target name="jbigi-windows-only" depends="buildProperties, jbigi-list-changes" >
744        <!-- set if unset -->
745        <property name="workspace.changes.jbigi.tr" value="" />
746        <delete file="build/jbigi.jar" failonerror="false" quiet="true" />
747        <jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
748            <fileset dir="installer/lib/jbigi" includes="*windows*.dll" />
749            <manifest>
750                <attribute name="Built-By" value="${build.built-by}" />
751                <attribute name="Build-Date" value="${build.timestamp}" />
752                <attribute name="Base-Revision" value="${workspace.version}" />
753                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
754            </manifest>
755        </jar>
756    </target>
757
758    <!-- end jbigi targets -->
759
760    <target name="poupdate-source" depends="set-lg2-en, poupdate" />
761
762    <target name="set-lg2-en" >
763        <property name="lg2" value="en" />
764    </target>
765
766    <!-- the apps need to compile the jsps to poupdate -->
767    <target name="poupdate" depends="buildRouter, buildStreaming, buildSystray, buildJetty, buildDesktopGui, buildJrobin" >
768        <echo message="Setting environment variable LG2 to a lang code (eg: de,zh,nl etc)" />
769        <echo message=" will restrict language update to the language you specified, leaving other language untact." />
770        <!-- set if unset -->
771        <property name="lg2" value="" />
772        <ant dir="apps/routerconsole/java/" >
773            <target name="poupdate" />
774            <target name="poupdate-news" />
775            <target name="poupdate-countries" />
776        </ant>
777        <ant dir="apps/i2psnark/java/" target="poupdate" />
778        <ant dir="apps/i2ptunnel/java/" >
779            <target name="poupdate" />
780            <target name="poupdate-proxy" />
781        </ant>
782        <ant dir="apps/susidns/src/" target="poupdate" />
783        <ant dir="apps/susimail/" target="poupdate" />
784        <ant dir="apps/desktopgui" target="poupdate" />
785        <ant dir="installer/resources/locale" target="poupdate" />
786        <ant dir="apps/ministreaming/java" target="poupdate" />
787    </target>
788
789    <condition property="no.bundle">
790        <isfalse value="${require.gettext}" />
791    </condition>
792
793    <target name="prep-script-translation" unless="no.bundle" >
794        <!-- script translation added in 0.8.13, enabled in 0.9.5. -->
795        <ant dir="installer/resources/locale" target="bundle" />
796        <copy todir="pkg-temp/locale/">
797            <fileset dir="installer/resources/locale/mo/" />
798        </copy>
799    </target>
800
801    <target name="javadoc" depends="getReleaseNumber, getBuildNumber" >
802        <ant dir="apps/jetty" target="ensureJettylib" />
803        <mkdir dir="./build" />
804        <mkdir dir="./build/javadoc" />
805        <javadoc access="package"
806            source="${javac.version}"
807            destdir="./build/javadoc"
808            packagenames="*"
809            use="true"
810            splitindex="true"
811            failonerror="true"
812            additionalparam="-notimestamp"
813            doctitle="I2P Javadocs for Release ${release.number} Build ${i2p.build.number}${build.extra}"
814            windowtitle="I2P Anonymous Network - Java Documentation - Version ${release.number}">
815            <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:org.json.simple:org.json.simple.*:com.southernstorm.noise.crypto.x25519:com.southernstorm.noise.crypto.chacha20" />
816            <group title="Streaming Library" packages="net.i2p.client.streaming:net.i2p.client.streaming.impl" />
817            <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.*:com.southernstorm.noise.*" />
818            <group title="Router Console" packages="net.i2p.router.web:net.i2p.router.web.*:net.i2p.router.update:net.i2p.router.sybil:edu.internet2.ndt:net.i2p.router.news:com.vuze.*" />
819            <!-- apps and bridges starting here, alphabetical please -->
820            <group title="Addressbook Application" packages="net.i2p.addressbook:net.i2p.router.naming:net.metanotion:net.metanotion.*" />
821            <group title="BOB Bridge" packages="net.i2p.BOB" />
822            <group title="BOB Demos" packages="net.i2p.BOB.Demos.echo.echoclient:net.i2p.BOB.Demos.echo.echoserver" />
823            <group title="Desktopgui Application" packages="net.i2p.desktopgui:net.i2p.desktopgui.*" />
824            <group title="I2PControl Application" packages="net.i2p.i2pcontrol:net.i2p.i2pcontrol.*:org.mindrot.jbcrypt:com.thetransactioncompany.jsonrpc2:com.thetransactioncompany.jsonrpc2.*" />
825            <group title="I2PSnark Application" packages="org.klomp.snark:org.klomp.snark.*" />
826            <group title="I2PTunnel Application" packages="net.i2p.i2ptunnel:net.i2p.i2ptunnel.*" />
827            <group title="Imagegen Application" packages="com.docuverse.identicon:com.google.zxing:com.google.zxing.*:net.i2p.imagegen" />
828            <group title="Installer Utilities" packages="net.i2p.installer" />
829            <group title="Jetty Utilities" packages="net.i2p.jetty:net.i2p.servlet:net.i2p.servlet.*" />
830            <group title="JRobin Library" packages="org.jrobin:org.jrobin.*:engine.misc" />
831            <group title="SAM Bridge" packages="net.i2p.sam" />
832            <group title="SAM Demos" packages="net.i2p.sam.client" />
833            <group title="SusiDNS Application" packages="i2p.susi.dns:net.i2p.addressbook.servlet" />
834            <group title="SusiMail Application" packages="i2p.susi.webmail:i2p.susi.webmail.*:i2p.susi.debug:i2p.susi.util" />
835            <group title="Systray Application" packages="net.i2p.apps.systray" />
836            <sourcepath>
837                <pathelement location="core/java/src" />
838                <pathelement location="router/java/src" />
839                <pathelement location="apps/ministreaming/java/src" />
840                <pathelement location="apps/streaming/java/src" />
841                <pathelement location="apps/i2ptunnel/java/src" />
842                <pathelement location="apps/systray/java/src" />
843                <pathelement location="apps/desktopgui/src" />
844                <pathelement location="apps/routerconsole/java/src" />
845                <pathelement location="apps/addressbook/java/src" />
846                <pathelement location="apps/i2psnark/java/src" />
847                <pathelement location="apps/sam/java/src" />
848                <pathelement location="apps/BOB/src" />
849                <pathelement location="apps/BOB/Demos/echo/echoclient/src" />
850                <pathelement location="apps/BOB/Demos/echo/echoserver/src" />
851                <pathelement location="apps/susidns/src/java/src" />
852                <pathelement location="apps/susimail/src/src" />
853                <pathelement location="apps/jetty/java/src" />
854                <pathelement location="apps/imagegen/imagegen/webapp/src/main/java" />
855                <pathelement location="apps/imagegen/identicon/core/src/main/java" />
856                <pathelement location="apps/imagegen/zxing/core/src/main/java" />
857                <pathelement location="apps/imagegen/zxing/javase/src/main/java" />
858                <pathelement location="apps/jrobin/java/src" />
859                <pathelement location="installer/java/src" />
860                <pathelement location="apps/i2pcontrol/java" />
861            </sourcepath>
862            <classpath>
863                <!-- warning, some entries are needed for Debian builds only -->
864                <pathelement location="apps/jetty/jettylib/org.mortbay.jetty.jar" />
865                <pathelement location="apps/jetty/jettylib/jasper-runtime.jar" />
866                <pathelement location="apps/jetty/jettylib/javax.servlet.jar" />
867                <pathelement location="apps/jetty/jettylib/jetty-deploy.jar" />
868                <pathelement location="apps/jetty/jettylib/jetty-http.jar" />
869                <pathelement location="apps/jetty/jettylib/jetty-security.jar" />
870                <pathelement location="apps/jetty/jettylib/jetty-servlet.jar" />
871                <pathelement location="apps/jetty/jettylib/jetty-servlets.jar" />
872                <pathelement location="apps/jetty/jettylib/jetty-start.jar" />
873                <pathelement location="apps/jetty/jettylib/jetty-util.jar" />
874                <pathelement location="apps/jetty/jettylib/jetty-webapp.jar" />
875                <pathelement location="apps/jetty/jettylib/jetty-xml.jar" />
876                <pathelement location="apps/jetty/jettylib/tomcat-api.jar" />
877                <pathelement location="installer/lib/wrapper/all/wrapper.jar" />
878                <!-- following are only for debian builds -->
879                <pathelement location="core/java/build/libintl.jar" />
880                <pathelement location="core/java/build/gnu-getopt.jar" />
881                <pathelement location="core/java/build/json-simple.jar" />
882            </classpath>
883            <!-- These variables are stored in build.properties.
884                  End-users can override by creating the file override.properties -->
885            <link offline="true" href="${javasedocs.url}" packagelistLoc="installer/resources/package-lists/java/" />
886            <link offline="true" href="${javaeedocs.url}" packagelistLoc="installer/resources/package-lists/javaee/" />
887            <link offline="true" href="${jettydocs.url}" packagelistLoc="installer/resources/package-lists/jetty/" />
888            <link offline="true" href="${wrapperdocs.url}" packagelistLoc="installer/resources/package-lists/wrapper/" />
889        </javadoc>
890    </target>
891
892    <target name="javadoc-zip" depends="javadoc">
893        <zip destfile="javadoc.zip" basedir="build" level="9" includes="javadoc\**" />
894    </target>
895
896    <target name="javadoc-test" depends="buildRouter, javadoc" >
897        <mkdir dir="./build" />
898        <mkdir dir="./build/javadoc-test" />
899
900        <!-- set junit home to the old default unless overridden elsewhere -->
901        <property name="junit.home" value="${ant.home}/lib/" />
902        <javadoc access="package"
903            destdir="./build/javadoc-test"
904            packagenames="*"
905            use="true"
906            splitindex="true"
907            doctitle="I2P Unit Test Javadocs for Release ${release.number} Build ${i2p.build.number}${build.extra}"
908            windowtitle="I2P Anonymous Network - Java Documentation - Version ${release.number}">
909            <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.*" />
910            <group title="Router" packages="net.i2p.router:net.i2p.router.*:net.i2p.data.i2np:org.cybergarage.*:org.freenetproject:org.xlattice.crypto.filters" />
911            <sourcepath>
912                <pathelement location="core/java/test/junit" />
913                <pathelement location="router/java/test/junit" />
914                <pathelement location="core/java/test/scalatest" />
915            </sourcepath>
916            <classpath>
917                <pathelement location="build/i2p.jar" />
918                <pathelement location="build/router.jar" />
919                <pathelement location="${junit.home}/junit4.jar" />
920                <pathelement location="${hamcrest.home}/hamcrest-all.jar" />
921            </classpath>
922            <!--
923                 These variables are stored in build.properties.
924                 End-users can override by creating the file override.properties
925            -->
926            <link offline="true" href="${javasedocs.url}" packagelistLoc="installer/resources/package-lists/java/" />
927            <link offline="true" href="${junitdocs.url}" packagelistLoc="installer/resources/package-lists/junit/" />
928            <link offline="true" href="${i2pdocs.url}" packagelistLoc="build/javadoc/" />
929        </javadoc>
930        <echo message="Warning, javadoc embeds timestamps in the output, run with 'TZ=UTC ant javadoc' if you plan to distribute" />
931    </target>
932
933    <target name="getReleaseNumber">
934        <loadfile srcfile="core/java/src/net/i2p/CoreVersion.java" property="release.number">
935            <filterchain>
936                <linecontains>
937                    <contains value="public final static String VERSION"/>
938                </linecontains>
939                <tokenfilter>
940                    <replaceregex pattern='.*"([^"]+)";' replace="\1" flags="gi" />
941                </tokenfilter>
942                <striplinebreaks/>
943                <trim/>
944            </filterchain>
945        </loadfile>
946        <property name="release.number" value="unknown" />
947        <echo message="Release number is ${release.number}" />
948    </target>
949
950    <target name="getBuildNumber">
951        <loadfile srcfile="router/java/src/net/i2p/router/RouterVersion.java" property="i2p.build.number">
952            <filterchain>
953                <linecontains>
954                    <contains value="public final static long BUILD" />
955                </linecontains>
956                <tokenfilter>
957                    <replaceregex pattern=".*=\s+([0-9]+);" replace="\1" flags="gi" />
958                </tokenfilter>
959                <trim/>
960                <striplinebreaks/>
961            </filterchain>
962        </loadfile>
963        <loadfile srcfile="router/java/src/net/i2p/router/RouterVersion.java" property="build.extra">
964            <filterchain>
965                <linecontains>
966                    <contains value="public final static String EXTRA" />
967                </linecontains>
968                <tokenfilter>
969                    <replaceregex pattern='.*"(.*)";' replace="\1" flags="gi" />
970                </tokenfilter>
971                <trim/>
972                <striplinebreaks/>
973            </filterchain>
974        </loadfile>
975        <property name="i2p.build.number" value="??" />
976        <property name="build.extra" value="" />
977        <echo message="Build number is ${i2p.build.number}${build.extra}" />
978    </target>
979
980    <target name="verifyReleaseBuildNumbers" depends="getReleaseNumber, getBuildNumber" >
981        <echo message="SDK: ${java.vendor} ${java.version} (${java.runtime.name} ${java.runtime.version})" />
982        <fail message="Bad release number: ${release.number}" >
983            <condition>
984                <or>
985                    <equals arg1="${release.number}" arg2="unknown"/>
986                    <equals arg1="${release.number}" arg2=""/>
987                </or>
988            </condition>
989        </fail>
990        <fail message="Non-zero build number: ${i2p.build.number}" >
991            <condition>
992                <not>
993                    <equals arg1="${i2p.build.number}" arg2="0"/>
994                </not>
995            </condition>
996        </fail>
997        <fail message="Non-empty extra build: ${build.extra}" >
998            <condition>
999                <not>
1000                    <equals arg1="${build.extra}" arg2=""/>
1001                </not>
1002            </condition>
1003        </fail>
1004    </target>
1005
1006    <target name="-pre-sign">
1007            <!-- if you're distributing su3 files to others, at a minimum you should set these -->
1008            <fail message="javac.compilerargs must contain a -bootclasspath option in override.properties">
1009                <condition>
1010                    <not><contains string="${javac.compilerargs}" substring="-bootclasspath"/></not>
1011                </condition>
1012            </fail>
1013            <fail message="javac.compilerargs7 must contain a -bootclasspath option in override.properties">
1014                <condition>
1015                    <not><contains string="${javac.compilerargs7}" substring="-bootclasspath"/></not>
1016                </condition>
1017            </fail>
1018            <fail message="build.built-by must be set in override.properties">
1019                <condition>
1020                    <equals arg1="${build.built-by}" arg2="unknown"/>
1021                </condition>
1022            </fail>
1023            <fail message="require.gettext must be true">
1024                <condition>
1025                    <not><equals arg1="${require.gettext}" arg2="true"/></not>
1026                </condition>
1027            </fail>
1028    </target>
1029
1030    <target name="-pre-release" depends="-pre-sign, failIfNoMtn">
1031            <echo message="================================================================" />
1032            <echo message="Did you update these files?" />
1033            <exec executable="ls" failonerror="true">
1034                    <arg value="-l" />
1035                    <arg value="history.txt" />
1036                    <arg value="installer/install.xml" />
1037                    <arg value="core/java/src/net/i2p/CoreVersion.java" />
1038                    <arg value="router/java/src/net/i2p/router/RouterVersion.java" />
1039            </exec>
1040            <echo message="Everything is checked in, right? Let's be sure:" />
1041            <exec executable="mtn" failonerror="true">
1042                    <arg value="st" />
1043            </exec>
1044            <echo message="If there are any modified files above, stop now!" />
1045            <echo message="================================================================" />
1046            <sleep seconds="3"/>
1047    </target>
1048
1049    <target name="clean" depends="pkgclean" >
1050        <delete dir="./build" />
1051        <delete dir="./reports" />
1052        <delete file="installer/lib/izpack/patches.jar" failonerror="false" quiet="true" />
1053        <ant dir="installer/lib/izpack5/patches/java/" target="clean" />
1054        <delete file="syndie-standalone.zip" failonerror="false" quiet="true" />
1055        <delete file="i2psnark-standalone.zip" failonerror="false" quiet="true" />
1056        <delete file="BOB-one.jar" failonerror="false" quiet="true" />
1057        <delete file="core/java/cobertura.ser"/>
1058        <delete file="javadoc.zip" />
1059        <delete file="i2p.fba" />
1060        <delete file="${sloccount.report.file}" />
1061        <delete file="mavencentral-i2p.jar" />
1062        <delete file="mavencentral-router.jar" />
1063        <delete file="mavencentral-mstreaming.jar" />
1064        <delete file="mavencentral-streaming.jar" />
1065        <delete file="mavencentral-servlet-i2p.jar" />
1066    </target>
1067
1068    <target name="distclean" depends="clean">
1069        <delete failonerror="false" quiet="true">
1070            <fileset dir="." includes="i2pinstall* *.deb i2p_*.bz2 i2pupdate* i2psource* *.sig *.torrent" />
1071        </delete>
1072        <ant dir="core/java/" target="distclean" />
1073        <ant dir="router/java/" target="distclean" />
1074        <ant dir="installer/java" target="distclean" />
1075        <ant dir="apps/ministreaming/java/" target="distclean" />
1076        <ant dir="apps/streaming/java/" target="distclean" />
1077        <ant dir="apps/i2ptunnel/java/" target="distclean" />
1078        <ant dir="apps/sam/java/" target="distclean" />
1079        <ant dir="apps/BOB" target="clean" />
1080        <ant dir="apps/desktopgui" target="clean" />
1081        <ant dir="apps/routerconsole/java/" target="distclean" />
1082        <ant dir="apps/addressbook/" target="distclean" />
1083        <ant dir="apps/susimail/" target="distclean" />
1084        <ant dir="apps/susidns/src/" target="distclean" />
1085        <ant dir="apps/systray/java/" target="distclean" />
1086        <ant dir="apps/i2psnark/java/" target="distclean" />
1087        <ant dir="apps/jetty/" target="distclean" />
1088        <ant dir="apps/imagegen/" target="distclean" />
1089        <ant dir="apps/jrobin/java" target="distclean" />
1090        <delete dir="core/c/jbigi/bin" />
1091        <delete dir="core/c/jbigi/lib" />
1092        <delete dir="core/c/jcpuid/lib" />
1093        <ant dir="installer/resources/locale" target="distclean" />
1094        <ant dir="installer/tools/java" target="distclean" />
1095        <ant dir="installer/lib/izpack5/patches/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/jsonrpc.war" todir="pkg-temp/webapps/" />
1316        <copy file="build/i2psnark.war" todir="pkg-temp/webapps/" />
1317        <copy file="apps/i2psnark/i2psnark.config" todir="pkg-temp/" />
1318        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
1319        <copy file="installer/resources/clients.config" todir="pkg-temp/" />
1320        <copy file="installer/resources/i2ptunnel.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="installer/resources/startconsole.html" todir="pkg-temp/docs/" />
1327        <copy file="installer/resources/start.ico" todir="pkg-temp/docs/" />
1328        <copy file="installer/resources/console.ico" todir="pkg-temp/docs/" />
1329        <copy file="installer/resources/uninstall.ico" todir="pkg-temp/docs/" />
1330        <!-- Eepsite stuff here -->
1331        <mkdir dir="pkg-temp/eepsite" />
1332        <copy todir="pkg-temp/eepsite/" >
1333            <fileset dir="installer/resources/eepsite/" excludes="**/.placeholder" />
1334        </copy>
1335        <copy file="installer/resources/themes/console/images/favicon.ico" tofile="pkg-temp/eepsite/docroot/favicon.ico" />
1336    </target>
1337
1338    <target name="copyflags-unlesspkg" unless="${with-famfamfam-flag-png}" >
1339        <copy todir="pkg-temp/eepsite/docroot/help/lib/" >
1340            <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" />
1341        </copy>
1342        <copy todir="pkg-temp/docs/icons/flags" >
1343          <!-- base flags/ dir only. flags16x11/ and flags48x48/ dirs already copied by prepConsoleDocs target -->
1344          <fileset dir="installer/resources/icons/flags" />
1345        </copy>
1346    </target>
1347
1348    <target name="copyjetty" depends="copyjetty-unlesspkg" >
1349        <copy file="build/jetty-i2p.jar" todir="pkg-temp/lib" />
1350    </target>
1351
1352    <target name="copyjetty-unlesspkg" unless="${with-libjetty9-java}" >
1353        <copy todir="pkg-temp/lib" >
1354            <fileset dir="build" includes="javax.servlet.jar jetty*.jar org.mortbay.*.jar" excludes="jetty-i2p.jar" />
1355        </copy>
1356    </target>
1357
1358    <target name="settomcatprop" >
1359        <condition property="with-libtomcat-java" >
1360            <or>
1361                <istrue value="${with-libtomcat6-java}" />
1362                <istrue value="${with-libtomcat7-java}" />
1363                <istrue value="${with-libtomcat8-java}" />
1364                <istrue value="${with-libtomcat9-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" depends="buildCore">
1438        <copy todir="pkg-temp/certificates/" >
1439          <fileset dir="installer/resources/certificates/" />
1440        </copy>
1441        <java classname="net.i2p.crypto.CertUtil" fork="true" failonerror="true">
1442            <classpath>
1443                <pathelement location="build/i2p.jar" />
1444            </classpath>
1445            <arg value="checkall" />
1446            <arg value="pkg-temp/certificates" />
1447        </java>
1448    </target>
1449
1450    <condition property="no.bundle.routerInfos">
1451        <isfalse value="${bundle.routerInfos}" />
1452    </condition>
1453
1454    <target name="prepRouterInfos" depends="buildrouter, buildTools" unless="no.bundle.routerInfos">
1455        <delete dir="pkg-temp/netDb" />
1456        <mkdir dir="pkg-temp/netDb" />
1457        <java classname="net.i2p.router.networkdb.kademlia.BundleRouterInfos" fork="true" failonerror="true">
1458            <classpath>
1459                <pathelement location="build/i2p.jar" />
1460                <pathelement location="core/java/build/gnu-getopt.jar" />
1461                <pathelement location="build/router.jar" />
1462                <pathelement location="build/tools.jar" />
1463            </classpath>
1464            <arg value="-i" />
1465            <arg value="${bundle.routerInfos.i2pConfigDir}" />
1466            <arg value="-o" />
1467            <arg value="pkg-temp/netDb" />
1468            <arg value="-c" />
1469            <arg value="${bundle.routerInfos.count}" />
1470        </java>
1471    </target>
1472
1473    <target name="-areRouterInfosEnabled">
1474        <fail message="Option requires &quot;bundle.routerInfos&quot; to be configured. Please read &quot;build.properties&quot; for more info." >
1475            <condition>
1476                <isfalse value="${bundle.routerInfos}" />
1477            </condition>
1478        </fail>
1479    </target>
1480
1481    <target name="i2pseeds" depends="-setepoch, -areRouterInfosEnabled, prepRouterInfos">
1482        <delete file="i2pseeds.zip" />
1483        <delete file="i2pseeds.su3" />
1484        <zip destfile="i2pseeds.zip" basedir="pkg-temp/netDb" whenempty="fail" />
1485        <su3sign infile="i2pseeds.zip" sigtype="RESEED" outfile="i2pseeds.su3" su3.ver="${epoch}" />
1486    </target>
1487
1488    <!-- this is no longer required, izpack 4.3.0 supports headless installs with java -jar i2pinstall.exe -console -->
1489    <!-- and this is no longer used by the SlackBuild -->
1490    <target name="tarball" depends="preppkg">
1491        <tar compression="bzip2" destfile="i2p.tar.bz2">
1492            <tarfileset dir="pkg-temp" includes="**/*" prefix="i2p" />
1493        </tar>
1494    </target>
1495
1496    <target name="deletepkg-temp">
1497        <delete dir="pkg-temp" />
1498        <delete dir="./pkg-mavencentral" />
1499    </target>
1500
1501    <!-- readme and proxy error page files, initialNews.xml files, GeoIP files, and flag icons -->
1502    <target name="prepConsoleDocs" depends="prepConsoleDocUpdates, prepgeoupdate" >
1503        <copy todir="pkg-temp/docs/initialNews/">
1504          <fileset dir="installer/resources/initialNews/" />
1505        </copy>
1506        <!-- ensure the proxy files have the correct line endings -->
1507        <fixcrlf srcdir="pkg-temp/docs" includes="*.ht" encoding="utf8" eol="crlf" />
1508    </target>
1509
1510    <!-- readme and proxy error page files -->
1511    <target name="prepConsoleDocUpdates">
1512        <copy todir="pkg-temp/docs/" >
1513          <fileset dir="installer/resources/readme/" includes="readme*.html" />
1514          <fileset dir="installer/resources/proxy/" includes="*.ht" />
1515          <!--
1516               As of 0.9.36:
1517               All new and changed flags must go in the flags16x11/ dir,
1518               which will be checked first by flags.jsp.
1519               The flags/ dir is the original set from famfamfam,
1520               which may be symlinked in package installs.
1521           -->
1522          <fileset dir="installer/resources/" includes="icons/flags16x11/*" />
1523          <!-- flags48x48 added in 0.9.32 -->
1524          <fileset dir="installer/resources/" includes="icons/flags48x48/*" />
1525        </copy>
1526    </target>
1527
1528    <target name="consoleDocs" depends="deletepkg-temp, prepConsoleDocs">
1529        <zip destfile="docs.zip" basedir="pkg-temp" whenempty="fail" />
1530    </target>
1531
1532    <target name="copyJavadoc" depends="javadoc">
1533        <copy todir="pkg-temp/docs/javadoc" >
1534          <fileset dir="build/javadoc/" />
1535        </copy>
1536    </target>
1537
1538    <target name="updater200" depends="prepupdate, preplicenses, pack200, zipit200" />
1539    <target name="updater200WithJetty" depends="prepjupdate, preplicenses, pack200, zipit200" />
1540    <target name="updater200WithJettyAndJbigi" depends="prepjupdate, prepjbigiupdate, preplicenses, pack200, zipit200" />
1541    <target name="updater200WithJettyAndGeoIP" depends="prepjupdate, prepgeoupdate, preplicenses, pack200, zipit200" />
1542    <target name="updater200WithJettyFixes" depends="prepjupdatefixes, preplicenses, pack200, zipit200" />
1543    <target name="updater200WithJettyFixesAndJbigi" depends="prepjupdatefixes, prepjbigiupdate, preplicenses, pack200, zipit200" />
1544    <target name="updater200WithJbigi" depends="prepupdate, prepjbigiupdate, preplicenses, pack200, zipit200" />
1545    <target name="updater" depends="prepupdate, preplicenses, zipit" />
1546    <target name="updaterRepack" depends="prepupdate, preplicenses, repack200, zipit" />
1547    <target name="updaterWithJavadoc" depends="prepupdate, preplicenses, copyJavadoc, zipit" />
1548    <target name="updater200WithJavadoc" depends="prepupdate, preplicenses, copyJavadoc, pack200, zipit200" />
1549    <target name="updaterWithJavadocAndJetty" depends="prepjupdate, preplicenses, copyJavadoc, zipit" />
1550    <target name="updater200WithJavadocAndJetty" depends="prepjupdate, preplicenses, copyJavadoc, pack200, zipit200" />
1551    <target name="updaterWithGeoIP" depends="prepupdate, prepgeoupdate, preplicenses, zipit" />
1552    <target name="updaterWithJetty" depends="prepjupdate, preplicenses, zipit" />
1553    <target name="updaterWithJettyRepack" depends="prepjupdate, preplicenses, repack200, zipit" />
1554    <target name="updaterWithJettyAndJbigiRepack" depends="prepjupdate, prepjbigiupdate, preplicenses, repack200, zipit" />
1555    <target name="updaterWithJettyAndGeoIPRepack" depends="prepjupdate, prepgeoupdate, preplicenses, repack200, zipit" />
1556    <target name="updaterWithJettyFixes" depends="prepjupdatefixes, preplicenses, zipit" />
1557    <target name="updaterWithJettyFixesAndJbigi" depends="prepjupdatefixes, prepjbigiupdate, preplicenses, zipit" />
1558    <target name="updaterWithJettyFixesAndGeoIP" depends="prepjupdatefixes, prepgeoupdate, preplicenses, zipit" />
1559    <target name="updaterWithJbigi" depends="prepupdate, prepjbigiupdate, preplicenses, zipit" />
1560    <target name="updaterSmall" depends="prepupdateSmall, zipit" />
1561    <target name="updaterRouter" depends="prepupdateRouter, zipit" />
1562
1563    <target name="-sign-update" depends="buildrouter">
1564        <su3sign infile="i2pupdate200.zip" sigtype="ROUTER" outfile="i2pupdate.su3" su3.ver="${full.version}" />
1565    </target>
1566
1567    <target name="signed-updater200" depends="-pre-sign, updater200, -sign-update" />
1568    <target name="signed-updater200WithJetty" depends="-pre-sign, updater200WithJetty, -sign-update" />
1569    <target name="signed-updater200WithJettyAndGeoIP" depends="-pre-sign, updater200WithJettyAndGeoIP, -sign-update" />
1570    <target name="signed-updater200WithJavadoc" depends="-pre-sign, updater200WithJavadoc, -sign-update" />
1571    <target name="signed-updater200WithJavadocAndJetty" depends="-pre-sign, updater200WithJavadocAndJetty, -sign-update" />
1572
1573    <target name="zipit" depends="getReleaseNumber">
1574        <!--
1575             As of release 0.8.8, the router will enforce a zipfile comment equal to the
1576             version number in the sud/su2 header, since the version in the header is NOT
1577             covered by the signature.
1578         -->
1579        <zip destfile="i2pupdate.zip" basedir="pkg-temp" whenempty="fail" comment="${release.number}" />
1580       <!-- just a test, makes almost no difference
1581        <tar destfile="i2pupdate.tgz" basedir="pkg-temp" compression="gzip" />
1582        <tar destfile="i2pupdate.tbz" basedir="pkg-temp" compression="bzip2" />
1583       -->
1584    </target>
1585
1586    <target name="zipit200" depends="getReleaseNumber" >
1587        <zip destfile="i2pupdate200.zip" basedir="pkg-temp" whenempty="fail" comment="${release.number}" />
1588    </target>
1589
1590    <target name="pack200">
1591        <!-- pack200 will only pack to a .pack file, and only from a .jar file, so we put another .jar on the end -->
1592        <!-- can't pack an empty jar or one without classes, it will fail to unpack on Java 5;
1593          -  see http://bugs.sun.com/view_bug.do?bug_id=6712743
1594          -->
1595        <!-- *nix here -->
1596        <exec executable="sh" osfamily="unix" failonerror="true">
1597            <arg value="-c" />
1598            <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" />
1599        </exec>
1600        <exec executable="sh" osfamily="mac" failonerror="true">
1601            <arg value="-c" />
1602            <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" />
1603        </exec>
1604        <!-- windoz here : i admit, i hate escaped symbols in xml, indeed = =! -->
1605        <exec executable="cmd" osfamily="windows" failonerror="true">
1606            <arg value="/c" />
1607            <!-- TODO implement fix above -->
1608            <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" />
1609        </exec>
1610        <exec executable="cmd" osfamily="windows" failonerror="true">
1611                <arg value="/c" />
1612                <arg value="for %i in (pkg-temp\lib\*.jar) do pack200 -g %i.pack %i &amp;&amp; del %i" />
1613        </exec>
1614    </target>
1615
1616    <!-- saves about 1% on average (more on jars with multiple compiled po files since they have lots of common strings) -->
1617    <target name="repack200">
1618        <!-- pack200 will only repack a .jar file, so we put another .jar on the end -->
1619        <!-- *nix here -->
1620        <exec executable="sh" osfamily="unix" failonerror="true">
1621            <arg value="-c" />
1622            <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" />
1623        </exec>
1624        <exec executable="sh" osfamily="mac" failonerror="true">
1625            <arg value="-c" />
1626            <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" />
1627        </exec>
1628        <!-- windoz here : i admit, i hate escaped symbols in xml, indeed = =! -->
1629        <exec executable="cmd" osfamily="windows" failonerror="true">
1630            <arg value="/c" />
1631            <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" />
1632        </exec>
1633        <exec executable="cmd" osfamily="windows" failonerror="true">
1634                <arg value="/c" />
1635                <arg value="for %i in (pkg-temp\lib\*.jar) do pack200 -r %i" />
1636        </exec>
1637    </target>
1638
1639    <target name="prepupdate" depends="build2, prepupdateSmall, prepConsoleDocUpdates, prepCertificates, prep-script-translation, truncatehistory">
1640        <copy file="build/BOB.jar" todir="pkg-temp/lib/" />
1641        <copy file="build/sam.jar" todir="pkg-temp/lib/" />
1642        <copy file="build/i2psnark.jar" todir="pkg-temp/lib" />
1643        <!-- include systray changes in 0.7.5 -->
1644        <copy file="build/systray.jar" todir="pkg-temp/lib/" />
1645       <!-- removed from updater in 0.9, added back in 0.9.26 -->
1646        <copy file="build/desktopgui.jar" todir="pkg-temp/lib/" />
1647        <copy file="build/susimail.war" todir="pkg-temp/webapps/" />
1648        <copy file="build/susidns.war" todir="pkg-temp/webapps/" />
1649        <copy file="build/imagegen.war" todir="pkg-temp/webapps/" />
1650        <copy file="build/jsonrpc.war" todir="pkg-temp/webapps/" />
1651        <!-- as of 0.7.12; last changed in 0.9; removed from update in 0.9.26 -->
1652      <!--
1653        <copy file="apps/susidns/src/lib/jstl.jar" todir="pkg-temp/lib/" />
1654        <copy file="apps/susidns/src/lib/standard.jar" todir="pkg-temp/lib/" />
1655       -->
1656        <copy file="build/i2psnark.war" todir="pkg-temp/webapps/" />
1657        <copy file="installer/resources/deletelist.txt" todir="pkg-temp/" />
1658        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
1659        <copy todir="pkg-temp/man/">
1660            <fileset dir="installer/resources/man/" />
1661        </copy>
1662    </target>
1663
1664    <target name="truncatehistory">
1665        <copy file="history.txt" todir="pkg-temp/" />
1666        <!-- the following overwrites history.txt on unix to shrink the update file -->
1667        <copy file="history.txt" tofile="pkg-temp/history.txt" overwrite="true">
1668            <filterchain>
1669                <headfilter lines="1500" />
1670            </filterchain>
1671        </copy>
1672        <concat append="true" destfile="pkg-temp/history.txt">&#10;&#10;----------------&#10;&#10;EARLIER HISTORY IS AVAILABLE IN THE SOURCE PACKAGE</concat>
1673    </target>
1674
1675    <target name="prepupdateSmall" depends="buildSmall, prepupdateRouter, prepjupdatefixes, prepthemeupdates">
1676        <copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
1677        <copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
1678        <copy file="build/streaming.jar" todir="pkg-temp/lib/" />
1679        <copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
1680        <!-- Updated in 0.9.28 -->
1681        <!-- name without version so we can overwrite if we upgrade  -->
1682        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
1683        <copy file="build/i2ptunnel.war" todir="pkg-temp/webapps/" />
1684        <copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
1685        <copy file="build/addressbook.jar" todir="pkg-temp/lib/" />
1686        <copy file="build/addressbook.war" todir="pkg-temp/webapps/" />
1687        <!-- decapitalized the file in 0.7.8 -->
1688        <copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
1689        <copy file="installer/resources/continents.txt" todir="pkg-temp/geoip/" />
1690      <!--
1691        <copy file="installer/resources/public-suffix-list.txt" todir="pkg-temp/geoip/" />
1692       -->
1693    </target>
1694
1695    <target name="prepupdateRouter" depends="buildrouter, deletepkg-temp">
1696        <copy file="build/i2p.jar" todir="pkg-temp/lib/" />
1697        <copy file="build/router.jar" todir="pkg-temp/lib/" />
1698    </target>
1699
1700    <!-- jbigi.jar -->
1701    <target name="prepjbigiupdate" depends="jbigi">
1702        <copy file="build/jbigi.jar" todir="pkg-temp/lib/" />
1703    </target>
1704
1705    <!-- GeoIP files -->
1706    <target name="prepgeoupdate" depends="prepgeoupdate-unlesspkg" >
1707        <copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
1708        <copy file="installer/resources/continents.txt" todir="pkg-temp/geoip/" />
1709      <!--
1710        <copy file="installer/resources/public-suffix-list.txt" todir="pkg-temp/geoip/" />
1711       -->
1712    </target>
1713
1714    <!-- GeoIP files, set withGeoIPDatabase=true in override.properties to prevent -->
1715    <!-- As of 0.9.26, the files are not included in Debian/Ubuntu builds. -->
1716    <target name="prepgeoupdate-unlesspkg" unless="${with-geoip-database}" >
1717        <mkdir dir="pkg-temp/geoip" />
1718      <!--
1719        <copy file="installer/resources/geoip.txt" todir="pkg-temp/geoip/" />
1720        <copy file="installer/resources/geoipv6.dat.gz" todir="pkg-temp/geoip/" />
1721       -->
1722        <gunzip src="installer/resources/GeoLite2-Country.mmdb.gz" dest="pkg-temp/geoip/GeoLite2-Country.mmdb" />
1723    </target>
1724
1725    <!-- All jetty jars required for update.
1726         TODO do we need to bother updating jasper?
1727      -->
1728    <target name="prepjupdate" depends="prepupdate, buildWEB">
1729        <copy todir="pkg-temp/lib" >
1730            <fileset dir="build" includes="commons*.jar jasper*.jar javax*.jar jetty*.jar jsp*.jar org.mortbay.*.jar" />
1731        </copy>
1732        <!--  We have to package the new eepsite files for MigrateJetty.java, but we
1733              can't overwrite an existing eepsite dir in a non-split configuration.
1734          -->
1735        <copy todir="pkg-temp/eepsite-jetty9" >
1736            <fileset dir="installer/resources/eepsite" includes="*.xml contexts/* etc/*" />
1737        </copy>
1738    </target>
1739
1740    <target name="delete-j6-update">
1741        <delete dir="pkg-temp/eepsite-jetty9" />
1742    </target>
1743
1744    <!-- Jetty 6 I2P logging addons, not really fixes -->
1745    <target name="prepjupdatefixes" depends="buildWEB">
1746        <copy file="build/jetty-i2p.jar" todir="pkg-temp/lib/" />
1747    </target>
1748
1749    <target name="util-list-changes" depends="checkForMtn" if="mtn.available" >
1750        <exec executable="mtn" outputproperty="workspace.changes.util" errorproperty="mtn.error.util" failifexecutionfails="false" >
1751            <arg value="list" />
1752            <arg value="changed" />
1753            <arg value="core/java/src/net/i2p/util" />
1754        </exec>
1755        <!-- \n in an attribute value generates an invalid manifest -->
1756        <exec executable="tr" inputstring="${workspace.changes.util}" outputproperty="workspace.changes.util.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
1757            <arg value="-s" />
1758            <arg value="[:space:]" />
1759            <arg value="," />
1760        </exec>
1761    </target>
1762
1763    <target name="izpack-patches" >
1764            <taskdef name="izpack"
1765                     classpath="${basedir}/installer/lib/izpack/patches.jar:${basedir}/installer/lib/izpack/standalone-compiler.jar"
1766                     classname="com.izforge.izpack.ant.IzPackTask" />
1767        <jar destfile="${basedir}/installer/lib/izpack/patches.jar"
1768             basedir="${basedir}/installer/lib/izpack/patches" />
1769    </target>
1770
1771    <target name="buildUtilityJar" depends="buildCore">
1772        <ant dir="installer/java" target="build" />
1773    </target>
1774
1775    <!-- IzPack 4 -->
1776    <target name="installer" depends="preppkg, buildProperties, util-list-changes, izpack-patches, buildUtilityJar" >
1777        <izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
1778        <ant target="installerexe" />
1779    </target>
1780
1781    <!-- IzPack 5 -->
1782    <target name="ensureIzpack5" >
1783        <!-- set if unset -->
1784        <property name="izpack5.home" value="${user.home}/IzPack" />
1785        <condition property="izpack5.available" >
1786            <available file="${izpack5.home}" type="dir" />
1787        </condition>
1788        <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" >
1789            <condition>
1790                <not>
1791                    <isset property="izpack5.available" />
1792                </not>
1793            </condition>
1794        </fail>
1795        <path id="izpack5.lib.path">
1796            <fileset dir="${izpack5.home}/lib" includes="*.jar"/>
1797        </path>
1798        <taskdef name="izpack5"
1799                 classpathref="izpack5.lib.path"
1800                 classname="com.izforge.izpack.ant.IzPackTask" />
1801    </target>
1802
1803    <target name="izpack5-patches" depends="ensureIzpack5, buildProperties" >
1804        <ant dir="installer/lib/izpack5/patches/java/" target="jar" />
1805    </target>
1806
1807    <target name="installer5" depends="izpack5-patches, preppkg, buildProperties, util-list-changes, buildUtilityJar" >
1808        <izpack5 input="${basedir}/installer/install5.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
1809        <ant target="installer5exe" />
1810    </target>
1811
1812    <!-- This makes i2pinstall.exe from install.jar using the bundled launch4j.
1813         Warning: launch4j-created files CANNOT be Windows-signed.
1814         They will be corrupted.
1815      -->
1816    <target name="installerexe" depends="launch4j" unless="noExe">
1817        <echo message="See the file &quot;build.properties&quot; if this step fails." />
1818        <!-- now the installer exe -->
1819        <launch4j configFile="./installer/i2pinstaller.xml" />
1820        <!-- thazzit -->
1821    </target>
1822
1823    <!-- This makes i2pinstall.exe from install.jar using IzPack5's izpack2exe.py (not bundled)
1824         izpack2exe-created files CAN be Windows-signed.
1825      -->
1826    <target name="installer5exe" unless="noExe">
1827        <!-- You must have the optional IzPack utils installed for this -->
1828        <!-- izpack doesn't come with +x permission when installed -->
1829        <chmod type="file" file="${izpack5.home}/utils/wrappers/izpack2exe/7za" perm="+x" />
1830        <chmod type="file" file="${izpack5.home}/utils/wrappers/izpack2exe/izpack2exe.py" perm="+x" />
1831        <!--
1832             Note that we must specify the 7za path to use the one from IzPack, which is very old.
1833             Either 7zr (from Debian package p7zip) or 7za (from Debian package p7zip-full)
1834             will work, but ONLY if the 7za/7zr command line is changed in izpack2exe.py
1835             as follows, because their default is LZMA2, which dosn't work on Windows.
1836             So we don't want any Debian 7za picked up in the PATH.
1837             See /usr/share/doc/p7zip/DOC/MANUAL/cmdline/switches/method.htm
1838             old:
1839             p7zcmd = '"%s" a -mmt -t7z -mx=9 installer.7z "%s"' % (p7z, files)
1840             new:
1841             p7zcmd = '"%s" a -mmt -t7z -mx=9 -m0=LZMA installer.7z "%s"' % (p7z, files)
1842
1843             We also use IzPack's customized 7zS.sfx file, which uses a customized icon
1844             (but not our icon, sadly)
1845
1846             More info: https://izpack.atlassian.net/wiki/spaces/IZPACK/pages/491541/IzPack+Utilities
1847         -->
1848        <exec executable="${izpack5.home}/utils/wrappers/izpack2exe/izpack2exe.py" failonerror="true">
1849            <arg value="--file=${basedir}/install.jar" />
1850            <arg value="--with-7z=${izpack5.home}/utils/wrappers/izpack2exe/7za" />
1851            <arg value="--no-upx" />
1852            <arg value="--output=${basedir}/i2pinstall.exe" />
1853        </exec>
1854    </target>
1855
1856    <!-- Custom installers -->
1857    <!-- IzPack 4 -->
1858    <target name="installer-nowindows" depends="clean, preppkg-nowindows, izpack-patches" >
1859        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1860        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}.jar" installerType="standard" basedir="${basedir}" />
1861    </target>
1862
1863    <!-- IzPack 5 -->
1864    <target name="installer5-nowindows" depends="clean, izpack5-patches, preppkg-nowindows" >
1865        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1866        <izpack5 input="${basedir}/installer/install5.xml" output="${basedir}/i2pinstall_${full.version}.jar" installerType="standard" basedir="${basedir}" />
1867    </target>
1868
1869
1870    <target name="installer-freebsd" depends="clean, preppkg-freebsd-only, izpack-patches" >
1871        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1872        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_freebsd-only.jar" installerType="standard" basedir="${basedir}" />
1873    </target>
1874
1875    <!-- IzPack 4 -->
1876    <target name="installer-linux" depends="clean, preppkg-linux-only, izpack-patches" >
1877        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1878        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_linux-only.jar" installerType="standard" basedir="${basedir}" />
1879    </target>
1880
1881    <!-- IzPack 5 -->
1882    <target name="installer5-linux" depends="clean, izpack5-patches, preppkg-linux-only" >
1883        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1884        <izpack5 input="${basedir}/installer/install5.xml" output="${basedir}/i2pinstall_${full.version}_linux-only.jar" installerType="standard" basedir="${basedir}" />
1885    </target>
1886
1887
1888    <target name="installer-osx" depends="clean, checkForIzpack2App, preppkg-osx-only, izpack-patches">
1889        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1890        <mkdir dir="pkg-temp/osx" />
1891        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_osx-only.jar" installerType="standard" basedir="${basedir}" />
1892        <ant target="installer2app" />
1893        <delete dir="pkg-temp/osx" />
1894    </target>
1895
1896    <target name="checkForIzpack2App">
1897        <!-- we'll set the izpack2app binary name if it's not been set elsewhere yet -->
1898        <property name="izpack2app.binary" value="${user.home}/IzPack/utils/wrappers/izpack2app/izpack2app.py" />
1899        <available property="izpack2app.available" file="${izpack2app.binary}" />
1900    </target>
1901
1902    <target name="installer2app" if="izpack2app.available">
1903        <mkdir dir="pkg-temp/osx" />
1904        <exec executable="python" failonerror="true">
1905            <arg value="${izpack2app.binary}" />
1906            <arg value="${basedir}/i2pinstall_${full.version}_osx-only.jar" />
1907            <arg value="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" />
1908        </exec>
1909
1910        <tar longfile="gnu" destfile="${basedir}/i2pinstall_${full.version}_osx.tar.bz2" compression="bzip2">
1911            <tarfileset dir="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" prefix="/i2p-${full.version}_osx-install.app" filemode="644">
1912                <include name="**/**" />
1913                <exclude name="Contents/MacOS/*" />
1914            </tarfileset>
1915            <tarfileset dir="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" prefix="/i2p-${full.version}_osx-install.app" filemode="755">
1916                <include name="Contents/MacOS/*" />
1917            </tarfileset>
1918        </tar>
1919    </target>
1920
1921    <!-- call between installer-xxx and installer-windows -->
1922    <target name="delete-nonwindows">
1923        <delete dir="pkg-temp/lib/wrapper/" />
1924        <delete dir="pkg-temp/locale/" />
1925        <delete dir="pkg-temp/man/" />
1926        <delete dir="pkg-temp/Start I2P Router.app/" />
1927        <delete dir="pkg-temp" includes="eepget i2prouter INSTALL-headless.txt osid postinstall.sh runplain.sh" />
1928    </target>
1929
1930    <!-- IzPack 4 -->
1931    <target name="installer-windows" depends="clean, preppkg-windows-only, util-list-changes, izpack-patches, buildUtilityJar" >
1932        <fixcrlf srcdir="pkg-temp" includes="*.config *.bat *.cmd **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="crlf"/>
1933        <izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
1934        <ant target="installerexe" />
1935        <delete file="${basedir}/install.jar" />
1936        <move file="${basedir}/i2pinstall.exe" tofile="${basedir}/i2pinstall_${full.version}_windows.exe" />
1937    </target>
1938
1939    <!-- IzPack 5 -->
1940    <target name="installer5-windows" depends="clean, izpack5-patches, preppkg-windows-only, util-list-changes, buildUtilityJar" >
1941        <fixcrlf srcdir="pkg-temp" includes="*.config *.bat *.cmd **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="crlf"/>
1942        <izpack5 input="${basedir}/installer/install5.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
1943        <ant target="installer5exe" />
1944        <delete file="${basedir}/install.jar" />
1945        <move file="${basedir}/i2pinstall.exe" tofile="${basedir}/i2pinstall_${full.version}_windows.exe" />
1946    </target>
1947
1948    <!-- this is broken as installer-xxx targets may delete (or not delete) things in pkg-temp -->
1949    <target name="installer-all" depends="installer-freebsd, installer-linux, installer-osx, installer-windows, installer-nowindows, installer" >
1950    </target>
1951    <!-- end custom installers -->
1952
1953    <!-- unit tests -->
1954    <target name="buildCoreTest">
1955        <ant dir="core/java/" target="jarTest" />
1956    </target>
1957    <target name="buildRouterTest" depends="buildCoreTest">
1958        <ant dir="router/java/" target="jarTest" />
1959    </target>
1960    <target name="buildTest" depends="buildRouterTest">
1961        <copy file="core/java/build/i2ptest.jar" todir="build" />
1962        <copy file="router/java/build/routertest.jar" todir="build" />
1963        <!-- broken -->
1964      <!--
1965        <ant dir="apps/ministreaming/java/" target="junit.compileTest" />
1966        <ant dir="apps/streaming/java/" target="junit.compileTest" />
1967       -->
1968    </target>
1969    <target name="prepTest" depends="prepupdate, buildTest">
1970        <!-- overwrite i2p.jar and router.jar with the test versions -->
1971        <copy file="build/i2ptest.jar" tofile="pkg-temp/lib/i2p.jar" overwrite="true" />
1972        <copy file="build/routertest.jar" tofile="pkg-temp/lib/router.jar" overwrite="true" />
1973    </target>
1974    <target name="updateTest" depends="prepTest, zipit" />
1975    <target name="junit.test" depends="buildProperties, jbigi" >
1976        <ant dir="core/java/" target="junit.test" />
1977        <ant dir="router/java/" target="junit.test" />
1978        <ant dir="apps/ministreaming/java/" target="junit.test" />
1979        <ant dir="apps/streaming/java/" target="junit.test" />
1980    </target>
1981    <target name="scalatest.test" depends="buildProperties, jbigi" >
1982        <ant dir="core/java/" target="scalatest.test" />
1983        <!-- note there are no router scala tests yet -->
1984        <ant dir="router/java/" target="scalatest.test" />
1985    </target>
1986    <!-- both junit and scala -->
1987    <target name="test" depends="testCore, testRouter, testMinistreaming, testStreaming" />
1988    <target name="testCore" depends="buildProperties, jbigi" >
1989        <ant dir="core/java/" target="test" />
1990    </target>
1991    <target name="testRouter" depends="buildProperties, jbigi" >
1992        <ant dir="router/java/" target="test" />
1993    </target>
1994    <target name="testMinistreaming" depends="buildProperties, jbigi" >
1995        <ant dir="apps/ministreaming/java/" target="test" />
1996    </target>
1997    <target name="testStreaming" depends="buildProperties" >
1998        <ant dir="apps/streaming/java/" target="test" />
1999    </target>
2000    <target name="scalatest.report" depends="buildProperties" >
2001        <ant dir="core/java/" target="scalatest.report" />
2002        <ant dir="router/java/" target="scalatest.report" />
2003    </target>
2004    <target name="junit.report" depends="buildProperties" >
2005        <ant dir="core/java/" target="junit.report" />
2006        <ant dir="router/java/" target="junit.report" />
2007        <ant dir="apps/ministreaming/java/" target="junit.report" />
2008        <ant dir="apps/streaming/java/" target="junit.report" />
2009    </target>
2010    <target name="clover.report" depends="buildProperties" if="with.clover">
2011        <ant dir="core/java/" target="clover.report" />
2012        <ant dir="router/java/" target="clover.report" />
2013        <ant dir="apps/ministreaming/java" target="clover.report" />
2014        <ant dir="apps/streaming/java" target="clover.report" />
2015    </target>
2016    <target name="cobertura.report" depends="buildProperties" if="with.cobertura">
2017        <ant dir="core/java/" target="cobertura.report" />
2018        <ant dir="router/java/" target="cobertura.report" />
2019        <ant dir="apps/ministreaming/java" target="cobertura.report" />
2020        <ant dir="apps/streaming/java" target="cobertura.report" />
2021    </target>
2022    <target name="test.report" depends="junit.report, scalatest.report, clover.report, cobertura.report"/>
2023    <target name="fulltest" depends="buildProperties, jbigi" >
2024        <ant dir="core/java/" target="fulltest" />
2025        <ant dir="router/java/" target="fulltest" />
2026        <ant dir="apps/ministreaming/java" target="fulltest" />
2027        <ant dir="apps/streaming/java" target="fulltest" />
2028    </target>
2029    <target name="jenkins.cobertura.report" depends="cobertura.report">
2030        <!--
2031             The jenkins cobertura plugin couldn't find the source files.
2032         -->
2033        <replaceregexp byline="true" file="reports/core/cobertura/coverage.xml"
2034            match='filename="net' replace='filename="core/java/src/net'/>
2035        <replaceregexp byline="true" file="reports/core/cobertura/coverage.xml"
2036            match="&lt;source&gt;./src" replace='&lt;source&gt;./core/java/src'/>
2037
2038        <replaceregexp byline="true" file="reports/router/cobertura/coverage.xml"
2039            match='filename="net' replace='filename="router/java/src/net'/>
2040        <replaceregexp byline="true" file="reports/router/cobertura/coverage.xml"
2041            match="&lt;source&gt;./src" replace="&lt;source&gt;router/java/src"/>
2042
2043        <replaceregexp byline="true" file="reports/ministreaming/cobertura/coverage.xml"
2044            match='filename="net' replace='filename="apps/ministreaming/java/src/net'/>
2045        <replaceregexp byline="true" file="reports/ministreaming/cobertura/coverage.xml"
2046            match="&lt;source&gt;./src" replace="&lt;source&gt;apps/ministreaming/java/src"/>
2047
2048        <replaceregexp byline="true" file="reports/streaming/cobertura/coverage.xml"
2049            match='filename="net' replace='filename="apps/streaming/java/src/net'/>
2050        <replaceregexp byline="true" file="reports/streaming/cobertura/coverage.xml"
2051            match="&lt;source&gt;./src" replace="&lt;source&gt;apps/streaming/java/src"/>
2052    </target>
2053    <!-- end unit tests -->
2054
2055    <target name="testscripts" >
2056        <exec executable="tests/scripts/checkcerts.sh" failonerror="true" />
2057        <exec executable="tests/scripts/checkpo.sh" failonerror="true" />
2058        <exec executable="tests/scripts/checkutf8.sh" failonerror="true" />
2059        <exec executable="tests/scripts/checkxml.sh" failonerror="true" />
2060        <exec executable="tests/scripts/checkscripts.sh" failonerror="true" />
2061    </target>
2062
2063
2064    <target name="testscripts-net" >
2065        <exec executable="tests/scripts/checkremotecerts.sh" failonerror="true" />
2066    </target>
2067
2068    <target name="testscripts-all" depends="testscripts,testscripts-net" />
2069
2070    <target name="bench" depends="jbigi" >
2071        <ant dir="core/java/" target="bench.jar" />
2072    </target>
2073
2074    <!-- <target name="syndie" >
2075        <ant dir="apps/syndie/java/" target="standalone" />
2076        <copy file="apps/syndie/java/syndie-standalone.zip" todir="." />
2077    </target> -->
2078
2079    <!-- standalone i2psnark zip -->
2080    <target name="i2psnark" depends="buildStreaming, buildJetty, buildSystray" >
2081        <ant dir="apps/i2psnark/java" target="standalone" />
2082        <copy file="apps/i2psnark/java/i2psnark-standalone.zip" todir="." />
2083    </target>
2084
2085    <target name="slackpkg">
2086        <ant dir="Slackware/i2p/" target="slackpkg" />
2087    </target>
2088    <target name="justBOB" depends="builddepSmall, jbigi">
2089        <ant dir="apps/BOB/" target="onejar" />
2090        <copy file="apps/BOB/dist/BOB-one.jar" todir="." />
2091    </target>
2092
2093    <target name="sloccount.report">
2094        <property name="sloccount.report.file" value="sloccount.sc" />
2095        <echo message="Generating sloccount report (this will take awhile)" />
2096        <exec executable="sloccount" failonerror="true">
2097            <arg value="--details"/>
2098            <arg value="--wide"/>
2099            <arg value="${basedir}"/>
2100            <redirector output="${sloccount.report.file}">
2101                <outputfilterchain>
2102                    <linecontainsregexp negate="true">
2103                        <regexp pattern="(Warning: |lib/launch4j|_MTN|reports|pkg-temp|licenses|i2p\.fba|gmp-|WEB-INF)" />
2104                    </linecontainsregexp>
2105                    <linecontains negate="true">
2106                        <contains value="${sloccount.report.file}" />
2107                    </linecontains>
2108                </outputfilterchain>
2109            </redirector>
2110        </exec>
2111        <echo message="sloccount report saved to the file &quot;${sloccount.report.file}&quot;" />
2112    </target>
2113
2114    <target name="findbugs" depends="build2, buildUtilityJar">
2115        <echo message="Starting findbugs, this will take a while..." />
2116        <!-- ref: https://github.com/spotbugs/spotbugs/issues/148 -->
2117        <echo message="If this doesn't work with Java 9+. try Java 8" />
2118        <exec executable="nice" failonerror="true">
2119            <arg value="findbugs"/>
2120            <arg value="-textui"/>
2121            <arg value="-projectName"/>
2122            <arg value="i2p"/>
2123            <arg value="-sortByClass"/>
2124            <arg value="-xml"/>
2125            <arg value="-output"/>
2126            <arg value="i2p.fba"/>
2127            <arg value="-auxclasspath"/>
2128            <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"/>
2129            <arg value="-sourcepath"/>
2130            <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"/>
2131            <!-- start of the files to be analyzed -->
2132            <arg value="build/BOB.jar"/>
2133            <arg value="build/addressbook.jar"/>
2134            <arg value="build/i2p.jar"/>
2135            <arg value="build/i2psnark.jar"/>
2136            <arg value="build/i2psnark.war"/>
2137            <arg value="build/i2ptunnel.jar"/>
2138            <arg value="build/i2ptunnel.war"/>
2139            <arg value="build/imagegen.war"/>
2140            <arg value="build/jetty-i2p.jar"/>
2141            <arg value="build/jsonrpc.war"/>
2142            <arg value="build/mstreaming.jar"/>
2143            <arg value="build/router.jar/"/>
2144            <arg value="build/desktopgui.jar"/>
2145            <arg value="build/routerconsole.jar"/>
2146            <arg value="build/routerconsole.war"/>
2147            <arg value="build/sam.jar"/>
2148            <arg value="build/streaming.jar"/>
2149            <arg value="build/susidns.war"/>
2150            <arg value="build/susimail.war"/>
2151            <arg value="build/systray.jar"/>
2152            <arg value="build/utility.jar"/>
2153        </exec>
2154        <echo message="Findbugs output stored in i2p.fba" />
2155        <echo message="Now run: findbugs i2p.fba" />
2156    </target>
2157
2158    <!-- this is the same dependency as pkg, but with updater200 in the middle,
2159         since preppkg puts too much stuff in pkg-temp -->
2160<!--
2161    <target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyAndJbigiRepack, updater200WithJettyAndJbigi, delete-j6-update, installer5-nowindows, delete-nonwindows, installer5-windows">
2162    <target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyRepack, updater200WithJetty, delete-j6-update, installer5-nowindows, delete-nonwindows, installer5-windows">
2163-->
2164    <target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyAndGeoIPRepack, updater200WithJettyAndGeoIP, delete-j6-update, installer5-nowindows, delete-nonwindows, installer5-windows">
2165        <echo message="New version number is ${release.number}" />
2166        <copy file="i2pupdate.zip" tofile="i2pupdate_${release.number}.zip" />
2167        <copy file="i2pinstall_${full.version}.jar" tofile="i2pinstall_${release.number}.jar" />
2168        <copy file="i2pinstall_${full.version}_windows.exe" tofile="i2pinstall_${release.number}_windows.exe" />
2169        <!-- remove these, we don't build them anymore -->
2170        <delete file="i2pupdate.sud" />
2171        <delete file="i2pupdate.su2" />
2172        <!-- make this a lot easier by putting release.privkey.su3=/path/to/su3keystore.ks in override.properties -->
2173
2174        <!-- now build and verify the packed su3 from the packed zip -->
2175        <su3sign infile="i2pupdate200.zip" sigtype="ROUTER" outfile="i2pupdate.su3" su3.ver="${release.number}" />
2176        <!-- this will use the monotonerc file in the current workspace -->
2177        <echo message="Checking out fresh copy into ../i2p-${release.number} for tarballing:" />
2178        <delete dir="../i2p-${release.number}" />
2179        <exec executable="mtn" failonerror="true">
2180            <arg value="co" />
2181            <!-- w: is the revision of the current workspace -->
2182            <arg value="-r" />
2183            <arg value="w:" />
2184            <arg value="../i2p-${release.number}/" />
2185        </exec>
2186        <exec executable="tar" failonerror="true">
2187            <arg value="cjf" />
2188            <arg value="i2psource_${release.number}.tar.bz2" />
2189            <arg value="-C" />
2190            <arg value=".." />
2191            <arg value="--exclude" />
2192            <arg value="i2p-${release.number}/_MTN*" />
2193            <arg value="i2p-${release.number}/" />
2194        </exec>
2195        <echo message="Sign the files:" />
2196        <input message="Enter GPG key ID (e.g. 0x12345678) for signing:" addproperty="release.gpg.keyid" />
2197        <fail message="You must enter a key ID." >
2198            <condition>
2199                <equals arg1="${release.gpg.keyid}" arg2=""/>
2200            </condition>
2201        </fail>
2202
2203        <!-- the gpgsign macro sets the permission of signed files and the sigs themselves to 444 -->
2204      <!--
2205        <gpgsign file="i2pinstall_${release.number}_windows.exe" />
2206       -->
2207        <gpgsign file="i2pinstall_${release.number}.jar" />
2208        <gpgsign file="i2psource_${release.number}.tar.bz2" />
2209        <gpgsign file="i2pupdate_${release.number}.zip" />
2210
2211        <chmod perm="444" type="file">
2212            <fileset dir="${basedir}">
2213                <include name="i2pupdate.su3" />
2214            </fileset>
2215        </chmod>
2216        <echo message="File sizes:" />
2217        <exec executable="ls" failonerror="true">
2218            <arg value="-l" />
2219          <!--
2220            <arg value="i2pinstall_${release.number}_windows.exe" />
2221           -->
2222            <arg value="i2pinstall_${release.number}.jar" />
2223            <arg value="i2psource_${release.number}.tar.bz2" />
2224            <arg value="i2pupdate_${release.number}.zip" />
2225            <arg value="i2pupdate.su3" />
2226          <!--
2227            <arg value="i2pinstall_${release.number}_windows.exe.sig" />
2228           -->
2229            <arg value="i2pinstall_${release.number}.jar.sig" />
2230            <arg value="i2psource_${release.number}.tar.bz2.sig" />
2231            <arg value="i2pupdate_${release.number}.zip.sig" />
2232        </exec>
2233        <echo message="   TBD    i2pinstall_${release.number}_windows.exe" />
2234        <echo message="   TBD    i2pinstall_${release.number}_windows.exe.sig" />
2235        <echo message="SHA256 sums:" />
2236      <!--
2237        <sha256sum file="i2pinstall_${release.number}_windows.exe" />
2238       -->
2239        <echo message="   TBD    i2pinstall_${release.number}_windows.exe" />
2240        <sha256sum file="i2pinstall_${release.number}.jar" />
2241        <sha256sum file="i2psource_${release.number}.tar.bz2" />
2242        <sha256sum file="i2pupdate_${release.number}.zip" />
2243        <sha256sum file="i2pupdate.su3" />
2244        <!-- make torrent files -->
2245        <copy file="i2pupdate.su3" tofile="i2pupdate-${release.number}.su3" />
2246        <mktorrent file="i2pupdate-${release.number}.su3" />
2247        <echo message="Don't forget to sign i2pinstall_${release.number}_windows.exe on Windows and then:" />
2248        <echo message="    ${gpg} -u ${release.gpg.keyid} -b i2pinstall_${release.number}_windows.exe" />
2249        <echo message="    sha256sum i2pinstall_${release.number}_windows.exe" />
2250        <echo message="Don't forget to mtn tag w: i2p-${release.number}" />
2251        <echo message="... and mtn cert t:i2p-${release.number} branch i2p.i2p.release" />
2252    </target>
2253
2254    <!-- depends on buildCoreTest so that the router unit test javadocs can find the core unit test classes -->
2255    <target name="mavenCentral.deps" depends="buildRouter, buildStreaming, buildCoreTest">
2256        <ant dir="core/java/">
2257            <target name="javadocJar" />
2258            <target name="sourcesJar" />
2259        </ant>
2260        <ant dir="router/java/">
2261            <target name="javadocJar" />
2262            <target name="sourcesJar" />
2263        </ant>
2264        <ant dir="apps/ministreaming/java/">
2265            <target name="javadocJar" />
2266            <target name="sourcesJar" />
2267        </ant>
2268        <ant dir="apps/streaming/java/">
2269            <target name="javadocJar" />
2270            <target name="sourcesJar" />
2271        </ant>
2272        <ant dir="apps/jetty/">
2273            <target name="servletJar" />
2274            <target name="servletJavadocJar" />
2275            <target name="servletSourcesJar" />
2276        </ant>
2277    </target>
2278
2279    <target name="mavenCentral" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, mavenCentral.deps">
2280        <mkdir dir="./pkg-mavencentral" />
2281        <!-- Libraries -->
2282        <copy file="build/i2p.jar" tofile="pkg-mavencentral/i2p-${release.number}.jar" />
2283        <copy file="build/router.jar" tofile="pkg-mavencentral/router-${release.number}.jar" />
2284        <copy file="build/mstreaming.jar" tofile="pkg-mavencentral/mstreaming-${release.number}.jar" />
2285        <copy file="build/streaming.jar" tofile="pkg-mavencentral/streaming-${release.number}.jar" />
2286        <copy file="apps/jetty/build/servlet-i2p-${release.number}.jar" todir="pkg-mavencentral/" />
2287        <!-- JavaDocs -->
2288        <copy file="core/java/build/i2p-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
2289        <copy file="router/java/build/router-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
2290        <copy file="apps/ministreaming/java/build/mstreaming-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
2291        <copy file="apps/streaming/java/build/streaming-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
2292        <copy file="apps/jetty/build/servlet-i2p-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
2293        <!-- Sources -->
2294        <copy file="core/java/build/i2p-${release.number}-sources.jar" todir="pkg-mavencentral/" />
2295        <copy file="router/java/build/router-${release.number}-sources.jar" todir="pkg-mavencentral/" />
2296        <copy file="apps/ministreaming/java/build/mstreaming-${release.number}-sources.jar" todir="pkg-mavencentral/" />
2297        <copy file="apps/streaming/java/build/streaming-${release.number}-sources.jar" todir="pkg-mavencentral/" />
2298        <copy file="apps/jetty/build/servlet-i2p-${release.number}-sources.jar" todir="pkg-mavencentral/" />
2299        <echo message="This requires the Maven Ant Tasks to be installed." />
2300        <echo message="If this fails, on Debian jessie or, Ubuntu trusty/xenial:" />
2301        <echo message="sudo apt-get install libmaven-ant-tasks-java" />
2302        <echo message="Sorry, not available on more recent distributions" />
2303        <!-- POMs -->
2304        <artifact:pom id="i2ppom" groupId="net.i2p" artifactId="i2p" version="${release.number}"
2305                name="I2P Core"
2306                description="The core I2P APIs"
2307                url="https://geti2p.net/">
2308            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
2309            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
2310            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/"/>
2311            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
2312                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
2313                 url="git@github.com:i2p/i2p.i2p.git" />
2314        </artifact:pom>
2315        <artifact:pom id="routerpom" groupId="net.i2p" artifactId="router" version="${release.number}"
2316                name="I2P Router"
2317                description="The I2P router"
2318                url="https://geti2p.net/">
2319            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
2320            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
2321            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/"/>
2322            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
2323                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
2324                 url="git@github.com:i2p/i2p.i2p.git" />
2325            <dependency groupId="net.i2p" artifactId="i2p" version="${release.number}" />
2326        </artifact:pom>
2327        <artifact:pom id="mstreamingpom" groupId="net.i2p.client" artifactId="mstreaming" version="${release.number}"
2328                name="I2P Ministreaming"
2329                description="API, interfaces, and factory for a TCP-like set of sockets for communicating over I2P."
2330                url="https://geti2p.net/en/docs/api/streaming">
2331            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
2332            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
2333            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/" />
2334            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
2335                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
2336                 url="git@github.com:i2p/i2p.i2p.git" />
2337            <dependency groupId="net.i2p" artifactId="i2p" version="${release.number}" />
2338        </artifact:pom>
2339        <artifact:pom id="streamingpom" groupId="net.i2p.client" artifactId="streaming" version="${release.number}"
2340                name="I2P Streaming"
2341                description="Implementation of a TCP-like set of sockets for communicating over I2P."
2342                url="https://geti2p.net/en/docs/api/streaming">
2343            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
2344            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
2345            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/" />
2346            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
2347                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
2348                 url="git@github.com:i2p/i2p.i2p.git" />
2349            <dependency groupId="net.i2p" artifactId="i2p" version="${release.number}" />
2350            <dependency groupId="net.i2p.client" artifactId="mstreaming" version="${release.number}" />
2351        </artifact:pom>
2352        <artifact:pom id="servletpom" groupId="net.i2p" artifactId="servlet-i2p" version="${release.number}"
2353                name="I2P Servlet classes"
2354                description="Various servlet classes provided to plugins by Java I2P."
2355                url="https://geti2p.net/">
2356            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
2357            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
2358            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/" />
2359            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
2360                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
2361                 url="git@github.com:i2p/i2p.i2p.git" />
2362            <dependency groupId="net.i2p" artifactId="i2p" version="${release.number}" />
2363            <dependency groupId="org.apache.tomcat" artifactId="tomcat-servlet-api" version="8.0.33" />
2364        </artifact:pom>
2365        <artifact:writepom pomRefId="i2ppom" file="pkg-mavencentral/i2p-${release.number}.pom"/>
2366        <artifact:writepom pomRefId="routerpom" file="pkg-mavencentral/router-${release.number}.pom"/>
2367        <artifact:writepom pomRefId="mstreamingpom" file="pkg-mavencentral/mstreaming-${release.number}.pom" />
2368        <artifact:writepom pomRefId="streamingpom" file="pkg-mavencentral/streaming-${release.number}.pom" />
2369        <artifact:writepom pomRefId="servletpom" file="pkg-mavencentral/servlet-i2p-${release.number}.pom" />
2370        <!-- Signatures -->
2371        <echo message="Sign the files:" />
2372        <input message="Enter GPG key ID (e.g. 0x12345678) for signing:" addproperty="release.gpg.keyid" />
2373        <fail message="You must enter a key ID." >
2374            <condition>
2375                <equals arg1="${release.gpg.keyid}" arg2=""/>
2376            </condition>
2377        </fail>
2378        <!-- the gpgsign macro sets the permission of signed files and the sigs themselves to 444 -->
2379        <gpgsignasc file="pkg-mavencentral/i2p-${release.number}.jar" />
2380        <gpgsignasc file="pkg-mavencentral/i2p-${release.number}.pom" />
2381        <gpgsignasc file="pkg-mavencentral/i2p-${release.number}-javadoc.jar" />
2382        <gpgsignasc file="pkg-mavencentral/i2p-${release.number}-sources.jar" />
2383        <gpgsignasc file="pkg-mavencentral/router-${release.number}.jar" />
2384        <gpgsignasc file="pkg-mavencentral/router-${release.number}.pom" />
2385        <gpgsignasc file="pkg-mavencentral/router-${release.number}-javadoc.jar" />
2386        <gpgsignasc file="pkg-mavencentral/router-${release.number}-sources.jar" />
2387        <gpgsignasc file="pkg-mavencentral/mstreaming-${release.number}.jar" />
2388        <gpgsignasc file="pkg-mavencentral/mstreaming-${release.number}.pom" />
2389        <gpgsignasc file="pkg-mavencentral/mstreaming-${release.number}-javadoc.jar" />
2390        <gpgsignasc file="pkg-mavencentral/mstreaming-${release.number}-sources.jar" />
2391        <gpgsignasc file="pkg-mavencentral/streaming-${release.number}.jar" />
2392        <gpgsignasc file="pkg-mavencentral/streaming-${release.number}.pom" />
2393        <gpgsignasc file="pkg-mavencentral/streaming-${release.number}-javadoc.jar" />
2394        <gpgsignasc file="pkg-mavencentral/streaming-${release.number}-sources.jar" />
2395        <gpgsignasc file="pkg-mavencentral/servlet-i2p-${release.number}.jar" />
2396        <gpgsignasc file="pkg-mavencentral/servlet-i2p-${release.number}.pom" />
2397        <gpgsignasc file="pkg-mavencentral/servlet-i2p-${release.number}-javadoc.jar" />
2398        <gpgsignasc file="pkg-mavencentral/servlet-i2p-${release.number}-sources.jar" />
2399        <!-- Bundle -->
2400        <jar destfile="mavencentral-i2p.jar">
2401            <fileset dir="./pkg-mavencentral">
2402                <include name="i2p-*" />
2403            </fileset>
2404        </jar>
2405        <jar destfile="mavencentral-router.jar">
2406            <fileset dir="./pkg-mavencentral">
2407                <include name="router-*" />
2408            </fileset>
2409        </jar>
2410        <jar destfile="mavencentral-mstreaming.jar">
2411            <fileset dir="./pkg-mavencentral">
2412                <include name="mstreaming-*" />
2413            </fileset>
2414        </jar>
2415        <jar destfile="mavencentral-streaming.jar">
2416            <fileset dir="./pkg-mavencentral">
2417                <include name="streaming-*" />
2418            </fileset>
2419        </jar>
2420        <jar destfile="mavencentral-servlet-i2p.jar">
2421            <fileset dir="./pkg-mavencentral">
2422                <include name="servlet-i2p-*" />
2423            </fileset>
2424        </jar>
2425        <echo message="Now upload mavencentral-*.jar to Maven Central." />
2426    </target>
2427
2428    <target name="debian" depends="debian-clean, debchange, debian-binary" />
2429    <target name="precise" depends="copy-precise, debian" />
2430    <target name="wheezy" depends="precise" />
2431    <target name="trusty" depends="copy-trusty, debian" />
2432    <target name="jessie" depends="trusty" />
2433    <target name="xenial" depends="copy-xenial, debian" />
2434    <target name="bionic" depends="copy-bionic, debian" />
2435    <target name="disco" depends="copy-disco, debian" />
2436    <target name="buster" depends="disco" />
2437
2438    <target name="copy-precise">
2439        <copy todir="debian" overwrite="true">
2440            <fileset dir="debian-alt/precise/" />
2441        </copy>
2442    </target>
2443    <target name="copy-trusty">
2444        <copy todir="debian" overwrite="true">
2445            <fileset dir="debian-alt/trusty/" />
2446        </copy>
2447    </target>
2448    <target name="copy-xenial">
2449        <copy todir="debian" overwrite="true">
2450            <fileset dir="debian-alt/xenial/" />
2451        </copy>
2452    </target>
2453    <target name="copy-bionic">
2454        <copy todir="debian" overwrite="true">
2455            <fileset dir="debian-alt/bionic/" />
2456        </copy>
2457    </target>
2458    <target name="copy-disco">
2459        <copy todir="debian" overwrite="true">
2460            <fileset dir="debian-alt/disco/" />
2461        </copy>
2462    </target>
2463
2464    <target name="getExtendedVersion" depends="buildProperties, trimMtnRev">
2465        <property name="MtnShortHash" value="unknown" />
2466        <condition property="Extended.Version" value="${full.version}-${MtnShortHash}">
2467            <not>
2468                <or>
2469                    <equals arg1="${MtnShortHash}" arg2="" />
2470                    <equals arg1="${MtnShortHash}" arg2="unknown" />
2471                </or>
2472            </not>
2473        </condition>
2474        <!-- if not set above we'll set it here -->
2475        <property name="Extended.Version" value="${full.version}" />
2476    </target>
2477
2478    <target name="debchange" depends="getExtendedVersion" unless="noAutoDebchange">
2479        <echo message= "Debian version is ${Extended.Version}-1" />
2480        <exec executable="dch" failonerror="true">
2481            <arg value="-b" />
2482            <arg value="--check-dirname-level" />
2483            <arg value="0" />
2484            <arg value="-v" />
2485            <arg value="${Extended.Version}-1" />
2486            <arg value="Unofficial Debian package built using &quot;ant debian&quot;" />
2487        </exec>
2488    </target>
2489
2490    <target name="debian-binary" depends="getExtendedVersion">
2491        <exec executable="fakeroot" failonerror="true">
2492            <arg value="debian/rules" />
2493            <arg value="patch" />
2494            <arg value="binary" />
2495            <arg value="clean" />
2496        </exec>
2497        <delete dir=".pc" />
2498        <move todir=".">
2499            <fileset dir=".." includes="libjbigi*${release.number}*.deb i2p*${release.number}*.deb" />
2500        </move>
2501        <echo message="" />
2502        <echo message="====================" />
2503        <echo message="Packages have been built and moved to ${basedir}" />
2504        <echo message="====================" />
2505    </target>
2506
2507    <target name="debian-clean" depends="getExtendedVersion" >
2508        <exec executable="fakeroot" failonerror="true">
2509            <arg value="debian/rules" />
2510            <arg value="clean" />
2511        </exec>
2512        <delete dir="./.pc" />
2513    </target>
2514
2515    <!-- stretch+, zesty+ -->
2516    <target name="debian-tarball" depends="getExtendedVersion, failIfNoMtn">
2517        <!-- this will use the monotonerc file in the current workspace -->
2518        <property name="debian.tarball.name" value="i2p_${Extended.Version}.orig.tar.bz2" />
2519        <echo message="Checking out fresh copy into ../i2p-${Extended.Version} for tarballing:" />
2520        <delete dir="../i2p-${Extended.Version}" />
2521        <exec executable="mtn" failonerror="true">
2522            <arg value="co" />
2523            <!-- w: is the revision of the current workspace -->
2524            <arg value="-r" />
2525            <arg value="w:" />
2526            <arg value="../i2p-${Extended.Version}" />
2527        </exec>
2528        <delete includeemptydirs="true" quiet="false" failonerror="false">
2529            <fileset dir="../i2p-${Extended.Version}/debian-alt/" />
2530            <fileset dir="../i2p-${Extended.Version}/installer/" includes="*.xml" />
2531            <fileset dir="../i2p-${Extended.Version}/installer/c/" />
2532            <fileset dir="../i2p-${Extended.Version}/installer/doc/" />
2533            <fileset dir="../i2p-${Extended.Version}/installer/lib/" />
2534            <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" />
2535            <fileset dir="../i2p-${Extended.Version}/installer/resources/Start I2P Router.app/" />
2536            <fileset dir="../i2p-${Extended.Version}/installer/resources/portable/" />
2537            <fileset dir="../i2p-${Extended.Version}/installer/resources/small/" />
2538            <fileset dir="../i2p-${Extended.Version}/Slackware" />
2539            <fileset dir="../i2p-${Extended.Version}/_MTN" />
2540            <fileset dir="../i2p-${Extended.Version}/.idea" />
2541            <fileset dir="../i2p-${Extended.Version}/.tx" />
2542            <file name="../i2p-${Extended.Version}/.mtn-ignore" />
2543            <fileset dir="../i2p-${Extended.Version}/" includes="Docker*" />
2544            <file name="../i2p-${Extended.Version}/Makefile.gcj" />
2545            <fileset dir="../i2p-${Extended.Version}/docs" />
2546            <fileset dir="../i2p-${Extended.Version}/launchers" />
2547            <file name="../i2p-${Extended.Version}/.travis.yml" />
2548            <file name="../i2p-${Extended.Version}/.gitignore" />
2549            <!-- gradle files -->
2550            <fileset dir="../i2p-${Extended.Version}/" includes="**/build.gradle" />
2551            <fileset dir="../i2p-${Extended.Version}/gradle" />
2552            <file name="../i2p-${Extended.Version}/gradlew" />
2553            <file name="../i2p-${Extended.Version}/gradlew.bat" />
2554            <file name="../i2p-${Extended.Version}/gradle.properties" />
2555            <file name="../i2p-${Extended.Version}/settings.gradle" />
2556            <!-- gettext-base -->
2557            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/gettext" />
2558            <!-- libgetopt-java -->
2559            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/getopt" />
2560            <!-- libjson-simple-java -->
2561            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/json" />
2562            <!-- libhttpclient-java and libhttpcore-java -->
2563          <!--
2564            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/apache/http" />
2565           -->
2566            <!-- geoip-database -->
2567            <file name="../i2p-${Extended.Version}/installer/resources/geoip.txt" />
2568            <file name="../i2p-${Extended.Version}/installer/resources/geoipv6.dat.gz" />
2569            <file name="../i2p-${Extended.Version}/installer/resources/GeoLite2-Country.mmdb.gz" />
2570            <!-- libjetty9-java -->
2571            <fileset dir="../i2p-${Extended.Version}/apps/jetty/jetty-distribution-${jetty.ver}" />
2572            <!-- libtomcat8-java -->
2573            <fileset dir="../i2p-${Extended.Version}/apps/jetty/apache-tomcat-${tomcat.ver}" />
2574            <!-- libjstl1.1-java or glassfish-javaee or libtaglibs-standard -->
2575            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/jstl.jar" />
2576            <!-- libjakarta-taglibs-standard-java or glassfish-javaee or libtaglibs-standard -->
2577            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/standard.jar" />
2578            <fileset dir="../i2p-${Extended.Version}/installer/resources/icons/flags" />
2579            <!-- anything added above, add in debian-release-tarball also -->
2580        </delete>
2581        <tar longfile="gnu" destfile="../${debian.tarball.name}" compression="bzip2">
2582            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${Extended.Version}">
2583                <include name="**/**" />
2584                <exclude name="debian/**"/>
2585                <exclude name="**/*.sh"/>
2586                <!-- anything added above, add in debian-release-tarball also -->
2587            </tarfileset>
2588            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${Extended.Version}" filemode="755">
2589                <exclude name="debian/**" />
2590                <include name="**/*.sh" />
2591            </tarfileset>
2592        </tar>
2593    </target>
2594
2595    <!-- same as debian-release-tarball but with bundled jetty
2596      -  We add a 'p' to the release name and tarball since the source package is different;
2597      -  Launchpad does not allow different source packages with the same name.
2598      -->
2599    <target name="precise-release-tarball" depends="getExtendedVersion, failIfNoMtn">
2600        <property name="debian.tarball.name" value="i2p_${release.number}p.orig.tar.bz2" />
2601        <echo message="Checking out fresh copy into ../i2p-${Extended.Version} for tarballing:" />
2602        <delete dir="../i2p-${Extended.Version}" />
2603        <exec executable="mtn" failonerror="true">
2604            <arg value="co" />
2605            <!-- w: is the revision of the current workspace -->
2606            <arg value="-r" />
2607            <arg value="w:" />
2608            <arg value="-b" />
2609            <arg value="i2p.i2p" />
2610            <arg value="../i2p-${Extended.Version}" />
2611        </exec>
2612        <delete includeemptydirs="true" quiet="false" failonerror="false">
2613            <fileset dir="../i2p-${Extended.Version}/debian-alt/" />
2614            <fileset dir="../i2p-${Extended.Version}/installer/" includes="*.xml" />
2615            <fileset dir="../i2p-${Extended.Version}/installer/c/" />
2616            <fileset dir="../i2p-${Extended.Version}/installer/doc/" />
2617            <fileset dir="../i2p-${Extended.Version}/installer/lib/" />
2618            <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" />
2619            <fileset dir="../i2p-${Extended.Version}/installer/resources/Start I2P Router.app/" />
2620            <fileset dir="../i2p-${Extended.Version}/installer/resources/portable/" />
2621            <fileset dir="../i2p-${Extended.Version}/installer/resources/small/" />
2622            <fileset dir="../i2p-${Extended.Version}/Slackware" />
2623            <fileset dir="../i2p-${Extended.Version}/_MTN" />
2624            <fileset dir="../i2p-${Extended.Version}/.idea" />
2625            <fileset dir="../i2p-${Extended.Version}/.tx" />
2626            <file name="../i2p-${Extended.Version}/.mtn-ignore" />
2627            <fileset dir="../i2p-${Extended.Version}/" includes="Docker*" />
2628            <file name="../i2p-${Extended.Version}/Makefile.gcj" />
2629            <fileset dir="../i2p-${Extended.Version}/docs" />
2630            <fileset dir="../i2p-${Extended.Version}/launchers" />
2631            <file name="../i2p-${Extended.Version}/.travis.yml" />
2632            <file name="../i2p-${Extended.Version}/.gitignore" />
2633            <!-- gradle files -->
2634            <fileset dir="../i2p-${Extended.Version}/" includes="**/build.gradle" />
2635            <fileset dir="../i2p-${Extended.Version}/gradle" />
2636            <file name="../i2p-${Extended.Version}/gradlew" />
2637            <file name="../i2p-${Extended.Version}/gradlew.bat" />
2638            <file name="../i2p-${Extended.Version}/gradle.properties" />
2639            <file name="../i2p-${Extended.Version}/settings.gradle" />
2640            <!-- gettext-base -->
2641            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/gettext" />
2642            <!-- libgetopt-java -->
2643            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/getopt" />
2644            <!-- libhttpclient-java and libhttpcore-java -->
2645          <!--
2646            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/apache/http" />
2647           -->
2648            <!-- geoip-database -->
2649            <file name="../i2p-${Extended.Version}/installer/resources/geoip.txt" />
2650            <file name="../i2p-${Extended.Version}/installer/resources/geoipv6.dat.gz" />
2651            <file name="../i2p-${Extended.Version}/installer/resources/GeoLite2-Country.mmdb.gz" />
2652            <!-- libjetty9-java -->
2653          <!--
2654            <fileset dir="../i2p-${Extended.Version}/apps/jetty/jetty-distribution-${jetty.ver}" />
2655            <fileset dir="../i2p-${Extended.Version}/apps/jetty/apache-tomcat-${tomcat.ver}" />
2656           -->
2657            <!-- libjstl1.1-java or glassfish-javaee -->
2658          <!--
2659            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/jstl.jar" />
2660           -->
2661            <!-- libjakarta-taglibs-standard-java or glassfish-javaee -->
2662            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/standard.jar" />
2663            <!-- famfamfam-flag-png is in trusty but not precise, so leave them in the source package for both -->
2664            <!-- anything added above, add in debian-release-tarball also -->
2665        </delete>
2666        <tar longfile="gnu" destfile="../${debian.tarball.name}" compression="bzip2">
2667            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${Extended.Version}">
2668                <include name="**/**" />
2669                <exclude name="debian/**"/>
2670                <exclude name="**/*.sh"/>
2671                <!-- anything added above, add in debian-release-tarball also -->
2672            </tarfileset>
2673            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${Extended.Version}" filemode="755">
2674                <exclude name="debian/**" />
2675                <include name="**/*.sh" />
2676            </tarfileset>
2677        </tar>
2678    </target>
2679
2680    <!-- xenial/yakkety only -->
2681    <!-- same as debian-release-tarball but with bundled jstl.jar
2682         (there's no libtaglibs-standard-* packages)
2683      -  We add a 'x' to the release name and tarball since the source package is different;
2684      -  Launchpad does not allow different source packages with the same name.
2685      -->
2686    <target name="xenial-release-tarball" depends="getExtendedVersion, failIfNoMtn">
2687        <property name="debian.tarball.name" value="i2p_${release.number}x.orig.tar.bz2" />
2688        <echo message="Checking out fresh copy into ../i2p-${Extended.Version} for tarballing:" />
2689        <delete dir="../i2p-${Extended.Version}" />
2690        <exec executable="mtn" failonerror="true">
2691            <arg value="co" />
2692            <!-- w: is the revision of the current workspace -->
2693            <arg value="-r" />
2694            <arg value="w:" />
2695            <arg value="-b" />
2696            <arg value="i2p.i2p" />
2697            <arg value="../i2p-${Extended.Version}" />
2698        </exec>
2699        <delete includeemptydirs="true" quiet="false" failonerror="false">
2700            <fileset dir="../i2p-${Extended.Version}/debian-alt/" />
2701            <fileset dir="../i2p-${Extended.Version}/installer/" includes="*.xml" />
2702            <fileset dir="../i2p-${Extended.Version}/installer/c/" />
2703            <fileset dir="../i2p-${Extended.Version}/installer/doc/" />
2704            <fileset dir="../i2p-${Extended.Version}/installer/lib/" />
2705            <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" />
2706            <fileset dir="../i2p-${Extended.Version}/installer/resources/Start I2P Router.app/" />
2707            <fileset dir="../i2p-${Extended.Version}/installer/resources/portable/" />
2708            <fileset dir="../i2p-${Extended.Version}/installer/resources/small/" />
2709            <fileset dir="../i2p-${Extended.Version}/Slackware" />
2710            <fileset dir="../i2p-${Extended.Version}/_MTN" />
2711            <fileset dir="../i2p-${Extended.Version}/.idea" />
2712            <fileset dir="../i2p-${Extended.Version}/.tx" />
2713            <file name="../i2p-${Extended.Version}/.mtn-ignore" />
2714            <fileset dir="../i2p-${Extended.Version}/" includes="Docker*" />
2715            <file name="../i2p-${Extended.Version}/Makefile.gcj" />
2716            <fileset dir="../i2p-${Extended.Version}/docs" />
2717            <fileset dir="../i2p-${Extended.Version}/launchers" />
2718            <file name="../i2p-${Extended.Version}/.travis.yml" />
2719            <file name="../i2p-${Extended.Version}/.gitignore" />
2720            <!-- gradle files -->
2721            <fileset dir="../i2p-${Extended.Version}/" includes="**/build.gradle" />
2722            <fileset dir="../i2p-${Extended.Version}/gradle" />
2723            <file name="../i2p-${Extended.Version}/gradlew" />
2724            <file name="../i2p-${Extended.Version}/gradlew.bat" />
2725            <file name="../i2p-${Extended.Version}/gradle.properties" />
2726            <file name="../i2p-${Extended.Version}/settings.gradle" />
2727            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/gettext" />
2728            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/getopt" />
2729            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/json" />
2730          <!--
2731            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/apache/http" />
2732           -->
2733            <file name="../i2p-${Extended.Version}/installer/resources/geoip.txt" />
2734            <file name="../i2p-${Extended.Version}/installer/resources/geoipv6.dat.gz" />
2735            <file name="../i2p-${Extended.Version}/installer/resources/GeoLite2-Country.mmdb.gz" />
2736            <fileset dir="../i2p-${Extended.Version}/apps/jetty/jetty-distribution-${jetty.ver}" />
2737            <fileset dir="../i2p-${Extended.Version}/apps/jetty/apache-tomcat-${tomcat.ver}" />
2738          <!--
2739            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/jstl.jar" />
2740           -->
2741            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/standard.jar" />
2742            <fileset dir="../i2p-${Extended.Version}/installer/resources/icons/flags" />
2743            <!-- anything added above, add in debian-tarball also -->
2744        </delete>
2745        <tar longfile="gnu" destfile="../${debian.tarball.name}" compression="bzip2">
2746            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${release.number}">
2747                <include name="**/**" />
2748                <exclude name="debian/**"/>
2749                <exclude name="**/*.sh"/>
2750                <!-- anything added above, add in debian-tarball also -->
2751            </tarfileset>
2752            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${release.number}" filemode="755">
2753                <exclude name="debian/**" />
2754                <include name="**/*.sh" />
2755            </tarfileset>
2756        </tar>
2757    </target>
2758
2759    <!-- stretch+, zesty+ -->
2760    <!-- same as debian-tarball but with a release tar.bz2 file name and tar prefix -->
2761    <target name="debian-release-tarball" depends="getExtendedVersion, failIfNoMtn">
2762        <property name="debian.tarball.name" value="i2p_${release.number}.orig.tar.bz2" />
2763        <echo message="Checking out fresh copy into ../i2p-${Extended.Version} for tarballing:" />
2764        <delete dir="../i2p-${Extended.Version}" />
2765        <exec executable="mtn" failonerror="true">
2766            <arg value="co" />
2767            <!-- w: is the revision of the current workspace -->
2768            <arg value="-r" />
2769            <arg value="w:" />
2770            <arg value="-b" />
2771            <arg value="i2p.i2p" />
2772            <arg value="../i2p-${Extended.Version}" />
2773        </exec>
2774        <delete includeemptydirs="true" quiet="false" failonerror="false">
2775            <fileset dir="../i2p-${Extended.Version}/debian-alt/" />
2776            <fileset dir="../i2p-${Extended.Version}/installer/" includes="*.xml" />
2777            <fileset dir="../i2p-${Extended.Version}/installer/c/" />
2778            <fileset dir="../i2p-${Extended.Version}/installer/doc/" />
2779            <fileset dir="../i2p-${Extended.Version}/installer/lib/" />
2780            <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" />
2781            <fileset dir="../i2p-${Extended.Version}/installer/resources/Start I2P Router.app/" />
2782            <fileset dir="../i2p-${Extended.Version}/installer/resources/portable/" />
2783            <fileset dir="../i2p-${Extended.Version}/installer/resources/small/" />
2784            <fileset dir="../i2p-${Extended.Version}/Slackware" />
2785            <fileset dir="../i2p-${Extended.Version}/_MTN" />
2786            <fileset dir="../i2p-${Extended.Version}/.idea" />
2787            <fileset dir="../i2p-${Extended.Version}/.tx" />
2788            <file name="../i2p-${Extended.Version}/.mtn-ignore" />
2789            <fileset dir="../i2p-${Extended.Version}/" includes="Docker*" />
2790            <file name="../i2p-${Extended.Version}/Makefile.gcj" />
2791            <fileset dir="../i2p-${Extended.Version}/docs" />
2792            <fileset dir="../i2p-${Extended.Version}/launchers" />
2793            <file name="../i2p-${Extended.Version}/.travis.yml" />
2794            <file name="../i2p-${Extended.Version}/.gitignore" />
2795            <!-- gradle files -->
2796            <fileset dir="../i2p-${Extended.Version}/" includes="**/build.gradle" />
2797            <fileset dir="../i2p-${Extended.Version}/gradle" />
2798            <file name="../i2p-${Extended.Version}/gradlew" />
2799            <file name="../i2p-${Extended.Version}/gradlew.bat" />
2800            <file name="../i2p-${Extended.Version}/gradle.properties" />
2801            <file name="../i2p-${Extended.Version}/settings.gradle" />
2802            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/gettext" />
2803            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/getopt" />
2804            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/json" />
2805          <!--
2806            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/apache/http" />
2807           -->
2808            <file name="../i2p-${Extended.Version}/installer/resources/geoip.txt" />
2809            <file name="../i2p-${Extended.Version}/installer/resources/geoipv6.dat.gz" />
2810            <file name="../i2p-${Extended.Version}/installer/resources/GeoLite2-Country.mmdb.gz" />
2811            <fileset dir="../i2p-${Extended.Version}/apps/jetty/jetty-distribution-${jetty.ver}" />
2812            <fileset dir="../i2p-${Extended.Version}/apps/jetty/apache-tomcat-${tomcat.ver}" />
2813            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/jstl.jar" />
2814            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/standard.jar" />
2815            <fileset dir="../i2p-${Extended.Version}/installer/resources/icons/flags" />
2816            <!-- anything added above, add in debian-tarball also -->
2817        </delete>
2818        <tar longfile="gnu" destfile="../${debian.tarball.name}" compression="bzip2">
2819            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${release.number}">
2820                <include name="**/**" />
2821                <exclude name="debian/**"/>
2822                <exclude name="**/*.sh"/>
2823                <!-- anything added above, add in debian-tarball also -->
2824            </tarfileset>
2825            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${release.number}" filemode="755">
2826                <exclude name="debian/**" />
2827                <include name="**/*.sh" />
2828            </tarfileset>
2829        </tar>
2830    </target>
2831
2832    <target name="debian-patch" depends="getExtendedVersion" >
2833        <exec executable="quilt" failonerror="true">
2834            <arg value="-a" />
2835            <arg value="push" />
2836        </exec>
2837        <echo message="====================" />
2838    </target>
2839    <target name="debian-unpatch" depends="buildProperties">
2840        <exec executable="quilt" failonerror="false">
2841            <arg value="-a" />
2842            <arg value="pop" />
2843        </exec>
2844    </target>
2845
2846    <target name="debianrepo" depends="debian">
2847        <exec dir="debian" executable="./makerepo.sh" failonerror="true"/>
2848    </target>
2849
2850<!-- the following are appened to help build barebone portable version,
2851     none of the above is modified for this purpose -->
2852        <target name = "pkg-portable-clean">
2853                <delete dir="build/" />
2854                <delete dir="pkg-temp/" />
2855                <delete>
2856                        <fileset dir="." includes="portable-**.zip**" />
2857                </delete>
2858        </target>
2859<!-- build a portable archive -->
2860
2861<!-- *0* Since we simply pack all files in folder "build/" into our archieve,
2862                we need to make sure its small, with NO redundent jars or wars.
2863                thus cleaning is required before each build-->
2864        <target name="buildSmallOnly" depends="pkg-portable-clean,buildSmall"/>
2865
2866<!-- *1* preparing the jars by OS dependent de-bloating -->
2867        <target name="preppkg-portable-win32-jbigi" depends="buildSmallOnly, jbigi-windows-only" />
2868
2869        <target name="preppkg-portable-linux-jbigi"  depends="buildSmallOnly, jbigi-linux-only" />
2870
2871<!-- *2* os independent procedure  -->
2872        <target name="preppkg-portable-basic" >
2873                <mkdir dir="pkg-temp" />
2874                        <!-- non OS dependent configurations only, dont add *nux/win stuff here -->
2875                        <copy todir="pkg-temp">
2876                                <fileset dir="installer/resources/portable/configs/" />
2877                        </copy>
2878                        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
2879                        <copy file="installer/resources/hosts.txt" todir="pkg-temp/" />
2880                        <copy file="installer/resources/readme.license.txt" todir="pkg-temp/" />
2881                <mkdir dir="pkg-temp/addressbook" />
2882                        <copy file="apps/addressbook/subscriptions.txt" todir="pkg-temp/addressbook/" />
2883                        <copy file="apps/addressbook/myhosts.txt"  todir="pkg-temp/addressbook/" />
2884                        <!-- config.txt is in installer/resources/portable -->
2885                <mkdir dir="pkg-temp/docs" />
2886                        <copy file="installer/resources/initialNews/initialNews.xml" tofile="pkg-temp/docs/news.xml" overwrite="true" />
2887                        <copy file="installer/resources/readme/readme.html" tofile="pkg-temp/docs/readme.html" />
2888                        <copy file="installer/resources/startconsole.html" todir="pkg-temp/docs/" />
2889                        <copy file="installer/resources/start.ico" todir="pkg-temp/docs/" />
2890                        <copy file="installer/resources/console.ico" todir="pkg-temp/docs/" />
2891                        <!-- HTTP Header files, english only,
2892                                if you need a different lang do it in a seperate target -->
2893                        <copy todir="pkg-temp/docs/" >
2894                                <fileset dir="installer/resources/proxy/"  includes="**-header.ht" />
2895                        </copy>
2896                        <!-- Theme light only -->
2897                        <copy todir="pkg-temp/docs/themes/console/light/" overwrite="true" >
2898                                <fileset dir="installer/resources/themes/console/light/" includes="**.css" />
2899                        </copy>
2900                        <copy file="installer/resources/themes/console/light/console_big.css" todir="portable/docs/themes/console/light/" />
2901                        <copy todir="pkg-temp/docs/themes/console/images/" >
2902                                <fileset dir="installer/resources/themes/console/images/" />
2903                        </copy>
2904                        <!-- FLAGs for language icon (not for ip)-->
2905                        <copy todir="pkg-temp/docs/icons" >
2906                                <fileset dir="installer/resources/icons" />
2907                        </copy>
2908                <mkdir dir="pkg-temp/webapps" />
2909                        <copy todir="pkg-temp/webapps/">
2910                                <fileset dir="build/" includes="**.war" />
2911                        </copy>
2912                <mkdir dir="pkg-temp/lib" />
2913                        <copy todir ="pkg-temp/lib/" >
2914                                <fileset dir="build/" includes="**.jar" />
2915                        </copy>
2916                        <!-- 3rd party jars from apps/  -->
2917                                <!-- jrobin - without jobin , you lost graph and get a lot error entry in logs -->
2918                        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
2919        </target>
2920<!-- *3* os dependent procedure/commands -->
2921        <target name = "preppkg-portable-win32" depends="preppkg-portable-win32-jbigi,preppkg-portable-basic">
2922                        <!--wrapper - dont even think about it. i2p cosumes appreantly more mem without it on win32-->
2923                <copy file="installer/lib/wrapper/win32/wrapper.dll" todir="pkg-temp/lib" />
2924                <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
2925                <copy file="installer/lib/wrapper/win32/I2Psvc.exe" tofile="pkg-temp/i2psvc.ex_" />
2926                        <!--  copy the unpack/start batchfiles -->
2927                <copy todir="pkg-temp">
2928                        <fileset dir="installer/resources/portable/win32/" />
2929                </copy>
2930        </target>
2931<!-- *4* command for windows package -->
2932        <target name = "pkg-portable-win32"     depends="preppkg-portable-win32, pack200" >
2933                <!-- i need the portable\ folder in .zip so basedir is set to . -->
2934                <move file="pkg-temp" tofile="portable"/>
2935                <zip destfile="portable-win32.zip" basedir="." level="9" includes="portable\**" />
2936                <checksum file="portable-win32.zip" forceOverwrite="yes"/>
2937                <move file="portable" tofile="pkg-temp"/>
2938        </target>
2939</project>
Note: See TracBrowser for help on using the repository browser.