source: build.xml @ 2746ed5

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

Installer: Drop unused systray.config

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