source: build.xml @ 2c97dc2

Last change on this file since 2c97dc2 was e75881d, checked in by zzz <zzz@…>, 12 months ago

Build: Forgot libjcpuid

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