source: build.xml @ b89720e

Last change on this file since b89720e was 1ffc006, checked in by zzz <zzz@…>, 13 months ago

Build: Remove dependencies on Nashorn (ticket #2367)

  • Property mode set to 100644
File size: 153.7 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<project basedir="." default="all" name="i2p"
3    xmlns:artifact="antlib:org.apache.maven.artifact.ant">
4
5    <!-- Include property files so that values can be easily overridden.
6         Users should create an override.properties file to make changes.
7     -->
8    <property file="override.properties"/>
9    <property file="build.properties"/>
10    <!--  When changing, also change javadoc URL in build.properties, and checksum in apps/jetty/build.xml -->
11    <property name="jetty.ver" value="9.2.25.v20180606" />
12    <property name="tomcat.ver" value="8.5.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        <delete file="syndie-standalone.zip" failonerror="false" quiet="true" />
1054        <delete file="i2psnark-standalone.zip" failonerror="false" quiet="true" />
1055        <delete file="BOB-one.jar" failonerror="false" quiet="true" />
1056        <delete file="core/java/cobertura.ser"/>
1057        <delete file="javadoc.zip" />
1058        <delete file="i2p.fba" />
1059        <delete file="${sloccount.report.file}" />
1060        <delete file="mavencentral-i2p.jar" />
1061        <delete file="mavencentral-router.jar" />
1062        <delete file="mavencentral-mstreaming.jar" />
1063        <delete file="mavencentral-streaming.jar" />
1064        <delete file="mavencentral-servlet-i2p.jar" />
1065    </target>
1066
1067    <target name="distclean" depends="clean">
1068        <delete failonerror="false" quiet="true">
1069            <fileset dir="." includes="i2pinstall* *.deb i2p_*.bz2 i2pupdate* i2psource* *.sig *.torrent" />
1070        </delete>
1071        <ant dir="core/java/" target="distclean" />
1072        <ant dir="router/java/" target="distclean" />
1073        <ant dir="installer/java" target="distclean" />
1074        <ant dir="apps/ministreaming/java/" target="distclean" />
1075        <ant dir="apps/streaming/java/" target="distclean" />
1076        <ant dir="apps/i2ptunnel/java/" target="distclean" />
1077        <ant dir="apps/sam/java/" target="distclean" />
1078        <ant dir="apps/BOB" target="clean" />
1079        <ant dir="apps/desktopgui" target="clean" />
1080        <ant dir="apps/routerconsole/java/" target="distclean" />
1081        <ant dir="apps/addressbook/" target="distclean" />
1082        <ant dir="apps/susimail/" target="distclean" />
1083        <ant dir="apps/susidns/src/" target="distclean" />
1084        <ant dir="apps/systray/java/" target="distclean" />
1085        <ant dir="apps/i2psnark/java/" target="distclean" />
1086        <ant dir="apps/jetty/" target="distclean" />
1087        <ant dir="apps/imagegen/" target="distclean" />
1088        <ant dir="apps/jrobin/java" target="distclean" />
1089        <delete dir="core/c/jbigi/bin" />
1090        <delete dir="core/c/jbigi/lib" />
1091        <delete dir="core/c/jcpuid/lib" />
1092        <ant dir="installer/resources/locale" target="distclean" />
1093        <ant dir="installer/tools/java" target="distclean" />
1094        <!--
1095                NOTE! We need to turn off the default excludes for these
1096                patterns to work.
1097                These are the defaultexcludes in Ant as seen on
1098                http://ant.apache.org/manual/CoreTasks/defaultexcludes.html
1099                     **/*~
1100                     **/#*#
1101                     **/.#*
1102                     **/%*%
1103                     **/._*
1104                     **/CVS
1105                     **/CVS/**
1106                     **/.cvsignore
1107                     **/SCCS
1108                     **/SCCS/**
1109                     **/vssver.scc
1110                     **/.svn
1111                     **/.svn/**
1112                     **/.DS_Store
1113                The only recourse is to remove the offending ones.
1114                We do this here, as we only need one change, and then put it
1115                back after we are done with it.
1116        -->
1117        <defaultexcludes remove="**/*~"/>
1118
1119        <delete>
1120            <fileset dir="." includes="**/*.class **/*.java~ **/*.txt~ **/*.xml~ **/*.sh~ **/*.SlackBuild~" />
1121            <!--
1122                Less common, but they pollute my workspace here, so we
1123                might as well nuke these as well. Are there any others?
1124
1125                !!??? Why don't we just nuke "**/*~" ???!!
1126
1127                ++Sponge
1128            -->
1129        </delete>
1130        <!--
1131                Now we put the defaults back
1132        -->
1133        <defaultexcludes default="true"/>
1134    </target>
1135
1136    <target name="webappDistclean">
1137        <ant dir="apps/i2ptunnel/java/" target="distclean" />
1138        <ant dir="apps/routerconsole/java/" target="distclean" />
1139        <ant dir="apps/addressbook/" target="distclean" />
1140        <ant dir="apps/susimail/" target="distclean" />
1141        <ant dir="apps/susidns/src/" target="distclean" />
1142        <ant dir="apps/i2psnark/java/" target="distclean" />
1143        <ant dir="apps/imagegen/" target="distclean" />
1144    </target>
1145
1146    <target name="pkg" depends="distclean, updater, preppkg, installer" />
1147
1148    <target name="pkg200" depends="distclean, updater200, preppkg, installer" />
1149
1150    <target name="pkgclean" depends="deletepkg-temp">
1151        <delete>
1152            <fileset dir="." includes="i2p.tar.bz2 install.jar i2pupdate.zip i2pupdate200.zip" />
1153        </delete>
1154    </target>
1155
1156    <target name="preppkg" depends="preppkg-linux, preppkg-freebsd, preppkg-osx, preppkg-windows, jbigi">
1157        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
1158        <copy todir="pkg-temp/lib/wrapper/solaris/">
1159            <fileset dir="installer/lib/wrapper/solaris/" excludes="*.txt" />
1160        </copy>
1161     <!-- Force using the new wrapper.jar.
1162          The new jar with the old windows binaries will output a warning on windows.
1163          We do not generate release files from this target.
1164          See preppkg-windows-only target below.
1165      -->
1166        <copy overwrite="true" file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
1167    </target>
1168
1169    <target name="preppkg-nowindows" depends="preppkg-linux, preppkg-freebsd, preppkg-osx, jbigi-nowindows">
1170        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
1171        <copy todir="pkg-temp/lib/wrapper/solaris/">
1172            <fileset dir="installer/lib/wrapper/solaris/" excludes="*.txt" />
1173        </copy>
1174        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
1175    </target>
1176
1177    <target name="preppkgRepack" depends="preppkg-linux, preppkg-freebsd, preppkg-osx, preppkg-windows, jbigi">
1178        <ant target="repack200" />
1179        <!-- no use doing repack200 on jbigi.jar -->
1180        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
1181        <copy todir="pkg-temp/lib/wrapper/solaris/">
1182            <fileset dir="installer/lib/wrapper/solaris/" excludes="*.txt" />
1183        </copy>
1184    </target>
1185
1186    <target name="preppkg-freebsd" depends="preppkg-unix">
1187        <copy todir="pkg-temp/lib/wrapper/freebsd/">
1188            <fileset dir="installer/lib/wrapper/freebsd/" excludes="*.txt" />
1189        </copy>
1190        <copy todir="pkg-temp/lib/wrapper/freebsd64/">
1191            <fileset dir="installer/lib/wrapper/freebsd64" excludes="*.txt" />
1192        </copy>
1193    </target>
1194
1195    <target name="preppkg-freebsd-only" depends="preppkg-freebsd, jbigi-freebsd-only" >
1196        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
1197        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
1198    </target>
1199
1200    <!-- only what is needed for debian, etc. -->
1201    <target name="preppkg-linux-only" depends="preppkg-linux, jbigi-linux-only" >
1202        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
1203        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
1204    </target>
1205
1206    <!-- This is the target called by debian/rules -->
1207    <target name="preppkg-unix" depends="preppkg-base, prep-script-translation" >
1208        <copy file="installer/resources/runplain.sh" todir="pkg-temp/" />
1209        <copy file="installer/resources/eepget" todir="pkg-temp/" />
1210        <copy file="installer/resources/i2prouter" todir="pkg-temp/" />
1211        <copy file="installer/resources/osid" todir="pkg-temp/" />
1212        <copy file="installer/resources/postinstall.sh" todir="pkg-temp/" />
1213        <copy todir="pkg-temp/man/">
1214            <fileset dir="installer/resources/man/" />
1215        </copy>
1216    </target>
1217
1218    <target name="preppkg-linux" depends="preppkg-linux-x86,preppkg-linux-nonx86" />
1219
1220    <target name="preppkg-linux-x86" depends="preppkg-unix">
1221        <copy todir="pkg-temp/lib/wrapper/linux/">
1222            <fileset dir="installer/lib/wrapper/linux/" excludes="*.txt" />
1223        </copy>
1224        <copy todir="pkg-temp/lib/wrapper/linux64/">
1225            <fileset dir="installer/lib/wrapper/linux64/" excludes="*.txt" />
1226        </copy>
1227    </target>
1228
1229    <target name="preppkg-linux-nonx86" depends="preppkg-unix">
1230        <copy todir="pkg-temp/lib/wrapper/linux-ppc/">
1231            <fileset dir="installer/lib/wrapper/linux-ppc/" excludes="*.txt" />
1232        </copy>
1233        <copy todir="pkg-temp/lib/wrapper/linux-armv5/">
1234            <fileset dir="installer/lib/wrapper/linux-armv5/" excludes="*.txt" />
1235        </copy>
1236        <copy todir="pkg-temp/lib/wrapper/linux-armv6/">
1237            <fileset dir="installer/lib/wrapper/linux-armv6/" excludes="*.txt" />
1238        </copy>
1239    </target>
1240
1241    <target name="preppkg-osx" depends="preppkg-unix">
1242        <!--<copy file="installer/resources/I2P Router Console.webloc" todir="pkg-temp/" />-->
1243        <copy todir="pkg-temp/Start I2P Router.app">
1244            <fileset dir="installer/resources/Start I2P Router.app" />
1245        </copy>
1246        <copy todir="pkg-temp/lib/wrapper/macosx/">
1247            <fileset dir="installer/lib/wrapper/macosx/" excludes="*.txt" />
1248        </copy>
1249        <copy file="installer/resources/net.i2p.router.plist.template" todir="pkg-temp/" />
1250        <copy file="installer/resources/install_i2p_service_osx.command" todir="pkg-temp/" />
1251        <copy file="installer/resources/uninstall_i2p_service_osx.command" todir="pkg-temp/" />
1252    </target>
1253
1254    <target name="preppkg-osx-only" depends="preppkg-osx, jbigi-osx-only" >
1255        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
1256        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
1257    </target>
1258
1259    <target name="preppkg-windows" depends="preppkg-base, preplicenses-windows, buildUtilityJar, buildexe">
1260        <copy file="build/i2p.exe" todir="pkg-temp/" failonerror="false" />
1261        <copy file="installer/resources/eepget.bat" todir="pkg-temp/" />
1262        <copy file="installer/resources/i2prouter.bat" todir="pkg-temp/" />
1263        <copy file="installer/resources/fixperms.bat" todir="pkg-temp/" />
1264        <copy file="installer/resources/install_i2p_service_winnt.bat" todir="pkg-temp/" />
1265        <copy file="installer/resources/set_config_dir_for_nt_service.bat" todir="pkg-temp/" />
1266        <copy file="installer/resources/uninstall_i2p_service_winnt.bat" todir="pkg-temp/" />
1267        <copy file="build/utility.jar" todir="pkg-temp" />
1268        <copy todir="pkg-temp/lib/wrapper/win32/">
1269            <fileset dir="installer/lib/wrapper/win32/" excludes="*.txt" />
1270        </copy>
1271        <copy todir="pkg-temp/lib/wrapper/win64/">
1272            <fileset dir="installer/lib/wrapper/win64/" excludes="*.txt" />
1273        </copy>
1274    </target>
1275
1276    <target name="preppkg-windows-only" depends="preppkg-windows, jbigi-windows-only">
1277        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
1278     <!-- Win binaries are down-rev from the others, so use the old jar.
1279          This will not overwrite, so preppkg (for all OSes) will get the new jar with
1280          the old binaries, which will probably work but will output a warning.
1281          The windows-only installer will get the correct jar.
1282        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
1283      -->
1284        <copy overwrite="true" file="installer/lib/wrapper/win-all/wrapper.jar" todir="pkg-temp/lib" />
1285    </target>
1286
1287    <!-- see targets below for conditional copying -->
1288    <target name="preppkg-base" depends="build, preplicenses, prepConsoleDocs, prepthemeupdates, prepCertificates, prepRouterInfos, copyjetty, copytomcat-unlesspkg, copyjstl-unlesspkg, copystandard-unlesspkg, copyflags-unlesspkg, truncatehistory">
1289        <!-- if updater200 was run previously, it left *.pack files in pkg-temp -->
1290        <!-- Also remove deletelist.txt used for updater only -->
1291        <delete>
1292            <fileset dir="pkg-temp" includes="**/*.jar.pack **/*.war.pack deletelist.txt" />
1293        </delete>
1294        <copy file="build/i2p.jar" todir="pkg-temp/lib/" />
1295        <copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
1296        <copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
1297        <copy file="build/streaming.jar" todir="pkg-temp/lib/" />
1298        <copy file="build/router.jar" todir="pkg-temp/lib/" />
1299        <copy file="build/desktopgui.jar" todir="pkg-temp/lib/" />
1300        <copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
1301        <!-- Updated in 0.9.28; name without version so we can overwrite if we upgrade  -->
1302        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
1303        <copy file="build/sam.jar" todir="pkg-temp/lib/" />
1304        <copy file="build/BOB.jar" todir="pkg-temp/lib/" />
1305        <copy file="build/systray.jar" todir="pkg-temp/lib" />
1306        <copy file="build/i2psnark.jar" todir="pkg-temp/lib/" />
1307        <copy file="build/i2ptunnel.war" todir="pkg-temp/webapps/" />
1308        <copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
1309        <copy file="build/addressbook.jar" todir="pkg-temp/lib/" />
1310        <copy file="build/susimail.war" todir="pkg-temp/webapps/" />
1311        <copy file="build/susidns.war" todir="pkg-temp/webapps/" />
1312        <copy file="build/imagegen.war" todir="pkg-temp/webapps/" />
1313        <copy file="build/jsonrpc.war" todir="pkg-temp/webapps/" />
1314        <copy file="build/i2psnark.war" todir="pkg-temp/webapps/" />
1315        <copy file="apps/i2psnark/i2psnark.config" todir="pkg-temp/" />
1316        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
1317        <copy file="installer/resources/clients.config" todir="pkg-temp/" />
1318        <copy file="installer/resources/i2ptunnel.config" todir="pkg-temp/" />
1319        <copy file="installer/resources/wrapper.config" todir="pkg-temp/" />
1320        <copy file="installer/resources/hosts.txt" todir="pkg-temp/" />
1321        <copy file="INSTALL-headless.txt" todir="pkg-temp/" />
1322        <mkdir dir="pkg-temp/scripts" />
1323        <copy file="apps/proxyscript/i2pProxy.pac" todir="pkg-temp/scripts/" />
1324        <copy file="installer/resources/startconsole.html" todir="pkg-temp/docs/" />
1325        <copy file="installer/resources/start.ico" todir="pkg-temp/docs/" />
1326        <copy file="installer/resources/console.ico" todir="pkg-temp/docs/" />
1327        <copy file="installer/resources/uninstall.ico" todir="pkg-temp/docs/" />
1328        <!-- Eepsite stuff here -->
1329        <mkdir dir="pkg-temp/eepsite" />
1330        <copy todir="pkg-temp/eepsite/" >
1331            <fileset dir="installer/resources/eepsite/" excludes="**/.placeholder" />
1332        </copy>
1333        <copy file="installer/resources/themes/console/images/favicon.ico" tofile="pkg-temp/eepsite/docroot/favicon.ico" />
1334    </target>
1335
1336    <target name="copyflags-unlesspkg" unless="${with-famfamfam-flag-png}" >
1337        <copy todir="pkg-temp/eepsite/docroot/help/lib/" >
1338            <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" />
1339        </copy>
1340        <copy todir="pkg-temp/docs/icons/flags" >
1341          <!-- base flags/ dir only. flags16x11/ and flags48x48/ dirs already copied by prepConsoleDocs target -->
1342          <fileset dir="installer/resources/icons/flags" />
1343        </copy>
1344    </target>
1345
1346    <target name="copyjetty" depends="copyjetty-unlesspkg" >
1347        <copy file="build/jetty-i2p.jar" todir="pkg-temp/lib" />
1348    </target>
1349
1350    <target name="copyjetty-unlesspkg" unless="${with-libjetty9-java}" >
1351        <copy todir="pkg-temp/lib" >
1352            <fileset dir="build" includes="javax.servlet.jar jetty*.jar org.mortbay.*.jar" excludes="jetty-i2p.jar" />
1353        </copy>
1354    </target>
1355
1356    <target name="settomcatprop" >
1357        <condition property="with-libtomcat-java" >
1358            <or>
1359                <istrue value="${with-libtomcat6-java}" />
1360                <istrue value="${with-libtomcat7-java}" />
1361                <istrue value="${with-libtomcat8-java}" />
1362                <istrue value="${with-libtomcat9-java}" />
1363            </or>
1364        </condition>
1365    </target>
1366
1367    <target name="copytomcat-unlesspkg" depends="settomcatprop" unless="${with-libtomcat-java}" >
1368        <copy todir="pkg-temp/lib" >
1369            <fileset dir="build" includes="commons*.jar jasper*.jar javax*.jar" />
1370        </copy>
1371    </target>
1372
1373    <!--
1374       jstl.jar
1375       glassfish-javaee.jar has ancient and conflicting classes, e.g. javax.mail,
1376       and libjstl1.1-java isn't sufficient,
1377       so we only skip it with libtaglibs-standard
1378    -->
1379    <target name="copyjstl-unlesspkg" unless="${with-libtaglibs-standard}" >
1380        <copy file="apps/susidns/src/lib/jstl.jar" todir="pkg-temp/lib/" />
1381    </target>
1382
1383    <!-- standard.jar -->
1384    <target name="copystandard-unlesspkg" depends="copystandard-unlesspkg1, copystandard-unlesspkg2" />
1385    <target name="copystandard-unlesspkg1" >
1386        <condition property="with-any-standard-pkg" >
1387            <or>
1388                <istrue value="${with-libtaglibs-standard}" />
1389                <istrue value="${with-glassfish-javaee}" />
1390                <istrue value="${libjakarta-taglibs-standard-java}" />
1391            </or>
1392
1393        </condition>
1394    </target>
1395    <target name="copystandard-unlesspkg2" unless="${with-any-standard-pkg}" >
1396        <copy file="apps/susidns/src/lib/standard.jar" todir="pkg-temp/lib/" />
1397    </target>
1398
1399    <!-- does NOT include launch4j licenses for Windows builds -->
1400    <target name="preplicenses" depends="preplicenses-unlesspkg" >
1401        <copy file="LICENSE.txt" todir="pkg-temp/" />
1402        <copy todir="pkg-temp/licenses/" >
1403          <fileset dir="licenses/" />
1404        </copy>
1405        <copy file="apps/imagegen/identicon/README.md" tofile="pkg-temp/licenses/LICENSE-Identicon.txt" />
1406        <copy file="apps/desktopgui/LICENSE" tofile="pkg-temp/licenses/LICENSE-DesktopGUI.txt" />
1407    </target>
1408
1409    <target name="preplicenses-unlesspkg" depends="settomcatprop" unless="${with-libtomcat-java}" >
1410        <copy file="apps/jetty/apache-tomcat-${tomcat.ver}/NOTICE" tofile="pkg-temp/licenses/NOTICE-Tomcat.txt" />
1411    </target>
1412
1413    <!-- DOES include launch4j licenses for Windows builds -->
1414    <target name="preplicenses-windows" depends="preplicenses">
1415        <!--
1416              The license in launch4j/ is a BSD license for launch4j
1417              The license in launch4j/head is a MIT license for the code that is actually wrapped around the jars
1418              So we include the MIT one in our binary package
1419         -->
1420        <copy file="installer/lib/launch4j/head/LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-Launch4j.txt" />
1421        <!--  Not sure if these are used or should be included -->
1422        <copy file="installer/lib/launch4j/lib/foxtrot.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-Foxtrot.txt" />
1423        <copy file="installer/lib/launch4j/lib/JGoodies.Forms.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-JGoodies-Forms.txt" />
1424        <copy file="installer/lib/launch4j/lib/JGoodies.Looks.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-JGoodies-Looks.txt" />
1425        <copy file="installer/lib/launch4j/lib/XStream.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-XStream.txt" />
1426    </target>
1427
1428    <target name="prepthemeupdates">
1429        <copy todir="pkg-temp/docs/themes/" >
1430            <fileset dir="installer/resources/themes/" />
1431        </copy>
1432    </target>
1433
1434    <!-- SSL Certs -->
1435    <target name="prepCertificates" depends="buildCore">
1436        <copy todir="pkg-temp/certificates/" >
1437          <fileset dir="installer/resources/certificates/" />
1438        </copy>
1439        <java classname="net.i2p.crypto.CertUtil" fork="true" failonerror="true">
1440            <classpath>
1441                <pathelement location="build/i2p.jar" />
1442            </classpath>
1443            <arg value="checkall" />
1444            <arg value="pkg-temp/certificates" />
1445        </java>
1446    </target>
1447
1448    <condition property="no.bundle.routerInfos">
1449        <isfalse value="${bundle.routerInfos}" />
1450    </condition>
1451
1452    <target name="prepRouterInfos" depends="buildrouter, buildTools" unless="no.bundle.routerInfos">
1453        <delete dir="pkg-temp/netDb" />
1454        <mkdir dir="pkg-temp/netDb" />
1455        <java classname="net.i2p.router.networkdb.kademlia.BundleRouterInfos" fork="true" failonerror="true">
1456            <classpath>
1457                <pathelement location="build/i2p.jar" />
1458                <pathelement location="core/java/build/gnu-getopt.jar" />
1459                <pathelement location="build/router.jar" />
1460                <pathelement location="build/tools.jar" />
1461            </classpath>
1462            <arg value="-i" />
1463            <arg value="${bundle.routerInfos.i2pConfigDir}" />
1464            <arg value="-o" />
1465            <arg value="pkg-temp/netDb" />
1466            <arg value="-c" />
1467            <arg value="${bundle.routerInfos.count}" />
1468        </java>
1469    </target>
1470
1471    <target name="-areRouterInfosEnabled">
1472        <fail message="Option requires &quot;bundle.routerInfos&quot; to be configured. Please read &quot;build.properties&quot; for more info." >
1473            <condition>
1474                <isfalse value="${bundle.routerInfos}" />
1475            </condition>
1476        </fail>
1477    </target>
1478
1479    <target name="i2pseeds" depends="-setepoch, -areRouterInfosEnabled, prepRouterInfos">
1480        <delete file="i2pseeds.zip" />
1481        <delete file="i2pseeds.su3" />
1482        <zip destfile="i2pseeds.zip" basedir="pkg-temp/netDb" whenempty="fail" />
1483        <su3sign infile="i2pseeds.zip" sigtype="RESEED" outfile="i2pseeds.su3" su3.ver="${epoch}" />
1484    </target>
1485
1486    <!-- this is no longer required, izpack 4.3.0 supports headless installs with java -jar i2pinstall.exe -console -->
1487    <!-- and this is no longer used by the SlackBuild -->
1488    <target name="tarball" depends="preppkg">
1489        <tar compression="bzip2" destfile="i2p.tar.bz2">
1490            <tarfileset dir="pkg-temp" includes="**/*" prefix="i2p" />
1491        </tar>
1492    </target>
1493
1494    <target name="deletepkg-temp">
1495        <delete dir="pkg-temp" />
1496        <delete dir="./pkg-mavencentral" />
1497    </target>
1498
1499    <!-- readme and proxy error page files, initialNews.xml files, GeoIP files, and flag icons -->
1500    <target name="prepConsoleDocs" depends="prepConsoleDocUpdates, prepgeoupdate" >
1501        <copy todir="pkg-temp/docs/initialNews/">
1502          <fileset dir="installer/resources/initialNews/" />
1503        </copy>
1504        <!-- ensure the proxy files have the correct line endings -->
1505        <fixcrlf srcdir="pkg-temp/docs" includes="*.ht" encoding="utf8" eol="crlf" />
1506    </target>
1507
1508    <!-- readme and proxy error page files -->
1509    <target name="prepConsoleDocUpdates">
1510        <copy todir="pkg-temp/docs/" >
1511          <fileset dir="installer/resources/readme/" includes="readme*.html" />
1512          <fileset dir="installer/resources/proxy/" includes="*.ht" />
1513          <!--
1514               As of 0.9.36:
1515               All new and changed flags must go in the flags16x11/ dir,
1516               which will be checked first by flags.jsp.
1517               The flags/ dir is the original set from famfamfam,
1518               which may be symlinked in package installs.
1519           -->
1520          <fileset dir="installer/resources/" includes="icons/flags16x11/*" />
1521          <!-- flags48x48 added in 0.9.32 -->
1522          <fileset dir="installer/resources/" includes="icons/flags48x48/*" />
1523        </copy>
1524    </target>
1525
1526    <target name="consoleDocs" depends="deletepkg-temp, prepConsoleDocs">
1527        <zip destfile="docs.zip" basedir="pkg-temp" whenempty="fail" />
1528    </target>
1529
1530    <target name="copyJavadoc" depends="javadoc">
1531        <copy todir="pkg-temp/docs/javadoc" >
1532          <fileset dir="build/javadoc/" />
1533        </copy>
1534    </target>
1535
1536    <target name="updater200" depends="prepupdate, preplicenses, pack200, zipit200" />
1537    <target name="updater200WithJetty" depends="prepjupdate, preplicenses, pack200, zipit200" />
1538    <target name="updater200WithJettyAndJbigi" depends="prepjupdate, prepjbigiupdate, preplicenses, pack200, zipit200" />
1539    <target name="updater200WithJettyAndGeoIP" depends="prepjupdate, prepgeoupdate, preplicenses, pack200, zipit200" />
1540    <target name="updater200WithJettyFixes" depends="prepjupdatefixes, preplicenses, pack200, zipit200" />
1541    <target name="updater200WithJettyFixesAndJbigi" depends="prepjupdatefixes, prepjbigiupdate, preplicenses, pack200, zipit200" />
1542    <target name="updater200WithJbigi" depends="prepupdate, prepjbigiupdate, preplicenses, pack200, zipit200" />
1543    <target name="updater" depends="prepupdate, preplicenses, zipit" />
1544    <target name="updaterRepack" depends="prepupdate, preplicenses, repack200, zipit" />
1545    <target name="updaterWithJavadoc" depends="prepupdate, preplicenses, copyJavadoc, zipit" />
1546    <target name="updater200WithJavadoc" depends="prepupdate, preplicenses, copyJavadoc, pack200, zipit200" />
1547    <target name="updaterWithJavadocAndJetty" depends="prepjupdate, preplicenses, copyJavadoc, zipit" />
1548    <target name="updater200WithJavadocAndJetty" depends="prepjupdate, preplicenses, copyJavadoc, pack200, zipit200" />
1549    <target name="updaterWithGeoIP" depends="prepupdate, prepgeoupdate, preplicenses, zipit" />
1550    <target name="updaterWithJetty" depends="prepjupdate, preplicenses, zipit" />
1551    <target name="updaterWithJettyRepack" depends="prepjupdate, preplicenses, repack200, zipit" />
1552    <target name="updaterWithJettyAndJbigiRepack" depends="prepjupdate, prepjbigiupdate, preplicenses, repack200, zipit" />
1553    <target name="updaterWithJettyAndGeoIPRepack" depends="prepjupdate, prepgeoupdate, preplicenses, repack200, zipit" />
1554    <target name="updaterWithJettyFixes" depends="prepjupdatefixes, preplicenses, zipit" />
1555    <target name="updaterWithJettyFixesAndJbigi" depends="prepjupdatefixes, prepjbigiupdate, preplicenses, zipit" />
1556    <target name="updaterWithJettyFixesAndGeoIP" depends="prepjupdatefixes, prepgeoupdate, preplicenses, zipit" />
1557    <target name="updaterWithJbigi" depends="prepupdate, prepjbigiupdate, preplicenses, zipit" />
1558    <target name="updaterSmall" depends="prepupdateSmall, zipit" />
1559    <target name="updaterRouter" depends="prepupdateRouter, zipit" />
1560
1561    <target name="-sign-update" depends="buildrouter">
1562        <su3sign infile="i2pupdate200.zip" sigtype="ROUTER" outfile="i2pupdate.su3" su3.ver="${full.version}" />
1563    </target>
1564
1565    <target name="signed-updater200" depends="-pre-sign, updater200, -sign-update" />
1566    <target name="signed-updater200WithJetty" depends="-pre-sign, updater200WithJetty, -sign-update" />
1567    <target name="signed-updater200WithJettyAndGeoIP" depends="-pre-sign, updater200WithJettyAndGeoIP, -sign-update" />
1568    <target name="signed-updater200WithJavadoc" depends="-pre-sign, updater200WithJavadoc, -sign-update" />
1569    <target name="signed-updater200WithJavadocAndJetty" depends="-pre-sign, updater200WithJavadocAndJetty, -sign-update" />
1570
1571    <target name="zipit" depends="getReleaseNumber">
1572        <!--
1573             As of release 0.8.8, the router will enforce a zipfile comment equal to the
1574             version number in the sud/su2 header, since the version in the header is NOT
1575             covered by the signature.
1576         -->
1577        <zip destfile="i2pupdate.zip" basedir="pkg-temp" whenempty="fail" comment="${release.number}" />
1578       <!-- just a test, makes almost no difference
1579        <tar destfile="i2pupdate.tgz" basedir="pkg-temp" compression="gzip" />
1580        <tar destfile="i2pupdate.tbz" basedir="pkg-temp" compression="bzip2" />
1581       -->
1582    </target>
1583
1584    <target name="zipit200" depends="getReleaseNumber" >
1585        <zip destfile="i2pupdate200.zip" basedir="pkg-temp" whenempty="fail" comment="${release.number}" />
1586    </target>
1587
1588    <target name="pack200">
1589        <!-- pack200 will only pack to a .pack file, and only from a .jar file, so we put another .jar on the end -->
1590        <!-- can't pack an empty jar or one without classes, it will fail to unpack on Java 5;
1591          -  see http://bugs.sun.com/view_bug.do?bug_id=6712743
1592          -->
1593        <!-- *nix here -->
1594        <exec executable="sh" osfamily="unix" failonerror="true">
1595            <arg value="-c" />
1596            <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" />
1597        </exec>
1598        <exec executable="sh" osfamily="mac" failonerror="true">
1599            <arg value="-c" />
1600            <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" />
1601        </exec>
1602        <!-- windoz here : i admit, i hate escaped symbols in xml, indeed = =! -->
1603        <exec executable="cmd" osfamily="windows" failonerror="true">
1604            <arg value="/c" />
1605            <!-- TODO implement fix above -->
1606            <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" />
1607        </exec>
1608        <exec executable="cmd" osfamily="windows" failonerror="true">
1609                <arg value="/c" />
1610                <arg value="for %i in (pkg-temp\lib\*.jar) do pack200 -g %i.pack %i &amp;&amp; del %i" />
1611        </exec>
1612    </target>
1613
1614    <!-- saves about 1% on average (more on jars with multiple compiled po files since they have lots of common strings) -->
1615    <target name="repack200">
1616        <!-- pack200 will only repack a .jar file, so we put another .jar on the end -->
1617        <!-- *nix here -->
1618        <exec executable="sh" osfamily="unix" failonerror="true">
1619            <arg value="-c" />
1620            <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" />
1621        </exec>
1622        <exec executable="sh" osfamily="mac" failonerror="true">
1623            <arg value="-c" />
1624            <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" />
1625        </exec>
1626        <!-- windoz here : i admit, i hate escaped symbols in xml, indeed = =! -->
1627        <exec executable="cmd" osfamily="windows" failonerror="true">
1628            <arg value="/c" />
1629            <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" />
1630        </exec>
1631        <exec executable="cmd" osfamily="windows" failonerror="true">
1632                <arg value="/c" />
1633                <arg value="for %i in (pkg-temp\lib\*.jar) do pack200 -r %i" />
1634        </exec>
1635    </target>
1636
1637    <target name="prepupdate" depends="build2, prepupdateSmall, prepConsoleDocUpdates, prepCertificates, prep-script-translation, truncatehistory">
1638        <copy file="build/BOB.jar" todir="pkg-temp/lib/" />
1639        <copy file="build/sam.jar" todir="pkg-temp/lib/" />
1640        <copy file="build/i2psnark.jar" todir="pkg-temp/lib" />
1641        <!-- include systray changes in 0.7.5 -->
1642        <copy file="build/systray.jar" todir="pkg-temp/lib/" />
1643       <!-- removed from updater in 0.9, added back in 0.9.26 -->
1644        <copy file="build/desktopgui.jar" todir="pkg-temp/lib/" />
1645        <copy file="build/susimail.war" todir="pkg-temp/webapps/" />
1646        <copy file="build/susidns.war" todir="pkg-temp/webapps/" />
1647        <copy file="build/imagegen.war" todir="pkg-temp/webapps/" />
1648        <copy file="build/jsonrpc.war" todir="pkg-temp/webapps/" />
1649        <!-- as of 0.7.12; last changed in 0.9; removed from update in 0.9.26 -->
1650      <!--
1651        <copy file="apps/susidns/src/lib/jstl.jar" todir="pkg-temp/lib/" />
1652        <copy file="apps/susidns/src/lib/standard.jar" todir="pkg-temp/lib/" />
1653       -->
1654        <copy file="build/i2psnark.war" todir="pkg-temp/webapps/" />
1655        <copy file="installer/resources/deletelist.txt" todir="pkg-temp/" />
1656        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
1657        <copy todir="pkg-temp/man/">
1658            <fileset dir="installer/resources/man/" />
1659        </copy>
1660    </target>
1661
1662    <target name="truncatehistory">
1663        <copy file="history.txt" todir="pkg-temp/" />
1664        <!-- the following overwrites history.txt on unix to shrink the update file -->
1665        <copy file="history.txt" tofile="pkg-temp/history.txt" overwrite="true">
1666            <filterchain>
1667                <headfilter lines="1500" />
1668            </filterchain>
1669        </copy>
1670        <concat append="true" destfile="pkg-temp/history.txt">&#10;&#10;----------------&#10;&#10;EARLIER HISTORY IS AVAILABLE IN THE SOURCE PACKAGE</concat>
1671    </target>
1672
1673    <target name="prepupdateSmall" depends="buildSmall, prepupdateRouter, prepjupdatefixes, prepthemeupdates">
1674        <copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
1675        <copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
1676        <copy file="build/streaming.jar" todir="pkg-temp/lib/" />
1677        <copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
1678        <!-- Updated in 0.9.28 -->
1679        <!-- name without version so we can overwrite if we upgrade  -->
1680        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
1681        <copy file="build/i2ptunnel.war" todir="pkg-temp/webapps/" />
1682        <copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
1683        <copy file="build/addressbook.jar" todir="pkg-temp/lib/" />
1684        <copy file="build/addressbook.war" todir="pkg-temp/webapps/" />
1685        <!-- decapitalized the file in 0.7.8 -->
1686        <copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
1687        <copy file="installer/resources/continents.txt" todir="pkg-temp/geoip/" />
1688      <!--
1689        <copy file="installer/resources/public-suffix-list.txt" todir="pkg-temp/geoip/" />
1690       -->
1691    </target>
1692
1693    <target name="prepupdateRouter" depends="buildrouter, deletepkg-temp">
1694        <copy file="build/i2p.jar" todir="pkg-temp/lib/" />
1695        <copy file="build/router.jar" todir="pkg-temp/lib/" />
1696    </target>
1697
1698    <!-- jbigi.jar -->
1699    <target name="prepjbigiupdate" depends="jbigi">
1700        <copy file="build/jbigi.jar" todir="pkg-temp/lib/" />
1701    </target>
1702
1703    <!-- GeoIP files -->
1704    <target name="prepgeoupdate" depends="prepgeoupdate-unlesspkg" >
1705        <copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
1706        <copy file="installer/resources/continents.txt" todir="pkg-temp/geoip/" />
1707      <!--
1708        <copy file="installer/resources/public-suffix-list.txt" todir="pkg-temp/geoip/" />
1709       -->
1710    </target>
1711
1712    <!-- GeoIP files, set withGeoIPDatabase=true in override.properties to prevent -->
1713    <!-- As of 0.9.26, the files are not included in Debian/Ubuntu builds. -->
1714    <target name="prepgeoupdate-unlesspkg" unless="${with-geoip-database}" >
1715        <mkdir dir="pkg-temp/geoip" />
1716      <!--
1717        <copy file="installer/resources/geoip.txt" todir="pkg-temp/geoip/" />
1718        <copy file="installer/resources/geoipv6.dat.gz" todir="pkg-temp/geoip/" />
1719       -->
1720        <gunzip src="installer/resources/GeoLite2-Country.mmdb.gz" dest="pkg-temp/geoip/GeoLite2-Country.mmdb" />
1721    </target>
1722
1723    <!-- All jetty jars required for update.
1724         TODO do we need to bother updating jasper?
1725      -->
1726    <target name="prepjupdate" depends="prepupdate, buildWEB">
1727        <copy todir="pkg-temp/lib" >
1728            <fileset dir="build" includes="commons*.jar jasper*.jar javax*.jar jetty*.jar jsp*.jar org.mortbay.*.jar" />
1729        </copy>
1730        <!--  We have to package the new eepsite files for MigrateJetty.java, but we
1731              can't overwrite an existing eepsite dir in a non-split configuration.
1732          -->
1733        <copy todir="pkg-temp/eepsite-jetty9" >
1734            <fileset dir="installer/resources/eepsite" includes="*.xml contexts/* etc/*" />
1735        </copy>
1736    </target>
1737
1738    <target name="delete-j6-update">
1739        <delete dir="pkg-temp/eepsite-jetty9" />
1740    </target>
1741
1742    <!-- Jetty 6 I2P logging addons, not really fixes -->
1743    <target name="prepjupdatefixes" depends="buildWEB">
1744        <copy file="build/jetty-i2p.jar" todir="pkg-temp/lib/" />
1745    </target>
1746
1747    <target name="util-list-changes" depends="checkForMtn" if="mtn.available" >
1748        <exec executable="mtn" outputproperty="workspace.changes.util" errorproperty="mtn.error.util" failifexecutionfails="false" >
1749            <arg value="list" />
1750            <arg value="changed" />
1751            <arg value="core/java/src/net/i2p/util" />
1752        </exec>
1753        <!-- \n in an attribute value generates an invalid manifest -->
1754        <exec executable="tr" inputstring="${workspace.changes.util}" outputproperty="workspace.changes.util.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
1755            <arg value="-s" />
1756            <arg value="[:space:]" />
1757            <arg value="," />
1758        </exec>
1759    </target>
1760
1761    <target name="izpack-patches" >
1762            <taskdef name="izpack"
1763                     classpath="${basedir}/installer/lib/izpack/patches.jar:${basedir}/installer/lib/izpack/standalone-compiler.jar"
1764                     classname="com.izforge.izpack.ant.IzPackTask" />
1765        <jar destfile="${basedir}/installer/lib/izpack/patches.jar"
1766             basedir="${basedir}/installer/lib/izpack/patches" />
1767    </target>
1768
1769    <target name="buildUtilityJar" depends="buildCore">
1770        <ant dir="installer/java" target="build" />
1771    </target>
1772
1773    <!-- IzPack 4 -->
1774    <target name="installer" depends="preppkg, buildProperties, util-list-changes, izpack-patches, buildUtilityJar" >
1775        <izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
1776        <ant target="installerexe" />
1777    </target>
1778
1779    <!-- IzPack 5 -->
1780    <target name="ensureIzpack5" >
1781        <!-- set if unset -->
1782        <property name="izpack5.home" value="${user.home}/IzPack" />
1783        <condition property="izpack5.available" >
1784            <available file="${izpack5.home}" type="dir" />
1785        </condition>
1786        <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" >
1787            <condition>
1788                <not>
1789                    <isset property="izpack5.available" />
1790                </not>
1791            </condition>
1792        </fail>
1793        <path id="izpack5.lib.path">
1794            <fileset dir="${izpack5.home}/lib" includes="*.jar"/>
1795        </path>
1796        <taskdef name="izpack5"
1797                 classpathref="izpack5.lib.path"
1798                 classname="com.izforge.izpack.ant.IzPackTask" />
1799    </target>
1800
1801    <target name="installer5" depends="ensureIzpack5, preppkg, buildProperties, util-list-changes, buildUtilityJar" >
1802        <izpack5 input="${basedir}/installer/install5.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
1803        <ant target="installer5exe" />
1804    </target>
1805
1806    <!-- This makes i2pinstall.exe from install.jar using the bundled launch4j.
1807         Warning: launch4j-created files CANNOT be Windows-signed.
1808         They will be corrupted.
1809      -->
1810    <target name="installerexe" depends="launch4j" unless="noExe">
1811        <echo message="See the file &quot;build.properties&quot; if this step fails." />
1812        <!-- now the installer exe -->
1813        <launch4j configFile="./installer/i2pinstaller.xml" />
1814        <!-- thazzit -->
1815    </target>
1816
1817    <!-- This makes i2pinstall.exe from install.jar using IzPack5's izpack2exe.py (not bundled)
1818         izpack2exe-created files CAN be Windows-signed.
1819      -->
1820    <target name="installer5exe" unless="noExe">
1821        <!-- You must have the optional IzPack utils installed for this -->
1822        <!-- izpack doesn't come with +x permission when installed -->
1823        <chmod type="file" file="${izpack5.home}/utils/wrappers/izpack2exe/7za" perm="+x" />
1824        <chmod type="file" file="${izpack5.home}/utils/wrappers/izpack2exe/izpack2exe.py" perm="+x" />
1825        <!--
1826             Note that we must specify the 7za path to use the one from IzPack, which is very old.
1827             Either 7zr (from Debian package p7zip) or 7za (from Debian package p7zip-full)
1828             will work, but ONLY if the 7za/7zr command line is changed in izpack2exe.py
1829             as follows, because their default is LZMA2, which dosn't work on Windows.
1830             So we don't want any Debian 7za picked up in the PATH.
1831             See /usr/share/doc/p7zip/DOC/MANUAL/cmdline/switches/method.htm
1832             old:
1833             p7zcmd = '"%s" a -mmt -t7z -mx=9 installer.7z "%s"' % (p7z, files)
1834             new:
1835             p7zcmd = '"%s" a -mmt -t7z -mx=9 -m0=LZMA installer.7z "%s"' % (p7z, files)
1836
1837             We also use IzPack's customized 7zS.sfx file, which uses a customized icon
1838             (but not our icon, sadly)
1839
1840             More info: https://izpack.atlassian.net/wiki/spaces/IZPACK/pages/491541/IzPack+Utilities
1841         -->
1842        <exec executable="${izpack5.home}/utils/wrappers/izpack2exe/izpack2exe.py" failonerror="true">
1843            <arg value="--file=${basedir}/install.jar" />
1844            <arg value="--with-7z=${izpack5.home}/utils/wrappers/izpack2exe/7za" />
1845            <arg value="--no-upx" />
1846            <arg value="--output=${basedir}/i2pinstall.exe" />
1847        </exec>
1848    </target>
1849
1850    <!-- Custom installers -->
1851    <!-- IzPack 4 -->
1852    <target name="installer-nowindows" depends="clean, preppkg-nowindows, izpack-patches" >
1853        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1854        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}.jar" installerType="standard" basedir="${basedir}" />
1855    </target>
1856
1857    <!-- IzPack 5 -->
1858    <target name="installer5-nowindows" depends="ensureIzpack5, clean, preppkg-nowindows" >
1859        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1860        <izpack5 input="${basedir}/installer/install5.xml" output="${basedir}/i2pinstall_${full.version}.jar" installerType="standard" basedir="${basedir}" />
1861    </target>
1862
1863
1864    <target name="installer-freebsd" depends="clean, preppkg-freebsd-only, izpack-patches" >
1865        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1866        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_freebsd-only.jar" installerType="standard" basedir="${basedir}" />
1867    </target>
1868
1869    <!-- IzPack 4 -->
1870    <target name="installer-linux" depends="clean, preppkg-linux-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}_linux-only.jar" installerType="standard" basedir="${basedir}" />
1873    </target>
1874
1875    <!-- IzPack 5 -->
1876    <target name="installer5-linux" depends="ensureIzpack5, clean, preppkg-linux-only" >
1877        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1878        <izpack5 input="${basedir}/installer/install5.xml" output="${basedir}/i2pinstall_${full.version}_linux-only.jar" installerType="standard" basedir="${basedir}" />
1879    </target>
1880
1881
1882    <target name="installer-osx" depends="clean, checkForIzpack2App, preppkg-osx-only, izpack-patches">
1883        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1884        <mkdir dir="pkg-temp/osx" />
1885        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_osx-only.jar" installerType="standard" basedir="${basedir}" />
1886        <ant target="installer2app" />
1887        <delete dir="pkg-temp/osx" />
1888    </target>
1889
1890    <target name="checkForIzpack2App">
1891        <!-- we'll set the izpack2app binary name if it's not been set elsewhere yet -->
1892        <property name="izpack2app.binary" value="${user.home}/IzPack/utils/wrappers/izpack2app/izpack2app.py" />
1893        <available property="izpack2app.available" file="${izpack2app.binary}" />
1894    </target>
1895
1896    <target name="installer2app" if="izpack2app.available">
1897        <mkdir dir="pkg-temp/osx" />
1898        <exec executable="python" failonerror="true">
1899            <arg value="${izpack2app.binary}" />
1900            <arg value="${basedir}/i2pinstall_${full.version}_osx-only.jar" />
1901            <arg value="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" />
1902        </exec>
1903
1904        <tar longfile="gnu" destfile="${basedir}/i2pinstall_${full.version}_osx.tar.bz2" compression="bzip2">
1905            <tarfileset dir="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" prefix="/i2p-${full.version}_osx-install.app" filemode="644">
1906                <include name="**/**" />
1907                <exclude name="Contents/MacOS/*" />
1908            </tarfileset>
1909            <tarfileset dir="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" prefix="/i2p-${full.version}_osx-install.app" filemode="755">
1910                <include name="Contents/MacOS/*" />
1911            </tarfileset>
1912        </tar>
1913    </target>
1914
1915    <!-- call between installer-xxx and installer-windows -->
1916    <target name="delete-nonwindows">
1917        <delete dir="pkg-temp/lib/wrapper/" />
1918        <delete dir="pkg-temp/locale/" />
1919        <delete dir="pkg-temp/man/" />
1920        <delete dir="pkg-temp/Start I2P Router.app/" />
1921        <delete dir="pkg-temp" includes="eepget i2prouter INSTALL-headless.txt osid postinstall.sh runplain.sh" />
1922    </target>
1923
1924    <!-- IzPack 4 -->
1925    <target name="installer-windows" depends="clean, preppkg-windows-only, util-list-changes, izpack-patches, buildUtilityJar" >
1926        <fixcrlf srcdir="pkg-temp" includes="*.config *.bat *.cmd **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="crlf"/>
1927        <izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
1928        <ant target="installerexe" />
1929        <delete file="${basedir}/install.jar" />
1930        <move file="${basedir}/i2pinstall.exe" tofile="${basedir}/i2pinstall_${full.version}_windows.exe" />
1931    </target>
1932
1933    <!-- IzPack 5 -->
1934    <target name="installer5-windows" depends="ensureIzpack5, clean, preppkg-windows-only, util-list-changes, buildUtilityJar" >
1935        <fixcrlf srcdir="pkg-temp" includes="*.config *.bat *.cmd **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="crlf"/>
1936        <izpack5 input="${basedir}/installer/install5.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
1937        <ant target="installer5exe" />
1938        <delete file="${basedir}/install.jar" />
1939        <move file="${basedir}/i2pinstall.exe" tofile="${basedir}/i2pinstall_${full.version}_windows.exe" />
1940    </target>
1941
1942    <!-- this is broken as installer-xxx targets may delete (or not delete) things in pkg-temp -->
1943    <target name="installer-all" depends="installer-freebsd, installer-linux, installer-osx, installer-windows, installer-nowindows, installer" >
1944    </target>
1945    <!-- end custom installers -->
1946
1947    <!-- unit tests -->
1948    <target name="buildCoreTest">
1949        <ant dir="core/java/" target="jarTest" />
1950    </target>
1951    <target name="buildRouterTest" depends="buildCoreTest">
1952        <ant dir="router/java/" target="jarTest" />
1953    </target>
1954    <target name="buildTest" depends="buildRouterTest">
1955        <copy file="core/java/build/i2ptest.jar" todir="build" />
1956        <copy file="router/java/build/routertest.jar" todir="build" />
1957        <!-- broken -->
1958      <!--
1959        <ant dir="apps/ministreaming/java/" target="junit.compileTest" />
1960        <ant dir="apps/streaming/java/" target="junit.compileTest" />
1961       -->
1962    </target>
1963    <target name="prepTest" depends="prepupdate, buildTest">
1964        <!-- overwrite i2p.jar and router.jar with the test versions -->
1965        <copy file="build/i2ptest.jar" tofile="pkg-temp/lib/i2p.jar" overwrite="true" />
1966        <copy file="build/routertest.jar" tofile="pkg-temp/lib/router.jar" overwrite="true" />
1967    </target>
1968    <target name="updateTest" depends="prepTest, zipit" />
1969    <target name="junit.test" depends="buildProperties, jbigi" >
1970        <ant dir="core/java/" target="junit.test" />
1971        <ant dir="router/java/" target="junit.test" />
1972        <ant dir="apps/ministreaming/java/" target="junit.test" />
1973        <ant dir="apps/streaming/java/" target="junit.test" />
1974    </target>
1975    <target name="scalatest.test" depends="buildProperties, jbigi" >
1976        <ant dir="core/java/" target="scalatest.test" />
1977        <!-- note there are no router scala tests yet -->
1978        <ant dir="router/java/" target="scalatest.test" />
1979    </target>
1980    <!-- both junit and scala -->
1981    <target name="test" depends="testCore, testRouter, testMinistreaming, testStreaming" />
1982    <target name="testCore" depends="buildProperties, jbigi" >
1983        <ant dir="core/java/" target="test" />
1984    </target>
1985    <target name="testRouter" depends="buildProperties, jbigi" >
1986        <ant dir="router/java/" target="test" />
1987    </target>
1988    <target name="testMinistreaming" depends="buildProperties, jbigi" >
1989        <ant dir="apps/ministreaming/java/" target="test" />
1990    </target>
1991    <target name="testStreaming" depends="buildProperties" >
1992        <ant dir="apps/streaming/java/" target="test" />
1993    </target>
1994    <target name="scalatest.report" depends="buildProperties" >
1995        <ant dir="core/java/" target="scalatest.report" />
1996        <ant dir="router/java/" target="scalatest.report" />
1997    </target>
1998    <target name="junit.report" depends="buildProperties" >
1999        <ant dir="core/java/" target="junit.report" />
2000        <ant dir="router/java/" target="junit.report" />
2001        <ant dir="apps/ministreaming/java/" target="junit.report" />
2002        <ant dir="apps/streaming/java/" target="junit.report" />
2003    </target>
2004    <target name="clover.report" depends="buildProperties" if="with.clover">
2005        <ant dir="core/java/" target="clover.report" />
2006        <ant dir="router/java/" target="clover.report" />
2007        <ant dir="apps/ministreaming/java" target="clover.report" />
2008        <ant dir="apps/streaming/java" target="clover.report" />
2009    </target>
2010    <target name="cobertura.report" depends="buildProperties" if="with.cobertura">
2011        <ant dir="core/java/" target="cobertura.report" />
2012        <ant dir="router/java/" target="cobertura.report" />
2013        <ant dir="apps/ministreaming/java" target="cobertura.report" />
2014        <ant dir="apps/streaming/java" target="cobertura.report" />
2015    </target>
2016    <target name="test.report" depends="junit.report, scalatest.report, clover.report, cobertura.report"/>
2017    <target name="fulltest" depends="buildProperties, jbigi" >
2018        <ant dir="core/java/" target="fulltest" />
2019        <ant dir="router/java/" target="fulltest" />
2020        <ant dir="apps/ministreaming/java" target="fulltest" />
2021        <ant dir="apps/streaming/java" target="fulltest" />
2022    </target>
2023    <target name="jenkins.cobertura.report" depends="cobertura.report">
2024        <!--
2025             The jenkins cobertura plugin couldn't find the source files.
2026         -->
2027        <replaceregexp byline="true" file="reports/core/cobertura/coverage.xml"
2028            match='filename="net' replace='filename="core/java/src/net'/>
2029        <replaceregexp byline="true" file="reports/core/cobertura/coverage.xml"
2030            match="&lt;source&gt;./src" replace='&lt;source&gt;./core/java/src'/>
2031
2032        <replaceregexp byline="true" file="reports/router/cobertura/coverage.xml"
2033            match='filename="net' replace='filename="router/java/src/net'/>
2034        <replaceregexp byline="true" file="reports/router/cobertura/coverage.xml"
2035            match="&lt;source&gt;./src" replace="&lt;source&gt;router/java/src"/>
2036
2037        <replaceregexp byline="true" file="reports/ministreaming/cobertura/coverage.xml"
2038            match='filename="net' replace='filename="apps/ministreaming/java/src/net'/>
2039        <replaceregexp byline="true" file="reports/ministreaming/cobertura/coverage.xml"
2040            match="&lt;source&gt;./src" replace="&lt;source&gt;apps/ministreaming/java/src"/>
2041
2042        <replaceregexp byline="true" file="reports/streaming/cobertura/coverage.xml"
2043            match='filename="net' replace='filename="apps/streaming/java/src/net'/>
2044        <replaceregexp byline="true" file="reports/streaming/cobertura/coverage.xml"
2045            match="&lt;source&gt;./src" replace="&lt;source&gt;apps/streaming/java/src"/>
2046    </target>
2047    <!-- end unit tests -->
2048
2049    <target name="testscripts" >
2050        <exec executable="tests/scripts/checkcerts.sh" failonerror="true" />
2051        <exec executable="tests/scripts/checkpo.sh" failonerror="true" />
2052        <exec executable="tests/scripts/checkutf8.sh" failonerror="true" />
2053        <exec executable="tests/scripts/checkxml.sh" failonerror="true" />
2054        <exec executable="tests/scripts/checkscripts.sh" failonerror="true" />
2055    </target>
2056
2057
2058    <target name="testscripts-net" >
2059        <exec executable="tests/scripts/checkremotecerts.sh" failonerror="true" />
2060    </target>
2061
2062    <target name="testscripts-all" depends="testscripts,testscripts-net" />
2063
2064    <target name="bench" depends="jbigi" >
2065        <ant dir="core/java/" target="bench.jar" />
2066    </target>
2067
2068    <!-- <target name="syndie" >
2069        <ant dir="apps/syndie/java/" target="standalone" />
2070        <copy file="apps/syndie/java/syndie-standalone.zip" todir="." />
2071    </target> -->
2072
2073    <!-- standalone i2psnark zip -->
2074    <target name="i2psnark" depends="buildStreaming, buildJetty, buildSystray" >
2075        <ant dir="apps/i2psnark/java" target="standalone" />
2076        <copy file="apps/i2psnark/java/i2psnark-standalone.zip" todir="." />
2077    </target>
2078
2079    <target name="slackpkg">
2080        <ant dir="Slackware/i2p/" target="slackpkg" />
2081    </target>
2082    <target name="justBOB" depends="builddepSmall, jbigi">
2083        <ant dir="apps/BOB/" target="onejar" />
2084        <copy file="apps/BOB/dist/BOB-one.jar" todir="." />
2085    </target>
2086
2087    <target name="sloccount.report">
2088        <property name="sloccount.report.file" value="sloccount.sc" />
2089        <echo message="Generating sloccount report (this will take awhile)" />
2090        <exec executable="sloccount" failonerror="true">
2091            <arg value="--details"/>
2092            <arg value="--wide"/>
2093            <arg value="${basedir}"/>
2094            <redirector output="${sloccount.report.file}">
2095                <outputfilterchain>
2096                    <linecontainsregexp negate="true">
2097                        <regexp pattern="(Warning: |lib/launch4j|_MTN|reports|pkg-temp|licenses|i2p\.fba|gmp-|WEB-INF)" />
2098                    </linecontainsregexp>
2099                    <linecontains negate="true">
2100                        <contains value="${sloccount.report.file}" />
2101                    </linecontains>
2102                </outputfilterchain>
2103            </redirector>
2104        </exec>
2105        <echo message="sloccount report saved to the file &quot;${sloccount.report.file}&quot;" />
2106    </target>
2107
2108    <target name="findbugs" depends="build2, buildUtilityJar">
2109        <echo message="Starting findbugs, this will take a while..." />
2110        <!-- ref: https://github.com/spotbugs/spotbugs/issues/148 -->
2111        <echo message="If this doesn't work with Java 9+. try Java 8" />
2112        <exec executable="nice" failonerror="true">
2113            <arg value="findbugs"/>
2114            <arg value="-textui"/>
2115            <arg value="-projectName"/>
2116            <arg value="i2p"/>
2117            <arg value="-sortByClass"/>
2118            <arg value="-xml"/>
2119            <arg value="-output"/>
2120            <arg value="i2p.fba"/>
2121            <arg value="-auxclasspath"/>
2122            <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"/>
2123            <arg value="-sourcepath"/>
2124            <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"/>
2125            <!-- start of the files to be analyzed -->
2126            <arg value="build/BOB.jar"/>
2127            <arg value="build/addressbook.jar"/>
2128            <arg value="build/i2p.jar"/>
2129            <arg value="build/i2psnark.jar"/>
2130            <arg value="build/i2psnark.war"/>
2131            <arg value="build/i2ptunnel.jar"/>
2132            <arg value="build/i2ptunnel.war"/>
2133            <arg value="build/imagegen.war"/>
2134            <arg value="build/jetty-i2p.jar"/>
2135            <arg value="build/jsonrpc.war"/>
2136            <arg value="build/mstreaming.jar"/>
2137            <arg value="build/router.jar/"/>
2138            <arg value="build/desktopgui.jar"/>
2139            <arg value="build/routerconsole.jar"/>
2140            <arg value="build/routerconsole.war"/>
2141            <arg value="build/sam.jar"/>
2142            <arg value="build/streaming.jar"/>
2143            <arg value="build/susidns.war"/>
2144            <arg value="build/susimail.war"/>
2145            <arg value="build/systray.jar"/>
2146            <arg value="build/utility.jar"/>
2147        </exec>
2148        <echo message="Findbugs output stored in i2p.fba" />
2149        <echo message="Now run: findbugs i2p.fba" />
2150    </target>
2151
2152    <!-- this is the same dependency as pkg, but with updater200 in the middle,
2153         since preppkg puts too much stuff in pkg-temp -->
2154<!--
2155    <target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyAndJbigiRepack, updater200WithJettyAndJbigi, delete-j6-update, installer-nowindows, delete-nonwindows, installer5-windows">
2156    <target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyRepack, updater200WithJetty, delete-j6-update, installer-nowindows, delete-nonwindows, installer5-windows">
2157-->
2158    <target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyAndGeoIPRepack, updater200WithJettyAndGeoIP, delete-j6-update, installer-nowindows, delete-nonwindows, installer5-windows">
2159        <echo message="New version number is ${release.number}" />
2160        <copy file="i2pupdate.zip" tofile="i2pupdate_${release.number}.zip" />
2161        <copy file="i2pinstall_${full.version}.jar" tofile="i2pinstall_${release.number}.jar" />
2162        <copy file="i2pinstall_${full.version}_windows.exe" tofile="i2pinstall_${release.number}_windows.exe" />
2163        <!-- remove these, we don't build them anymore -->
2164        <delete file="i2pupdate.sud" />
2165        <delete file="i2pupdate.su2" />
2166        <!-- make this a lot easier by putting release.privkey.su3=/path/to/su3keystore.ks in override.properties -->
2167
2168        <!-- now build and verify the packed su3 from the packed zip -->
2169        <su3sign infile="i2pupdate200.zip" sigtype="ROUTER" outfile="i2pupdate.su3" su3.ver="${release.number}" />
2170        <!-- this will use the monotonerc file in the current workspace -->
2171        <echo message="Checking out fresh copy into ../i2p-${release.number} for tarballing:" />
2172        <delete dir="../i2p-${release.number}" />
2173        <exec executable="mtn" failonerror="true">
2174            <arg value="co" />
2175            <!-- w: is the revision of the current workspace -->
2176            <arg value="-r" />
2177            <arg value="w:" />
2178            <arg value="../i2p-${release.number}/" />
2179        </exec>
2180        <exec executable="tar" failonerror="true">
2181            <arg value="cjf" />
2182            <arg value="i2psource_${release.number}.tar.bz2" />
2183            <arg value="-C" />
2184            <arg value=".." />
2185            <arg value="--exclude" />
2186            <arg value="i2p-${release.number}/_MTN*" />
2187            <arg value="i2p-${release.number}/" />
2188        </exec>
2189        <echo message="Sign the files:" />
2190        <input message="Enter GPG key ID (e.g. 0x12345678) for signing:" addproperty="release.gpg.keyid" />
2191        <fail message="You must enter a key ID." >
2192            <condition>
2193                <equals arg1="${release.gpg.keyid}" arg2=""/>
2194            </condition>
2195        </fail>
2196
2197        <!-- the gpgsign macro sets the permission of signed files and the sigs themselves to 444 -->
2198      <!--
2199        <gpgsign file="i2pinstall_${release.number}_windows.exe" />
2200       -->
2201        <gpgsign file="i2pinstall_${release.number}.jar" />
2202        <gpgsign file="i2psource_${release.number}.tar.bz2" />
2203        <gpgsign file="i2pupdate_${release.number}.zip" />
2204
2205        <chmod perm="444" type="file">
2206            <fileset dir="${basedir}">
2207                <include name="i2pupdate.su3" />
2208            </fileset>
2209        </chmod>
2210        <echo message="File sizes:" />
2211        <exec executable="ls" failonerror="true">
2212            <arg value="-l" />
2213          <!--
2214            <arg value="i2pinstall_${release.number}_windows.exe" />
2215           -->
2216            <arg value="i2pinstall_${release.number}.jar" />
2217            <arg value="i2psource_${release.number}.tar.bz2" />
2218            <arg value="i2pupdate_${release.number}.zip" />
2219            <arg value="i2pupdate.su3" />
2220          <!--
2221            <arg value="i2pinstall_${release.number}_windows.exe.sig" />
2222           -->
2223            <arg value="i2pinstall_${release.number}.jar.sig" />
2224            <arg value="i2psource_${release.number}.tar.bz2.sig" />
2225            <arg value="i2pupdate_${release.number}.zip.sig" />
2226        </exec>
2227        <echo message="   TBD    i2pinstall_${release.number}_windows.exe" />
2228        <echo message="   TBD    i2pinstall_${release.number}_windows.exe.sig" />
2229        <echo message="SHA256 sums:" />
2230      <!--
2231        <sha256sum file="i2pinstall_${release.number}_windows.exe" />
2232       -->
2233        <echo message="   TBD    i2pinstall_${release.number}_windows.exe" />
2234        <sha256sum file="i2pinstall_${release.number}.jar" />
2235        <sha256sum file="i2psource_${release.number}.tar.bz2" />
2236        <sha256sum file="i2pupdate_${release.number}.zip" />
2237        <sha256sum file="i2pupdate.su3" />
2238        <!-- make torrent files -->
2239        <copy file="i2pupdate.su3" tofile="i2pupdate-${release.number}.su3" />
2240        <mktorrent file="i2pupdate-${release.number}.su3" />
2241        <echo message="Don't forget to sign i2pinstall_${release.number}_windows.exe on Windows and then:" />
2242        <echo message="    ${gpg} -u ${release.gpg.keyid} -b i2pinstall_${release.number}_windows.exe" />
2243        <echo message="    sha256sum i2pinstall_${release.number}_windows.exe" />
2244        <echo message="Don't forget to mtn tag w: i2p-${release.number}" />
2245        <echo message="... and mtn cert t:i2p-${release.number} branch i2p.i2p.release" />
2246    </target>
2247
2248    <!-- depends on buildCoreTest so that the router unit test javadocs can find the core unit test classes -->
2249    <target name="mavenCentral.deps" depends="buildRouter, buildStreaming, buildCoreTest">
2250        <ant dir="core/java/">
2251            <target name="javadocJar" />
2252            <target name="sourcesJar" />
2253        </ant>
2254        <ant dir="router/java/">
2255            <target name="javadocJar" />
2256            <target name="sourcesJar" />
2257        </ant>
2258        <ant dir="apps/ministreaming/java/">
2259            <target name="javadocJar" />
2260            <target name="sourcesJar" />
2261        </ant>
2262        <ant dir="apps/streaming/java/">
2263            <target name="javadocJar" />
2264            <target name="sourcesJar" />
2265        </ant>
2266        <ant dir="apps/jetty/">
2267            <target name="servletJar" />
2268            <target name="servletJavadocJar" />
2269            <target name="servletSourcesJar" />
2270        </ant>
2271    </target>
2272
2273    <target name="mavenCentral" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, mavenCentral.deps">
2274        <mkdir dir="./pkg-mavencentral" />
2275        <!-- Libraries -->
2276        <copy file="build/i2p.jar" tofile="pkg-mavencentral/i2p-${release.number}.jar" />
2277        <copy file="build/router.jar" tofile="pkg-mavencentral/router-${release.number}.jar" />
2278        <copy file="build/mstreaming.jar" tofile="pkg-mavencentral/mstreaming-${release.number}.jar" />
2279        <copy file="build/streaming.jar" tofile="pkg-mavencentral/streaming-${release.number}.jar" />
2280        <copy file="apps/jetty/build/servlet-i2p-${release.number}.jar" todir="pkg-mavencentral/" />
2281        <!-- JavaDocs -->
2282        <copy file="core/java/build/i2p-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
2283        <copy file="router/java/build/router-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
2284        <copy file="apps/ministreaming/java/build/mstreaming-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
2285        <copy file="apps/streaming/java/build/streaming-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
2286        <copy file="apps/jetty/build/servlet-i2p-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
2287        <!-- Sources -->
2288        <copy file="core/java/build/i2p-${release.number}-sources.jar" todir="pkg-mavencentral/" />
2289        <copy file="router/java/build/router-${release.number}-sources.jar" todir="pkg-mavencentral/" />
2290        <copy file="apps/ministreaming/java/build/mstreaming-${release.number}-sources.jar" todir="pkg-mavencentral/" />
2291        <copy file="apps/streaming/java/build/streaming-${release.number}-sources.jar" todir="pkg-mavencentral/" />
2292        <copy file="apps/jetty/build/servlet-i2p-${release.number}-sources.jar" todir="pkg-mavencentral/" />
2293        <echo message="This requires the Maven Ant Tasks to be installed." />
2294        <echo message="If this fails, on Debian jessie or, Ubuntu trusty/xenial:" />
2295        <echo message="sudo apt-get install libmaven-ant-tasks-java" />
2296        <echo message="Sorry, not available on more recent distributions" />
2297        <!-- POMs -->
2298        <artifact:pom id="i2ppom" groupId="net.i2p" artifactId="i2p" version="${release.number}"
2299                name="I2P Core"
2300                description="The core I2P APIs"
2301                url="https://geti2p.net/">
2302            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
2303            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
2304            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/"/>
2305            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
2306                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
2307                 url="git@github.com:i2p/i2p.i2p.git" />
2308        </artifact:pom>
2309        <artifact:pom id="routerpom" groupId="net.i2p" artifactId="router" version="${release.number}"
2310                name="I2P Router"
2311                description="The I2P router"
2312                url="https://geti2p.net/">
2313            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
2314            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
2315            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/"/>
2316            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
2317                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
2318                 url="git@github.com:i2p/i2p.i2p.git" />
2319            <dependency groupId="net.i2p" artifactId="i2p" version="${release.number}" />
2320        </artifact:pom>
2321        <artifact:pom id="mstreamingpom" groupId="net.i2p.client" artifactId="mstreaming" version="${release.number}"
2322                name="I2P Ministreaming"
2323                description="API, interfaces, and factory for a TCP-like set of sockets for communicating over I2P."
2324                url="https://geti2p.net/en/docs/api/streaming">
2325            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
2326            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
2327            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/" />
2328            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
2329                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
2330                 url="git@github.com:i2p/i2p.i2p.git" />
2331            <dependency groupId="net.i2p" artifactId="i2p" version="${release.number}" />
2332        </artifact:pom>
2333        <artifact:pom id="streamingpom" groupId="net.i2p.client" artifactId="streaming" version="${release.number}"
2334                name="I2P Streaming"
2335                description="Implementation of a TCP-like set of sockets for communicating over I2P."
2336                url="https://geti2p.net/en/docs/api/streaming">
2337            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
2338            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
2339            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/" />
2340            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
2341                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
2342                 url="git@github.com:i2p/i2p.i2p.git" />
2343            <dependency groupId="net.i2p" artifactId="i2p" version="${release.number}" />
2344            <dependency groupId="net.i2p.client" artifactId="mstreaming" version="${release.number}" />
2345        </artifact:pom>
2346        <artifact:pom id="servletpom" groupId="net.i2p" artifactId="servlet-i2p" version="${release.number}"
2347                name="I2P Servlet classes"
2348                description="Various servlet classes provided to plugins by Java I2P."
2349                url="https://geti2p.net/">
2350            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
2351            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
2352            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/" />
2353            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
2354                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
2355                 url="git@github.com:i2p/i2p.i2p.git" />
2356            <dependency groupId="net.i2p" artifactId="i2p" version="${release.number}" />
2357            <dependency groupId="org.apache.tomcat" artifactId="tomcat-servlet-api" version="8.0.33" />
2358        </artifact:pom>
2359        <artifact:writepom pomRefId="i2ppom" file="pkg-mavencentral/i2p-${release.number}.pom"/>
2360        <artifact:writepom pomRefId="routerpom" file="pkg-mavencentral/router-${release.number}.pom"/>
2361        <artifact:writepom pomRefId="mstreamingpom" file="pkg-mavencentral/mstreaming-${release.number}.pom" />
2362        <artifact:writepom pomRefId="streamingpom" file="pkg-mavencentral/streaming-${release.number}.pom" />
2363        <artifact:writepom pomRefId="servletpom" file="pkg-mavencentral/servlet-i2p-${release.number}.pom" />
2364        <!-- Signatures -->
2365        <echo message="Sign the files:" />
2366        <input message="Enter GPG key ID (e.g. 0x12345678) for signing:" addproperty="release.gpg.keyid" />
2367        <fail message="You must enter a key ID." >
2368            <condition>
2369                <equals arg1="${release.gpg.keyid}" arg2=""/>
2370            </condition>
2371        </fail>
2372        <!-- the gpgsign macro sets the permission of signed files and the sigs themselves to 444 -->
2373        <gpgsignasc file="pkg-mavencentral/i2p-${release.number}.jar" />
2374        <gpgsignasc file="pkg-mavencentral/i2p-${release.number}.pom" />
2375        <gpgsignasc file="pkg-mavencentral/i2p-${release.number}-javadoc.jar" />
2376        <gpgsignasc file="pkg-mavencentral/i2p-${release.number}-sources.jar" />
2377        <gpgsignasc file="pkg-mavencentral/router-${release.number}.jar" />
2378        <gpgsignasc file="pkg-mavencentral/router-${release.number}.pom" />
2379        <gpgsignasc file="pkg-mavencentral/router-${release.number}-javadoc.jar" />
2380        <gpgsignasc file="pkg-mavencentral/router-${release.number}-sources.jar" />
2381        <gpgsignasc file="pkg-mavencentral/mstreaming-${release.number}.jar" />
2382        <gpgsignasc file="pkg-mavencentral/mstreaming-${release.number}.pom" />
2383        <gpgsignasc file="pkg-mavencentral/mstreaming-${release.number}-javadoc.jar" />
2384        <gpgsignasc file="pkg-mavencentral/mstreaming-${release.number}-sources.jar" />
2385        <gpgsignasc file="pkg-mavencentral/streaming-${release.number}.jar" />
2386        <gpgsignasc file="pkg-mavencentral/streaming-${release.number}.pom" />
2387        <gpgsignasc file="pkg-mavencentral/streaming-${release.number}-javadoc.jar" />
2388        <gpgsignasc file="pkg-mavencentral/streaming-${release.number}-sources.jar" />
2389        <gpgsignasc file="pkg-mavencentral/servlet-i2p-${release.number}.jar" />
2390        <gpgsignasc file="pkg-mavencentral/servlet-i2p-${release.number}.pom" />
2391        <gpgsignasc file="pkg-mavencentral/servlet-i2p-${release.number}-javadoc.jar" />
2392        <gpgsignasc file="pkg-mavencentral/servlet-i2p-${release.number}-sources.jar" />
2393        <!-- Bundle -->
2394        <jar destfile="mavencentral-i2p.jar">
2395            <fileset dir="./pkg-mavencentral">
2396                <include name="i2p-*" />
2397            </fileset>
2398        </jar>
2399        <jar destfile="mavencentral-router.jar">
2400            <fileset dir="./pkg-mavencentral">
2401                <include name="router-*" />
2402            </fileset>
2403        </jar>
2404        <jar destfile="mavencentral-mstreaming.jar">
2405            <fileset dir="./pkg-mavencentral">
2406                <include name="mstreaming-*" />
2407            </fileset>
2408        </jar>
2409        <jar destfile="mavencentral-streaming.jar">
2410            <fileset dir="./pkg-mavencentral">
2411                <include name="streaming-*" />
2412            </fileset>
2413        </jar>
2414        <jar destfile="mavencentral-servlet-i2p.jar">
2415            <fileset dir="./pkg-mavencentral">
2416                <include name="servlet-i2p-*" />
2417            </fileset>
2418        </jar>
2419        <echo message="Now upload mavencentral-*.jar to Maven Central." />
2420    </target>
2421
2422    <target name="debian" depends="debian-clean, debchange, debian-binary" />
2423    <target name="precise" depends="copy-precise, debian" />
2424    <target name="wheezy" depends="precise" />
2425    <target name="trusty" depends="copy-trusty, debian" />
2426    <target name="jessie" depends="trusty" />
2427    <target name="xenial" depends="copy-xenial, debian" />
2428    <target name="bionic" depends="copy-bionic, debian" />
2429    <target name="disco" depends="copy-disco, debian" />
2430    <target name="buster" depends="disco" />
2431
2432    <target name="copy-precise">
2433        <copy todir="debian" overwrite="true">
2434            <fileset dir="debian-alt/precise/" />
2435        </copy>
2436    </target>
2437    <target name="copy-trusty">
2438        <copy todir="debian" overwrite="true">
2439            <fileset dir="debian-alt/trusty/" />
2440        </copy>
2441    </target>
2442    <target name="copy-xenial">
2443        <copy todir="debian" overwrite="true">
2444            <fileset dir="debian-alt/xenial/" />
2445        </copy>
2446    </target>
2447    <target name="copy-bionic">
2448        <copy todir="debian" overwrite="true">
2449            <fileset dir="debian-alt/bionic/" />
2450        </copy>
2451    </target>
2452    <target name="copy-disco">
2453        <copy todir="debian" overwrite="true">
2454            <fileset dir="debian-alt/disco/" />
2455        </copy>
2456    </target>
2457
2458    <target name="getExtendedVersion" depends="buildProperties, trimMtnRev">
2459        <property name="MtnShortHash" value="unknown" />
2460        <condition property="Extended.Version" value="${full.version}-${MtnShortHash}">
2461            <not>
2462                <or>
2463                    <equals arg1="${MtnShortHash}" arg2="" />
2464                    <equals arg1="${MtnShortHash}" arg2="unknown" />
2465                </or>
2466            </not>
2467        </condition>
2468        <!-- if not set above we'll set it here -->
2469        <property name="Extended.Version" value="${full.version}" />
2470    </target>
2471
2472    <target name="debchange" depends="getExtendedVersion" unless="noAutoDebchange">
2473        <echo message= "Debian version is ${Extended.Version}-1" />
2474        <exec executable="dch" failonerror="true">
2475            <arg value="-b" />
2476            <arg value="--check-dirname-level" />
2477            <arg value="0" />
2478            <arg value="-v" />
2479            <arg value="${Extended.Version}-1" />
2480            <arg value="Unofficial Debian package built using &quot;ant debian&quot;" />
2481        </exec>
2482    </target>
2483
2484    <target name="debian-binary" depends="getExtendedVersion">
2485        <exec executable="fakeroot" failonerror="true">
2486            <arg value="debian/rules" />
2487            <arg value="patch" />
2488            <arg value="binary" />
2489            <arg value="clean" />
2490        </exec>
2491        <delete dir=".pc" />
2492        <move todir=".">
2493            <fileset dir=".." includes="libjbigi*${release.number}*.deb i2p*${release.number}*.deb" />
2494        </move>
2495        <echo message="" />
2496        <echo message="====================" />
2497        <echo message="Packages have been built and moved to ${basedir}" />
2498        <echo message="====================" />
2499    </target>
2500
2501    <target name="debian-clean" depends="getExtendedVersion" >
2502        <exec executable="fakeroot" failonerror="true">
2503            <arg value="debian/rules" />
2504            <arg value="clean" />
2505        </exec>
2506        <delete dir="./.pc" />
2507    </target>
2508
2509    <!-- stretch+, zesty+ -->
2510    <target name="debian-tarball" depends="getExtendedVersion, failIfNoMtn">
2511        <!-- this will use the monotonerc file in the current workspace -->
2512        <property name="debian.tarball.name" value="i2p_${Extended.Version}.orig.tar.bz2" />
2513        <echo message="Checking out fresh copy into ../i2p-${Extended.Version} for tarballing:" />
2514        <delete dir="../i2p-${Extended.Version}" />
2515        <exec executable="mtn" failonerror="true">
2516            <arg value="co" />
2517            <!-- w: is the revision of the current workspace -->
2518            <arg value="-r" />
2519            <arg value="w:" />
2520            <arg value="../i2p-${Extended.Version}" />
2521        </exec>
2522        <delete includeemptydirs="true" quiet="false" failonerror="false">
2523            <fileset dir="../i2p-${Extended.Version}/debian-alt/" />
2524            <fileset dir="../i2p-${Extended.Version}/installer/" includes="*.xml" />
2525            <fileset dir="../i2p-${Extended.Version}/installer/c/" />
2526            <fileset dir="../i2p-${Extended.Version}/installer/doc/" />
2527            <fileset dir="../i2p-${Extended.Version}/installer/lib/" />
2528            <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" />
2529            <fileset dir="../i2p-${Extended.Version}/installer/resources/Start I2P Router.app/" />
2530            <fileset dir="../i2p-${Extended.Version}/installer/resources/portable/" />
2531            <fileset dir="../i2p-${Extended.Version}/installer/resources/small/" />
2532            <fileset dir="../i2p-${Extended.Version}/Slackware" />
2533            <fileset dir="../i2p-${Extended.Version}/_MTN" />
2534            <fileset dir="../i2p-${Extended.Version}/.idea" />
2535            <fileset dir="../i2p-${Extended.Version}/.tx" />
2536            <file name="../i2p-${Extended.Version}/.mtn-ignore" />
2537            <fileset dir="../i2p-${Extended.Version}/" includes="Docker*" />
2538            <file name="../i2p-${Extended.Version}/Makefile.gcj" />
2539            <fileset dir="../i2p-${Extended.Version}/docs" />
2540            <fileset dir="../i2p-${Extended.Version}/launchers" />
2541            <file name="../i2p-${Extended.Version}/.travis.yml" />
2542            <file name="../i2p-${Extended.Version}/.gitignore" />
2543            <!-- gradle files -->
2544            <fileset dir="../i2p-${Extended.Version}/" includes="**/build.gradle" />
2545            <fileset dir="../i2p-${Extended.Version}/gradle" />
2546            <file name="../i2p-${Extended.Version}/gradlew" />
2547            <file name="../i2p-${Extended.Version}/gradlew.bat" />
2548            <file name="../i2p-${Extended.Version}/gradle.properties" />
2549            <file name="../i2p-${Extended.Version}/settings.gradle" />
2550            <!-- gettext-base -->
2551            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/gettext" />
2552            <!-- libgetopt-java -->
2553            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/getopt" />
2554            <!-- libjson-simple-java -->
2555            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/json" />
2556            <!-- libhttpclient-java and libhttpcore-java -->
2557          <!--
2558            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/apache/http" />
2559           -->
2560            <!-- geoip-database -->
2561            <file name="../i2p-${Extended.Version}/installer/resources/geoip.txt" />
2562            <file name="../i2p-${Extended.Version}/installer/resources/geoipv6.dat.gz" />
2563            <file name="../i2p-${Extended.Version}/installer/resources/GeoLite2-Country.mmdb.gz" />
2564            <!-- libjetty9-java -->
2565            <fileset dir="../i2p-${Extended.Version}/apps/jetty/jetty-distribution-${jetty.ver}" />
2566            <!-- libtomcat8-java -->
2567            <fileset dir="../i2p-${Extended.Version}/apps/jetty/apache-tomcat-${tomcat.ver}" />
2568            <!-- libjstl1.1-java or glassfish-javaee or libtaglibs-standard -->
2569            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/jstl.jar" />
2570            <!-- libjakarta-taglibs-standard-java or glassfish-javaee or libtaglibs-standard -->
2571            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/standard.jar" />
2572            <fileset dir="../i2p-${Extended.Version}/installer/resources/icons/flags" />
2573            <!-- anything added above, add in debian-release-tarball also -->
2574        </delete>
2575        <tar longfile="gnu" destfile="../${debian.tarball.name}" compression="bzip2">
2576            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${Extended.Version}">
2577                <include name="**/**" />
2578                <exclude name="debian/**"/>
2579                <exclude name="**/*.sh"/>
2580                <!-- anything added above, add in debian-release-tarball also -->
2581            </tarfileset>
2582            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${Extended.Version}" filemode="755">
2583                <exclude name="debian/**" />
2584                <include name="**/*.sh" />
2585            </tarfileset>
2586        </tar>
2587    </target>
2588
2589    <!-- same as debian-release-tarball but with bundled jetty
2590      -  We add a 'p' to the release name and tarball since the source package is different;
2591      -  Launchpad does not allow different source packages with the same name.
2592      -->
2593    <target name="precise-release-tarball" depends="getExtendedVersion, failIfNoMtn">
2594        <property name="debian.tarball.name" value="i2p_${release.number}p.orig.tar.bz2" />
2595        <echo message="Checking out fresh copy into ../i2p-${Extended.Version} for tarballing:" />
2596        <delete dir="../i2p-${Extended.Version}" />
2597        <exec executable="mtn" failonerror="true">
2598            <arg value="co" />
2599            <!-- w: is the revision of the current workspace -->
2600            <arg value="-r" />
2601            <arg value="w:" />
2602            <arg value="-b" />
2603            <arg value="i2p.i2p" />
2604            <arg value="../i2p-${Extended.Version}" />
2605        </exec>
2606        <delete includeemptydirs="true" quiet="false" failonerror="false">
2607            <fileset dir="../i2p-${Extended.Version}/debian-alt/" />
2608            <fileset dir="../i2p-${Extended.Version}/installer/" includes="*.xml" />
2609            <fileset dir="../i2p-${Extended.Version}/installer/c/" />
2610            <fileset dir="../i2p-${Extended.Version}/installer/doc/" />
2611            <fileset dir="../i2p-${Extended.Version}/installer/lib/" />
2612            <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" />
2613            <fileset dir="../i2p-${Extended.Version}/installer/resources/Start I2P Router.app/" />
2614            <fileset dir="../i2p-${Extended.Version}/installer/resources/portable/" />
2615            <fileset dir="../i2p-${Extended.Version}/installer/resources/small/" />
2616            <fileset dir="../i2p-${Extended.Version}/Slackware" />
2617            <fileset dir="../i2p-${Extended.Version}/_MTN" />
2618            <fileset dir="../i2p-${Extended.Version}/.idea" />
2619            <fileset dir="../i2p-${Extended.Version}/.tx" />
2620            <file name="../i2p-${Extended.Version}/.mtn-ignore" />
2621            <fileset dir="../i2p-${Extended.Version}/" includes="Docker*" />
2622            <file name="../i2p-${Extended.Version}/Makefile.gcj" />
2623            <fileset dir="../i2p-${Extended.Version}/docs" />
2624            <fileset dir="../i2p-${Extended.Version}/launchers" />
2625            <file name="../i2p-${Extended.Version}/.travis.yml" />
2626            <file name="../i2p-${Extended.Version}/.gitignore" />
2627            <!-- gradle files -->
2628            <fileset dir="../i2p-${Extended.Version}/" includes="**/build.gradle" />
2629            <fileset dir="../i2p-${Extended.Version}/gradle" />
2630            <file name="../i2p-${Extended.Version}/gradlew" />
2631            <file name="../i2p-${Extended.Version}/gradlew.bat" />
2632            <file name="../i2p-${Extended.Version}/gradle.properties" />
2633            <file name="../i2p-${Extended.Version}/settings.gradle" />
2634            <!-- gettext-base -->
2635            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/gettext" />
2636            <!-- libgetopt-java -->
2637            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/getopt" />
2638            <!-- libhttpclient-java and libhttpcore-java -->
2639          <!--
2640            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/apache/http" />
2641           -->
2642            <!-- geoip-database -->
2643            <file name="../i2p-${Extended.Version}/installer/resources/geoip.txt" />
2644            <file name="../i2p-${Extended.Version}/installer/resources/geoipv6.dat.gz" />
2645            <file name="../i2p-${Extended.Version}/installer/resources/GeoLite2-Country.mmdb.gz" />
2646            <!-- libjetty9-java -->
2647          <!--
2648            <fileset dir="../i2p-${Extended.Version}/apps/jetty/jetty-distribution-${jetty.ver}" />
2649            <fileset dir="../i2p-${Extended.Version}/apps/jetty/apache-tomcat-${tomcat.ver}" />
2650           -->
2651            <!-- libjstl1.1-java or glassfish-javaee -->
2652          <!--
2653            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/jstl.jar" />
2654           -->
2655            <!-- libjakarta-taglibs-standard-java or glassfish-javaee -->
2656            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/standard.jar" />
2657            <!-- famfamfam-flag-png is in trusty but not precise, so leave them in the source package for both -->
2658            <!-- anything added above, add in debian-release-tarball also -->
2659        </delete>
2660        <tar longfile="gnu" destfile="../${debian.tarball.name}" compression="bzip2">
2661            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${Extended.Version}">
2662                <include name="**/**" />
2663                <exclude name="debian/**"/>
2664                <exclude name="**/*.sh"/>
2665                <!-- anything added above, add in debian-release-tarball also -->
2666            </tarfileset>
2667            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${Extended.Version}" filemode="755">
2668                <exclude name="debian/**" />
2669                <include name="**/*.sh" />
2670            </tarfileset>
2671        </tar>
2672    </target>
2673
2674    <!-- xenial/yakkety only -->
2675    <!-- same as debian-release-tarball but with bundled jstl.jar
2676         (there's no libtaglibs-standard-* packages)
2677      -  We add a 'x' to the release name and tarball since the source package is different;
2678      -  Launchpad does not allow different source packages with the same name.
2679      -->
2680    <target name="xenial-release-tarball" depends="getExtendedVersion, failIfNoMtn">
2681        <property name="debian.tarball.name" value="i2p_${release.number}x.orig.tar.bz2" />
2682        <echo message="Checking out fresh copy into ../i2p-${Extended.Version} for tarballing:" />
2683        <delete dir="../i2p-${Extended.Version}" />
2684        <exec executable="mtn" failonerror="true">
2685            <arg value="co" />
2686            <!-- w: is the revision of the current workspace -->
2687            <arg value="-r" />
2688            <arg value="w:" />
2689            <arg value="-b" />
2690            <arg value="i2p.i2p" />
2691            <arg value="../i2p-${Extended.Version}" />
2692        </exec>
2693        <delete includeemptydirs="true" quiet="false" failonerror="false">
2694            <fileset dir="../i2p-${Extended.Version}/debian-alt/" />
2695            <fileset dir="../i2p-${Extended.Version}/installer/" includes="*.xml" />
2696            <fileset dir="../i2p-${Extended.Version}/installer/c/" />
2697            <fileset dir="../i2p-${Extended.Version}/installer/doc/" />
2698            <fileset dir="../i2p-${Extended.Version}/installer/lib/" />
2699            <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" />
2700            <fileset dir="../i2p-${Extended.Version}/installer/resources/Start I2P Router.app/" />
2701            <fileset dir="../i2p-${Extended.Version}/installer/resources/portable/" />
2702            <fileset dir="../i2p-${Extended.Version}/installer/resources/small/" />
2703            <fileset dir="../i2p-${Extended.Version}/Slackware" />
2704            <fileset dir="../i2p-${Extended.Version}/_MTN" />
2705            <fileset dir="../i2p-${Extended.Version}/.idea" />
2706            <fileset dir="../i2p-${Extended.Version}/.tx" />
2707            <file name="../i2p-${Extended.Version}/.mtn-ignore" />
2708            <fileset dir="../i2p-${Extended.Version}/" includes="Docker*" />
2709            <file name="../i2p-${Extended.Version}/Makefile.gcj" />
2710            <fileset dir="../i2p-${Extended.Version}/docs" />
2711            <fileset dir="../i2p-${Extended.Version}/launchers" />
2712            <file name="../i2p-${Extended.Version}/.travis.yml" />
2713            <file name="../i2p-${Extended.Version}/.gitignore" />
2714            <!-- gradle files -->
2715            <fileset dir="../i2p-${Extended.Version}/" includes="**/build.gradle" />
2716            <fileset dir="../i2p-${Extended.Version}/gradle" />
2717            <file name="../i2p-${Extended.Version}/gradlew" />
2718            <file name="../i2p-${Extended.Version}/gradlew.bat" />
2719            <file name="../i2p-${Extended.Version}/gradle.properties" />
2720            <file name="../i2p-${Extended.Version}/settings.gradle" />
2721            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/gettext" />
2722            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/getopt" />
2723            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/json" />
2724          <!--
2725            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/apache/http" />
2726           -->
2727            <file name="../i2p-${Extended.Version}/installer/resources/geoip.txt" />
2728            <file name="../i2p-${Extended.Version}/installer/resources/geoipv6.dat.gz" />
2729            <file name="../i2p-${Extended.Version}/installer/resources/GeoLite2-Country.mmdb.gz" />
2730            <fileset dir="../i2p-${Extended.Version}/apps/jetty/jetty-distribution-${jetty.ver}" />
2731            <fileset dir="../i2p-${Extended.Version}/apps/jetty/apache-tomcat-${tomcat.ver}" />
2732          <!--
2733            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/jstl.jar" />
2734           -->
2735            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/standard.jar" />
2736            <fileset dir="../i2p-${Extended.Version}/installer/resources/icons/flags" />
2737            <!-- anything added above, add in debian-tarball also -->
2738        </delete>
2739        <tar longfile="gnu" destfile="../${debian.tarball.name}" compression="bzip2">
2740            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${release.number}">
2741                <include name="**/**" />
2742                <exclude name="debian/**"/>
2743                <exclude name="**/*.sh"/>
2744                <!-- anything added above, add in debian-tarball also -->
2745            </tarfileset>
2746            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${release.number}" filemode="755">
2747                <exclude name="debian/**" />
2748                <include name="**/*.sh" />
2749            </tarfileset>
2750        </tar>
2751    </target>
2752
2753    <!-- stretch+, zesty+ -->
2754    <!-- same as debian-tarball but with a release tar.bz2 file name and tar prefix -->
2755    <target name="debian-release-tarball" depends="getExtendedVersion, failIfNoMtn">
2756        <property name="debian.tarball.name" value="i2p_${release.number}.orig.tar.bz2" />
2757        <echo message="Checking out fresh copy into ../i2p-${Extended.Version} for tarballing:" />
2758        <delete dir="../i2p-${Extended.Version}" />
2759        <exec executable="mtn" failonerror="true">
2760            <arg value="co" />
2761            <!-- w: is the revision of the current workspace -->
2762            <arg value="-r" />
2763            <arg value="w:" />
2764            <arg value="-b" />
2765            <arg value="i2p.i2p" />
2766            <arg value="../i2p-${Extended.Version}" />
2767        </exec>
2768        <delete includeemptydirs="true" quiet="false" failonerror="false">
2769            <fileset dir="../i2p-${Extended.Version}/debian-alt/" />
2770            <fileset dir="../i2p-${Extended.Version}/installer/" includes="*.xml" />
2771            <fileset dir="../i2p-${Extended.Version}/installer/c/" />
2772            <fileset dir="../i2p-${Extended.Version}/installer/doc/" />
2773            <fileset dir="../i2p-${Extended.Version}/installer/lib/" />
2774            <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" />
2775            <fileset dir="../i2p-${Extended.Version}/installer/resources/Start I2P Router.app/" />
2776            <fileset dir="../i2p-${Extended.Version}/installer/resources/portable/" />
2777            <fileset dir="../i2p-${Extended.Version}/installer/resources/small/" />
2778            <fileset dir="../i2p-${Extended.Version}/Slackware" />
2779            <fileset dir="../i2p-${Extended.Version}/_MTN" />
2780            <fileset dir="../i2p-${Extended.Version}/.idea" />
2781            <fileset dir="../i2p-${Extended.Version}/.tx" />
2782            <file name="../i2p-${Extended.Version}/.mtn-ignore" />
2783            <fileset dir="../i2p-${Extended.Version}/" includes="Docker*" />
2784            <file name="../i2p-${Extended.Version}/Makefile.gcj" />
2785            <fileset dir="../i2p-${Extended.Version}/docs" />
2786            <fileset dir="../i2p-${Extended.Version}/launchers" />
2787            <file name="../i2p-${Extended.Version}/.travis.yml" />
2788            <file name="../i2p-${Extended.Version}/.gitignore" />
2789            <!-- gradle files -->
2790            <fileset dir="../i2p-${Extended.Version}/" includes="**/build.gradle" />
2791            <fileset dir="../i2p-${Extended.Version}/gradle" />
2792            <file name="../i2p-${Extended.Version}/gradlew" />
2793            <file name="../i2p-${Extended.Version}/gradlew.bat" />
2794            <file name="../i2p-${Extended.Version}/gradle.properties" />
2795            <file name="../i2p-${Extended.Version}/settings.gradle" />
2796            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/gettext" />
2797            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/getopt" />
2798            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/json" />
2799          <!--
2800            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/apache/http" />
2801           -->
2802            <file name="../i2p-${Extended.Version}/installer/resources/geoip.txt" />
2803            <file name="../i2p-${Extended.Version}/installer/resources/geoipv6.dat.gz" />
2804            <file name="../i2p-${Extended.Version}/installer/resources/GeoLite2-Country.mmdb.gz" />
2805            <fileset dir="../i2p-${Extended.Version}/apps/jetty/jetty-distribution-${jetty.ver}" />
2806            <fileset dir="../i2p-${Extended.Version}/apps/jetty/apache-tomcat-${tomcat.ver}" />
2807            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/jstl.jar" />
2808            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/standard.jar" />
2809            <fileset dir="../i2p-${Extended.Version}/installer/resources/icons/flags" />
2810            <!-- anything added above, add in debian-tarball also -->
2811        </delete>
2812        <tar longfile="gnu" destfile="../${debian.tarball.name}" compression="bzip2">
2813            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${release.number}">
2814                <include name="**/**" />
2815                <exclude name="debian/**"/>
2816                <exclude name="**/*.sh"/>
2817                <!-- anything added above, add in debian-tarball also -->
2818            </tarfileset>
2819            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${release.number}" filemode="755">
2820                <exclude name="debian/**" />
2821                <include name="**/*.sh" />
2822            </tarfileset>
2823        </tar>
2824    </target>
2825
2826    <target name="debian-patch" depends="getExtendedVersion" >
2827        <exec executable="quilt" failonerror="true">
2828            <arg value="-a" />
2829            <arg value="push" />
2830        </exec>
2831        <echo message="====================" />
2832    </target>
2833    <target name="debian-unpatch" depends="buildProperties">
2834        <exec executable="quilt" failonerror="false">
2835            <arg value="-a" />
2836            <arg value="pop" />
2837        </exec>
2838    </target>
2839
2840    <target name="debianrepo" depends="debian">
2841        <exec dir="debian" executable="./makerepo.sh" failonerror="true"/>
2842    </target>
2843
2844<!-- the following are appened to help build barebone portable version,
2845     none of the above is modified for this purpose -->
2846        <target name = "pkg-portable-clean">
2847                <delete dir="build/" />
2848                <delete dir="pkg-temp/" />
2849                <delete>
2850                        <fileset dir="." includes="portable-**.zip**" />
2851                </delete>
2852        </target>
2853<!-- build a portable archive -->
2854
2855<!-- *0* Since we simply pack all files in folder "build/" into our archieve,
2856                we need to make sure its small, with NO redundent jars or wars.
2857                thus cleaning is required before each build-->
2858        <target name="buildSmallOnly" depends="pkg-portable-clean,buildSmall"/>
2859
2860<!-- *1* preparing the jars by OS dependent de-bloating -->
2861        <target name="preppkg-portable-win32-jbigi" depends="buildSmallOnly, jbigi-windows-only" />
2862
2863        <target name="preppkg-portable-linux-jbigi"  depends="buildSmallOnly, jbigi-linux-only" />
2864
2865<!-- *2* os independent procedure  -->
2866        <target name="preppkg-portable-basic" >
2867                <mkdir dir="pkg-temp" />
2868                        <!-- non OS dependent configurations only, dont add *nux/win stuff here -->
2869                        <copy todir="pkg-temp">
2870                                <fileset dir="installer/resources/portable/configs/" />
2871                        </copy>
2872                        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
2873                        <copy file="installer/resources/hosts.txt" todir="pkg-temp/" />
2874                        <copy file="installer/resources/readme.license.txt" todir="pkg-temp/" />
2875                <mkdir dir="pkg-temp/addressbook" />
2876                        <copy file="apps/addressbook/subscriptions.txt" todir="pkg-temp/addressbook/" />
2877                        <copy file="apps/addressbook/myhosts.txt"  todir="pkg-temp/addressbook/" />
2878                        <!-- config.txt is in installer/resources/portable -->
2879                <mkdir dir="pkg-temp/docs" />
2880                        <copy file="installer/resources/initialNews/initialNews.xml" tofile="pkg-temp/docs/news.xml" overwrite="true" />
2881                        <copy file="installer/resources/readme/readme.html" tofile="pkg-temp/docs/readme.html" />
2882                        <copy file="installer/resources/startconsole.html" todir="pkg-temp/docs/" />
2883                        <copy file="installer/resources/start.ico" todir="pkg-temp/docs/" />
2884                        <copy file="installer/resources/console.ico" todir="pkg-temp/docs/" />
2885                        <!-- HTTP Header files, english only,
2886                                if you need a different lang do it in a seperate target -->
2887                        <copy todir="pkg-temp/docs/" >
2888                                <fileset dir="installer/resources/proxy/"  includes="**-header.ht" />
2889                        </copy>
2890                        <!-- Theme light only -->
2891                        <copy todir="pkg-temp/docs/themes/console/light/" overwrite="true" >
2892                                <fileset dir="installer/resources/themes/console/light/" includes="**.css" />
2893                        </copy>
2894                        <copy file="installer/resources/themes/console/light/console_big.css" todir="portable/docs/themes/console/light/" />
2895                        <copy todir="pkg-temp/docs/themes/console/images/" >
2896                                <fileset dir="installer/resources/themes/console/images/" />
2897                        </copy>
2898                        <!-- FLAGs for language icon (not for ip)-->
2899                        <copy todir="pkg-temp/docs/icons" >
2900                                <fileset dir="installer/resources/icons" />
2901                        </copy>
2902                <mkdir dir="pkg-temp/webapps" />
2903                        <copy todir="pkg-temp/webapps/">
2904                                <fileset dir="build/" includes="**.war" />
2905                        </copy>
2906                <mkdir dir="pkg-temp/lib" />
2907                        <copy todir ="pkg-temp/lib/" >
2908                                <fileset dir="build/" includes="**.jar" />
2909                        </copy>
2910                        <!-- 3rd party jars from apps/  -->
2911                                <!-- jrobin - without jobin , you lost graph and get a lot error entry in logs -->
2912                        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
2913        </target>
2914<!-- *3* os dependent procedure/commands -->
2915        <target name = "preppkg-portable-win32" depends="preppkg-portable-win32-jbigi,preppkg-portable-basic">
2916                        <!--wrapper - dont even think about it. i2p cosumes appreantly more mem without it on win32-->
2917                <copy file="installer/lib/wrapper/win32/wrapper.dll" todir="pkg-temp/lib" />
2918                <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
2919                <copy file="installer/lib/wrapper/win32/I2Psvc.exe" tofile="pkg-temp/i2psvc.ex_" />
2920                        <!--  copy the unpack/start batchfiles -->
2921                <copy todir="pkg-temp">
2922                        <fileset dir="installer/resources/portable/win32/" />
2923                </copy>
2924        </target>
2925<!-- *4* command for windows package -->
2926        <target name = "pkg-portable-win32"     depends="preppkg-portable-win32, pack200" >
2927                <!-- i need the portable\ folder in .zip so basedir is set to . -->
2928                <move file="pkg-temp" tofile="portable"/>
2929                <zip destfile="portable-win32.zip" basedir="." level="9" includes="portable\**" />
2930                <checksum file="portable-win32.zip" forceOverwrite="yes"/>
2931                <move file="portable" tofile="pkg-temp"/>
2932        </target>
2933</project>
Note: See TracBrowser for help on using the repository browser.