source: build.xml @ d4caafb5

Last change on this file since d4caafb5 was d4caafb5, checked in by zzz <zzz@…>, 16 months ago

Bundle I2PControl 0.12, as a console webapp
Includes mods to use org.json.simple package.
See licenses/LICENSE-Apache2.0.txt
Includes jBCrypt:
Copyright © 2006 Damien Miller <djm@…>
See licenses/LICENSE-jBCrypt.txt
Includes jsonrpc2 libs:
See licenses/LICENSE-Apache2.0.txt
http://software.dzhuvinov.com/json-rpc-2.0-server.html
Jars from maven central:
jsonrpc2-base-1.38.1-sources.jar 22-Oct-2017
jsonrpc2-server-1.11-sources.jar 16-Mar-2015

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