source: build.xml @ e174a46

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

javadoc fixes

  • Property mode set to 100644
File size: 154.2 KB
RevLine 
[5f18cec]1<?xml version="1.0" encoding="ISO-8859-1"?>
[9a91443]2<project basedir="." default="all" name="i2p"
3    xmlns:artifact="antlib:org.apache.maven.artifact.ant">
[370be48]4
[aba655a]5    <!-- Include property files so that values can be easily overridden.
6         Users should create an override.properties file to make changes.
7     -->
[255ccdc]8    <property file="override.properties"/>
9    <property file="build.properties"/>
[9ac3157]10    <!--  When changing, also change javadoc URL in build.properties, and checksum in apps/jetty/build.xml -->
[68feb08]11    <property name="jetty.ver" value="9.2.25.v20180606" />
[8d00774]12    <property name="tomcat.ver" value="8.5.40" />
[6623616]13
[157b85b]14    <!-- You probably don't want to change anything from here down -->
[b4d83b1]15    <target name="help" depends="all" />
[77bd69c]16    <target name="all" >
17        <echo message="Useful targets: " />
[6a103a1]18        <echo message="  pkg:       distclean then package everything up (updater, installer)" />
[9500a55]19        <echo message="  dist:      pkg and javadoc" />
[6a103a1]20        <echo message="  dist200:   pkg, updater200, and javadoc" />
[44c54ec]21        <echo message="  installer: build the GUI installer" />
[a29fd1e]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)" />
[6a103a1]26        <echo message="  installer-nowindows: build the GUI installer (all but Windows)" />
[30fc954]27        <echo message="  installer5, installer5-linux, installer5-nowindows, installer5-windows: use IzPack 5" />
[38e109d]28        <echo message="  osxLauncher: build the Mac OS X router/GUI launcher (OSX only)" />
29        <echo message="  bbLauncher: build the Browser Bundle router launcher" />
[44c54ec]30        <echo message="  tarball:   tar the full install into i2p.tar.bz2 (extracts to build a new clean install)" />
[10f674a]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)" />
[6dc3cd9]33        <echo message="  signed-updater200: Signed updater compressed with pack200 (creates i2pupdate.su3, 60% smaller)" />
[ff828e6]34        <echo message="  updaterWithJavadoc: updater including the javadocs, for display in the console" />
[0874b3e]35        <echo message="  updater200WithJavadoc: updater including the javadocs, for display in the console (creates i2pupdate200.zip)" />
[6dc3cd9]36        <echo message="  signed-updater200WithJavadoc: Signed updater including the javadocs, for display in the console (creates i2pupdate.su3)" />
[5376858]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)" />
[6dc3cd9]39        <echo message="  signed-updater200WithJavadocAndJetty: Signed updater including the javadocs, for display in the console, and Jetty (creates i2pupdate.su3)" />
[10f674a]40        <echo message="  updaterWithJetty: Updater including Jetty" />
[9c2994c]41        <echo message="  updater200WithJetty: Updater including Jetty" />
[6dc3cd9]42        <echo message="  signed-updater200withJetty: Signed updater including Jetty" />
[89f0f09]43        <echo message="  updaterWithJettyFixes: updater including local jetty patches" />
[3ba43a77]44        <echo message="  updaterWithGeoIP: updater including GeoIP Files" />
[dcaa059]45        <echo message="  updaterWithJettyFixesAndGeoIP" />
[2f10cca]46        <echo message="  updaterWithJettyFixesAndJbigi" />
[13d3730]47        <echo message="  updaterWithJbigi" />
48        <echo message="  updater200WithJbigi" />
[74e5ea6]49        <echo message="  updaterSmall:   updater with the essentials only - no SAM, i2psnark, SusiMail, SusiDNS, or history.txt" />
[ffc67d1]50        <echo message="  updaterRouter:  updater with the i2p.jar and router.jar only" />
[77bd69c]51        <echo message="  distclean: clean up all derived files" />
[6a103a1]52        <!-- <echo message="  syndie:    generate a standalone syndie install" /> -->
[b434a475]53        <echo message="  desktopgui: generate a standalone desktopgui install" />
[c287bace]54        <echo message="  i2psnark:  generate a standalone i2psnark install" />
[4f548b7]55        <echo message="  justBOB:  generate a standalone BOB-one.jar" />
[6a103a1]56        <echo message="  javadoc:   generate javadoc for the entire project into ./build/javadoc and ./javadoc.zip" />
[482a63c]57        <echo message="  javadoc-test: Javadocs for unit test classes (build/javadoc-test)" />
[1f8f3eb]58        <echo message="  slackpkg:  generate Slackware package in ./Slackware/i2p" />
[28a14782]59        <echo message="  debianhowto: instructions on building Debian packages" />
[84e4558]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)" /> -->
[56e0c3e0]64        <echo message="  poupdate: update the .po files for translators" />
[bfb74f7]65        <echo message="  pkg-portable-win32:  build a minimum portable version for win32" />
[49ed170]66        <echo message="  bench: build the benchmarks" />
[bfb74f7]67   </target>
[28a14782]68    <target name="debianhowto">
[84e4558]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="" />
[5c8eab9]76            <echo message="The following command will install the build dependencies for you:" />
[84e4558]77            <echo message=" " />
[5c8eab9]78            <echo message="sudo apt-get install debhelper ant debconf default-jdk gettext libgmp-dev po-debconf fakeroot \" />
[5c0c69c]79            <echo message="  build-essential quilt dh-apparmor dh-systemd libservice-wrapper-java libjson-simple-java \"  />
[eeb2835]80            <echo message="  devscripts libjetty9-java libtomcat8-java libtaglibs-standard-jstlel-java libgetopt-java"  />
[5c8eab9]81            <echo message=" " />
82            <echo message="The following command will install the additional runtime dependencies:" />
[30fc954]83            <echo message="sudo apt-get install geoip-database famfamfam-flag-png" />
[84e4558]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." />
[77bd69c]87    </target>
[58512b8]88
[7f6ba8cd]89    <property name="gpg" value="gpg" />
90
[58512b8]91    <macrodef name="gpgsign">
92        <attribute name="file" />
93        <sequential>
94            <delete file="@{file}.sig" quiet="true" />
[7f6ba8cd]95            <exec executable="${gpg}" failonerror="true">
96                <arg value="-u" />
[58512b8]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
[9a91443]109    <macrodef name="gpgsignasc">
110        <attribute name="file" />
111        <sequential>
112            <delete file="@{file}.asc" quiet="true" />
[7f6ba8cd]113            <exec executable="${gpg}" failonerror="true">
114                <arg value="-u" />
[9a91443]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
[58512b8]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>
[37597b8]136                <arg value="-a" />
[58512b8]137                <arg value="http://tracker2.postman.i2p/announce.php" />
[37597b8]138                <arg value="-c" />
139                <arg value="${build.built-by}" />
140                <arg value="@{file}" />
[58512b8]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
[6dc3cd9]159    <macrodef name="sudsign">
160        <attribute name="infile" />
161        <attribute name="outfile" />
162        <sequential>
[7a49b09]163            <input message="Enter sud/su2 private signing key file:" addproperty="release.privkey" />
[6dc3cd9]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" />
[9f3d5bf]214        <attribute name="su3.ver" />
[6dc3cd9]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>
[7a49b09]227        <input message="Enter su3 key name (you@mail.i2p):" addproperty="release.signer.su3" />
[6dc3cd9]228        <fail message="You must enter a name." >
229            <condition>
230                <equals arg1="${release.signer.su3}" arg2=""/>
231            </condition>
232        </fail>
[7a49b09]233        <input message="Enter su3 key password for ${release.signer.su3}:" addproperty="release.password.su3" />
[6dc3cd9]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}" />
[9f3d5bf]251                <arg value="@{su3.ver}" />
[6dc3cd9]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>
[34e3909]275
[6a103a1]276    <target name="dist" depends="pkg, javadoc" />
[18f113d]277    <target name="dist200" depends="pkg200, javadoc" />
[2e72ece]278    <target name="build" depends="build2">
279        <!-- so we don't build standalone for the updater -->
[2ca0ae7]280        <!-- This builds apps/i2psnark/java/i2psnark-standalone.zip,
281          -   which we don't distribute anywhere...
[2e72ece]282        <ant dir="apps/i2psnark/java/" target="standalone" />
[2ca0ae7]283        -->
[2e72ece]284    </target>
285    <target name="build2" depends="builddep, jar, buildWEB" />
[2f72f5c]286    <target name="buildSmall" depends="builddepSmall, jarSmall, buildWEB" />
[bd78a66]287    <target name="buildclean" depends="distclean, build" />
[612d06b]288
[d4caafb5]289    <target name="builddep" depends="builddepSmall, buildBOB, buildSAM, buildSusiMail, buildSusiDNS, buildI2PSnark, buildI2PControl" />
[612d06b]290
[84d8683]291    <target name="builddepSmall" depends="buildrouter, buildSystray, buildDesktopGui, buildRouterConsole, buildStreaming, buildI2PTunnel, buildAddressbook" />
[612d06b]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
[9f3d5bf]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
[8c10ec9]306    <target name="bbLauncher" depends="build">
307        <sequential>
[0a1191a]308            <exec executable="./sbt" dir="launchers" failonerror="true">
[8c10ec9]309                <arg value="browserbundle:clean" />
310            </exec>
[0a1191a]311            <exec executable="./sbt" dir="launchers" failonerror="true">
[8c10ec9]312                <arg value="browserbundle:assembly" />
313            </exec>
314        </sequential>
315    </target>
316
[5f81a8de]317    <target name="osxLauncher" depends="build,preppkg-osx">
[8c10ec9]318        <sequential>
[0a1191a]319            <exec executable="./sbt" dir="launchers" failonerror="true">
[5f81a8de]320                <arg value="macosx:cleanAllTask" />
[8c10ec9]321            </exec>
[0a1191a]322            <exec executable="./sbt" dir="launchers" failonerror="true">
[5f81a8de]323                <arg value="macosx:buildAppBundleTask" />
[8c10ec9]324            </exec>
325        </sequential>
326    </target>
327
[b8ab14b]328    <target name="buildBOB" depends="buildStreaming" >
[bb32672]329        <ant dir="apps/BOB/" target="jar" />
[4407373]330        <copy file="apps/BOB/dist/BOB.jar" todir="build/" />
[612d06b]331    </target>
332
333    <target name="buildSAM" depends="buildStreaming" >
[2f72f5c]334        <ant dir="apps/sam/java/" target="jar" />
[4407373]335        <copy file="apps/sam/java/build/sam.jar" todir="build/" />
[612d06b]336    </target>
337
338    <target name="buildSusiMail" depends="buildCore, buildJetty" >
[2f72f5c]339        <ant dir="apps/susimail/" target="war" />
[4407373]340        <copy file="apps/susimail/susimail.war" todir="build/" />
[612d06b]341    </target>
342
[9f7ec39]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
[fda6730]349    <target name="buildSusiDNS" depends="buildCore, buildJetty, buildImagegen, buildAddressbook" >
[2f72f5c]350        <ant dir="apps/susidns/src" target="all" />
[4407373]351        <copy file="apps/susidns/src/susidns.war" todir="build/" />
[612d06b]352    </target>
353
[5004626]354    <target name="buildImagegen" depends="buildCore, buildJetty" >
[7a49b09]355        <ant dir="apps/imagegen" target="build" />
[5004626]356        <copy file="apps/imagegen/imagegen/build/imagegen.war" todir="build/" />
357    </target>
358
[d4caafb5]359    <target name="buildI2PControl" depends="buildRouter, buildJetty" >
360        <ant dir="apps/i2pcontrol" target="war" />
361        <copy file="apps/i2pcontrol/build/jsonrpc.war" todir="build/" />
362    </target>
363
[e27af37]364    <target name="buildI2PSnark" depends="buildStreaming, buildJetty, buildSystray" >
[2e72ece]365        <ant dir="apps/i2psnark/java/" target="war" />
[4407373]366        <copy file="apps/i2psnark/i2psnark.war" todir="build/" />
367        <copy file="apps/i2psnark/java/build/i2psnark.jar" todir="build/" />
[2f72f5c]368    </target>
[612d06b]369
[2c049878]370    <!-- jar (not war) for Android -->
371    <target name="buildAddressbookJar" depends="buildCore" >
372        <ant dir="apps/addressbook/" target="jar" />
[1919e36]373        <copy file="apps/addressbook/dist/addressbook.jar" todir="build/" />
[2c049878]374    </target>
375
[fda6730]376    <target name="buildAddressbook" depends="buildCore" >
377        <ant dir="apps/addressbook/" target="all" />
378        <copy file="apps/addressbook/dist/addressbook.jar" todir="build/" />
379        <!-- war is empty, only for updates -->
[4407373]380        <copy file="apps/addressbook/dist/addressbook.war" todir="build/" />
[612d06b]381    </target>
382
[1919e36]383    <!-- Both jars and no war, for Android -->
384    <target name="buildI2PTunnelJars" depends="buildStreaming" >
385        <ant dir="apps/i2ptunnel/java/" target="uiJar" />
[4407373]386        <copy file="apps/i2ptunnel/java/build/i2ptunnel.jar" todir="build/" />
[1919e36]387        <copy file="apps/i2ptunnel/java/build/i2ptunnel-ui.jar" todir="build/" />
[e4f141b]388    </target>
389
[7eed4fa]390    <target name="buildI2PTunnel" depends="buildStreaming, buildJetty, buildImagegen" >
[612d06b]391        <ant dir="apps/i2ptunnel/java/" target="build" />
[4407373]392        <copy file="apps/i2ptunnel/java/build/i2ptunnel.jar" todir="build/" />
393        <copy file="apps/i2ptunnel/java/build/i2ptunnel.war" todir="build/" />
[612d06b]394    </target>
395
[51bf23a]396    <target name="buildDesktopGui" depends="buildCore, buildrouter, buildSystray" >
[84d8683]397        <ant dir="apps/desktopgui" target="jar" />
[4407373]398        <copy file="apps/desktopgui/dist/desktopgui.jar" todir="build/" />
[84d8683]399    </target>
400
[78acf70]401    <target name="buildRouterConsole" depends="buildrouter, buildSystray, buildDesktopGui, buildJetty, buildJrobin" >
[aeb6635]402        <ant dir="apps/routerconsole/java/" target="jar" />
[612d06b]403    </target>
404
[239fe51]405    <!-- newsxml.jar only (subset of routerconsole, no war) for Android -->
406    <target name="buildNewsXMLJar" depends="buildRouter" >
407        <ant dir="apps/routerconsole/java/" target="newsxmljar" />
408    </target>
409
[03e86fcb]410    <target name="buildJetty" depends="buildCore" >
[612d06b]411        <ant dir="apps/jetty" target="build" />
[4407373]412        <copy todir="build/" >
413            <fileset dir="apps/jetty/jettylib" excludes="ant.jar" />
414        </copy>
[612d06b]415    </target>
416
417    <target name="buildSystray" depends="buildCore" >
418        <ant dir="apps/systray/java/" target="jar" />
[4407373]419        <copy file="apps/systray/java/build/systray.jar" todir="build/" />
[612d06b]420    </target>
421
422    <target name="buildStreaming" depends="buildMinistreaming" >
[0c51f2b]423        <ant dir="apps/streaming/java/" target="jar" />
[4407373]424        <copy file="apps/streaming/java/build/streaming.jar" todir="build/" />
[77bd69c]425    </target>
[612d06b]426
427    <target name="buildMinistreaming" depends="buildCore" >
428        <ant dir="apps/ministreaming/java/" target="jar" />
[4407373]429        <copy file="apps/ministreaming/java/build/mstreaming.jar" todir="build/" />
[612d06b]430    </target>
431
432    <target name="buildRouter" depends="buildrouter" />
433    <target name="buildrouter" depends="buildCore" >
[731e26e]434        <ant dir="router/java/" target="jar" />
435        <copy file="router/java/build/router.jar" todir="build/" />
436    </target>
[612d06b]437
[fd91927c]438    <target name="buildCore" depends="buildProperties" >
[612d06b]439        <ant dir="core/java/" target="jar" />
440        <copy file="core/java/build/i2p.jar" todir="build/" />
441    </target>
442
[d7a84c88]443    <target name="buildJrobin" depends="buildCore" >
[78acf70]444        <ant dir="apps/jrobin/java/" target="jar" />
445        <copy file="apps/jrobin/java/build/jrobin.jar" todir="build/" />
[ef26acc]446    </target>
447
[e68182a]448    <target name="buildProperties" depends="getMtnRev, getReleaseNumber, getBuildNumber, setBuildTimestamp, disableManifestClasspath" >
[4407373]449        <!-- default if not set above -->
450        <property name="workspace.version" value="unknown" />
[d8cc2a3]451        <!-- default if not set by setBuildTimestamp -->
452        <property name="build.timestamp" value="reproducible" />
[e68182a]453        <!-- default if not set by disableManifestClasspath -->
454        <property name="manifest.classpath.name" value="Class-Path" />
[d8cc2a3]455        <property name="full.version" value="${release.number}-${i2p.build.number}${build.extra}" />
456        <echo message="Building version ${full.version} (mtn rev ${workspace.version})" />
457    </target>
458
459    <target name="setBuildTimestamp" unless="${build.reproducible}" >
[4407373]460        <tstamp>
461            <format property="build.timestamp" pattern="yyyy-MM-dd HH:mm:ss z" timezone="UTC" locale="en" />
462        </tstamp>
463    </target>
464
[e68182a]465    <!-- Disable Class-Path in jar manifests by renaming it (Fedora) -->
466    <target name="disableManifestClasspath" if="${without-manifest-classpath}" >
467        <property name="manifest.classpath.name" value="Disabled-Class-Path" />
468    </target>
469
[4407373]470    <target name="buildWEB" depends="buildRouterConsole" >
471        <copy file="apps/routerconsole/java/build/routerconsole.jar" todir="build/" />
472        <copy file="apps/routerconsole/java/build/routerconsole.war" todir="build/" />
473    </target>
474
[73256f6]475    <target name="buildTools" depends="buildrouter" >
476        <ant dir="installer/tools/java" target="jar" />
477        <copy file="installer/tools/java/build/tools.jar" todir="build/" />
478    </target>
479
[4407373]480    <!-- end of sub-build.xml targets -->
481
[6a48910]482    <!-- monotone targets -->
483
[c5f04ee]484    <target name="checkForMtn" >
485        <available property="mtn.available" file="_MTN" type="dir" />
486    </target>
487
[6a48910]488    <target name="failIfNoMtn" depends="checkForMtn">
489        <fail message="This target cannot be used without Monotone! Use &quot;fakeroot debian/rules get-orig-source&quot; instead.">
490            <condition>
491                <not>
492                    <isset property="mtn.available" />
493                </not>
494            </condition>
495        </fail>
496    </target>
497
[c5f04ee]498    <target name="getMtnRev" depends="checkForMtn" if="mtn.available" >
[fd91927c]499        <exec executable="mtn" outputproperty="workspace.version" errorproperty="mtn.error1" failifexecutionfails="false" >
500            <arg value="automate" />
501            <arg value="get_base_revision_id" />
502        </exec>
[c5f04ee]503    </target>
504
[3396626a]505    <target name="trimMtnRev" depends="getMtnRev">
506        <script language="javascript">
507            <![CDATA[
508            var MtnRev = project.getProperty("workspace.version");
509            if (MtnRev != 'unknown' && MtnRev != null) {
510                echo = project.createTask("echo");
511                var MtnShortHash = MtnRev.substring(0,8);
512                project.setProperty("MtnShortHash", MtnShortHash);
513                echo.setMessage("Trimmed hash: " + MtnShortHash);
514                echo.perform();
515            } else {
516                project.setProperty("MtnShortHash", 'unknown');
517            }
518            ]]>
519        </script>
520    </target>
521
[18664d3]522    <target name="checkIfBumped">
523        <exec executable="mtn" outputproperty="bumped" errorproperty="mtn.error2" failifexecutionfails="false" >
524            <arg value="ls" />
525            <arg value="ch" />
526            <arg value="router/java/src/net/i2p/router/RouterVersion.java" />
527        </exec>
528        <condition property="bumped.already">
529            <not>
530                <equals arg1="${bumped}" arg2=""/>
531            </not>
532        </condition>
533    </target>
534
[e7b9a23]535    <target name="bump" depends="bumpBuild" />
[18664d3]536    <target name="bumpBuild" depends="checkIfBumped, getBuildNumber" unless="bumped.already">
537        <script language="javascript">
538            <![CDATA[
539            var newBuildNumber = (Number(project.getProperty("i2p.build.number")) + 1);
540            if (newBuildNumber != 'unknown' && newBuildNumber != null) {
541                echo = project.createTask("echo");
542                project.setProperty("new.i2p.build.number", newBuildNumber);
[e978bb8]543                echo.setMessage("Build number is now: " + newBuildNumber + project.getProperty("build.extra"));
[18664d3]544                echo.perform();
545            }
546            ]]>
547        </script>
548        <replaceregexp byline="true" file="router/java/src/net/i2p/router/RouterVersion.java"
549            match='(^\s+public\s+final\s+static\s+long\s+BUILD\s+=\s+)[0-9]+;' replace='\1${new.i2p.build.number};'/>
550    </target>
551
[841bb755]552    <target name="revisions" depends="getReleaseNumber, getBuildNumber">
553        <!-- mtn log __brief __no-graph __to t:i2p-0.9.xx | cut -d ' ' -f 2 | sort | uniq -c | sort -rn -->
554        <exec executable="mtn" outputproperty="getrevisions1" errorproperty="reverror1" failifexecutionfails="true" >
555            <arg value="log" />
556            <arg value="--brief" />
557            <arg value="--no-graph" />
558            <arg value="--to" />
559            <arg value="t:i2p-${release.number}" />
560        </exec>
561        <exec executable="cut" inputstring="${getrevisions1}" outputproperty="getrevisions2" failifexecutionfails="true" >
562            <arg value="-d" />
563            <arg value=" " />
564            <arg value="-f" />
565            <arg value="2" />
566        </exec>
567        <exec executable="sort" inputstring="${getrevisions2}" outputproperty="getrevisions3" failifexecutionfails="true" >
568        </exec>
569        <exec executable="uniq" inputstring="${getrevisions3}" outputproperty="getrevisions4" failifexecutionfails="true" >
570            <arg value="-c" />
571        </exec>
572        <exec executable="sort" inputstring="${getrevisions4}" outputproperty="getrevisions5" failifexecutionfails="true" >
573            <arg value="-rn" />
574        </exec>
575        <echo message="Revisions since ${release.number}:" />
576        <echo message="${getrevisions5}" />
577    </target>
578
[6a48910]579    <!-- end monotone targets -->
580
581    <!-- launch4j targets -->
582
[7527a02]583    <condition property="noExe">
584        <not>
585            <!-- We only have launch4j binaries for the following systems -->
586            <and>
587                <or>
588                    <os arch="x86" />
589                    <os arch="i386" />
590                    <os arch="i586" />
591                    <os arch="i686" />
592                    <os arch="amd64" />
593                    <os arch="x86_64" />
594                </or>
[6fe1272]595                <or>
596                    <os name="Linux" />
597                    <os family="windows" />
598                </or>
[7527a02]599            </and>
600        </not>
601    </condition>
[fcbee9d9]602
[7527a02]603    <!-- this makes an empty build/launchi2p.jar and the build/i2p.exe for the no-wrapper windows startup, if possible -->
604    <target name="buildexe" depends="buildProperties, launch4j" unless="noExe">
[224405d7]605        <echo message="See the file &quot;build.properties&quot; if this step fails." />
[d89f589f]606        <jar destfile="./build/launchi2p.jar">
607            <manifest>
[7527a02]608                <attribute name="Main-Class" value="net.i2p.router.RouterLaunch" />
[d600a2d]609                <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" />
[7527a02]610                <attribute name="Built-By" value="${build.built-by}" />
611                <attribute name="Build-Date" value="${build.timestamp}" />
612                <attribute name="Base-Revision" value="${workspace.version}" />
[f5838ff]613            </manifest>
[d89f589f]614        </jar>
[7527a02]615        <!-- now the standalone launcher exe -->
[d89f589f]616        <launch4j configFile="./installer/i2pstandalone.xml" />
[7527a02]617        <!-- thazzit -->
[d89f589f]618    </target>
[18119890]619
[7527a02]620    <target name="launch4j">
621        <taskdef name="launch4j"
622                 classname="net.sf.launch4j.ant.Launch4jTask"
623                 classpath="${basedir}/installer/lib/launch4j/launch4j.jar:${basedir}/installer/lib/launch4j/lib/xstream.jar" />
624     </target>
625
[6a48910]626    <!-- end launch4j targets -->
627
[4407373]628     <!--
629          the files are now copied to the build directory
630          in the build* targets
631      -->
632     <target name="jar" depends="jarSmall" />
[78acf70]633     <target name="jarSmall" depends="builddepSmall" />
[18119890]634
[f191e50]635    <!-- Custom target to collect the jars that I2P-Bote needs to compile, so it can compile from source. -->
636    <target name="jarBote" depends="buildRouter, buildStreaming, buildJetty" >
[094cf14]637        <copy file="apps/susidns/src/lib/jstl.jar" todir="build/" />
638        <copy file="apps/susidns/src/lib/standard.jar" todir="build/" />
[f191e50]639    </target>
640
[6a48910]641    <!-- jbigi targets -->
642
[653ffbc]643    <target name="jbigi-list-changes" depends="checkForMtn" if="mtn.available">
[b03f7536]644        <exec executable="mtn" outputproperty="workspace.changes.jbigi" errorproperty="mtn.error.jbigi" failifexecutionfails="false" >
645            <arg value="list" />
646            <arg value="changed" />
647            <arg value="installer/lib/jbigi" />
648        </exec>
649        <!-- \n in an attribute value generates an invalid manifest -->
650        <exec executable="tr" inputstring="${workspace.changes.jbigi}" outputproperty="workspace.changes.jbigi.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
651            <arg value="-s" />
[f8a3afd]652            <arg value="&quot;[:space:]&quot;" />
[b03f7536]653            <arg value="," />
654        </exec>
655    </target>
656
[653ffbc]657    <target name="jbigi" depends="buildProperties, jbigi-list-changes">
[c5f04ee]658        <!-- set if unset -->
659        <property name="workspace.changes.jbigi.tr" value="" />
[8b1ab4b8]660        <mkdir dir="./build" />
[18119890]661        <jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
662            <fileset dir="installer/lib/jbigi" includes="*.so *.dll *.jnilib" />
[b03f7536]663            <manifest>
[cadedeb0]664                <attribute name="Built-By" value="${build.built-by}" />
[b03f7536]665                <attribute name="Build-Date" value="${build.timestamp}" />
666                <attribute name="Base-Revision" value="${workspace.version}" />
667                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
668            </manifest>
[18119890]669        </jar>
670    </target>
[e407c04]671
[653ffbc]672    <target name="jbigi-nowindows" depends="buildProperties, jbigi-list-changes">
[e407c04]673        <!-- set if unset -->
674        <property name="workspace.changes.jbigi.tr" value="" />
[a7870bb]675        <delete file="build/jbigi.jar" failonerror="false" quiet="true" />
[e407c04]676        <jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
677            <fileset dir="installer/lib/jbigi" includes="*.so *.jnilib" />
678            <manifest>
[cadedeb0]679                <attribute name="Built-By" value="${build.built-by}" />
[e407c04]680                <attribute name="Build-Date" value="${build.timestamp}" />
681                <attribute name="Base-Revision" value="${workspace.version}" />
682                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
683            </manifest>
684        </jar>
685    </target>
686
[a29fd1e]687    <!-- Now system-specific jbigis in alphabetical order -->
[653ffbc]688    <target name="jbigi-freebsd-only"  depends="buildProperties, jbigi-list-changes">
[c5f04ee]689        <!-- set if unset -->
690        <property name="workspace.changes.jbigi.tr" value="" />
[a29fd1e]691        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
[a8926da]692            <fileset dir="installer/lib/jbigi" includes="*bsd*.so" />
[b03f7536]693            <manifest>
[cadedeb0]694                <attribute name="Built-By" value="${build.built-by}" />
[b03f7536]695                <attribute name="Build-Date" value="${build.timestamp}" />
696                <attribute name="Base-Revision" value="${workspace.version}" />
697                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
698            </manifest>
[18119890]699        </jar>
700    </target>
701
[653ffbc]702    <target name="jbigi-linux-only"  depends="buildProperties, jbigi-list-changes">
[c5f04ee]703        <!-- set if unset -->
704        <property name="workspace.changes.jbigi.tr" value="" />
[18119890]705        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
706            <fileset dir="installer/lib/jbigi" includes="*linux*.so" />
[b03f7536]707            <manifest>
[cadedeb0]708                <attribute name="Built-By" value="${build.built-by}" />
[b03f7536]709                <attribute name="Build-Date" value="${build.timestamp}" />
710                <attribute name="Base-Revision" value="${workspace.version}" />
711                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
712            </manifest>
[18119890]713        </jar>
714    </target>
715
[653ffbc]716    <target name="jbigi-linux-x86-only"  depends="buildProperties, jbigi-list-changes">
717        <!-- set if unset -->
718        <property name="workspace.changes.jbigi.tr" value="" />
719        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
720            <fileset dir="installer/lib/jbigi" includes="*linux*.so" excludes="*linux-arm*.so,*linux-ppc*.so" />
721            <manifest>
722                <attribute name="Built-By" value="${build.built-by}" />
723                <attribute name="Build-Date" value="${build.timestamp}" />
724                <attribute name="Base-Revision" value="${workspace.version}" />
725                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
726            </manifest>
727        </jar>
728    </target>
729
730
731    <target name="jbigi-linux-nonx86-only"  depends="buildProperties, jbigi-list-changes">
[a29fd1e]732        <!-- set if unset -->
733        <property name="workspace.changes.jbigi.tr" value="" />
734        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
735            <fileset dir="installer/lib/jbigi" includes="*linux-arm*.so,*linux-ppc*.so" />
736            <manifest>
[cadedeb0]737                <attribute name="Built-By" value="${build.built-by}" />
[a29fd1e]738                <attribute name="Build-Date" value="${build.timestamp}" />
739                <attribute name="Base-Revision" value="${workspace.version}" />
740                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
741            </manifest>
742        </jar>
743    </target>
744
[3a70a5a6]745    <target name="jbigi-osx-only"  depends="buildProperties, jbigi-list-changes" >
746        <!-- set if unset -->
747        <property name="workspace.changes.jbigi.tr" value="" />
748        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
749            <fileset dir="installer/lib/jbigi" includes="*.jnilib" />
750            <manifest>
[cadedeb0]751                <attribute name="Built-By" value="${build.built-by}" />
[3a70a5a6]752                <attribute name="Build-Date" value="${build.timestamp}" />
753                <attribute name="Base-Revision" value="${workspace.version}" />
754                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
755            </manifest>
756        </jar>
757    </target>
758
[a29fd1e]759    <target name="jbigi-windows-only" depends="buildProperties, jbigi-list-changes" >
760        <!-- set if unset -->
761        <property name="workspace.changes.jbigi.tr" value="" />
[a7870bb]762        <delete file="build/jbigi.jar" failonerror="false" quiet="true" />
[a29fd1e]763        <jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
764            <fileset dir="installer/lib/jbigi" includes="*windows*.dll" />
765            <manifest>
[cadedeb0]766                <attribute name="Built-By" value="${build.built-by}" />
[a29fd1e]767                <attribute name="Build-Date" value="${build.timestamp}" />
768                <attribute name="Base-Revision" value="${workspace.version}" />
769                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
770            </manifest>
771        </jar>
772    </target>
[3a70a5a6]773
[6a48910]774    <!-- end jbigi targets -->
775
[79d8a0e]776    <target name="poupdate-source" depends="set-lg2-en, poupdate" />
777
778    <target name="set-lg2-en" >
779        <property name="lg2" value="en" />
780    </target>
781
[10f674a]782    <!-- the apps need to compile the jsps to poupdate -->
[17b781c1]783    <target name="poupdate" depends="buildRouter, buildStreaming, buildSystray, buildJetty, buildDesktopGui, buildJrobin" >
[5beb739]784        <echo message="Setting environment variable LG2 to a lang code (eg: de,zh,nl etc)" />
785        <echo message=" will restrict language update to the language you specified, leaving other language untact." />
[79d8a0e]786        <!-- set if unset -->
787        <property name="lg2" value="" />
[c1210b1]788        <ant dir="apps/routerconsole/java/" >
789            <target name="poupdate" />
790            <target name="poupdate-news" />
[3ec6028]791            <target name="poupdate-countries" />
[c1210b1]792        </ant>
[df7029d]793        <ant dir="apps/i2psnark/java/" target="poupdate" />
[71038c3]794        <ant dir="apps/i2ptunnel/java/" >
795            <target name="poupdate" />
796            <target name="poupdate-proxy" />
797        </ant>
[1436263]798        <ant dir="apps/susidns/src/" target="poupdate" />
[a5b5572]799        <ant dir="apps/susimail/" target="poupdate" />
[84d8683]800        <ant dir="apps/desktopgui" target="poupdate" />
[ba5be74]801        <ant dir="installer/resources/locale" target="poupdate" />
[c7c087d]802        <ant dir="apps/ministreaming/java" target="poupdate" />
[ba5be74]803    </target>
804
[7c00a51]805    <condition property="no.bundle">
806        <isfalse value="${require.gettext}" />
807    </condition>
808
809    <target name="prep-script-translation" unless="no.bundle" >
[9a241af]810        <!-- script translation added in 0.8.13, enabled in 0.9.5. -->
[ba5be74]811        <ant dir="installer/resources/locale" target="bundle" />
812        <copy todir="pkg-temp/locale/">
813            <fileset dir="installer/resources/locale/mo/" />
814        </copy>
[56e0c3e0]815    </target>
[c655d23]816
817    <target name="javadoc" depends="getReleaseNumber, getBuildNumber" >
[635b53c]818        <ant dir="apps/jetty" target="ensureJettylib" />
[77bd69c]819        <mkdir dir="./build" />
820        <mkdir dir="./build/javadoc" />
[370be48]821        <javadoc access="package"
[d00e3c7]822            source="${javac.version}"
[370be48]823            destdir="./build/javadoc"
824            packagenames="*"
825            use="true"
826            splitindex="true"
[49104134]827            failonerror="true"
[d8cc2a3]828            additionalparam="-notimestamp"
[51c73fa]829            doctitle="I2P Javadocs for Release ${release.number} Build ${i2p.build.number}${build.extra}"
[31ff9b2]830            windowtitle="I2P Anonymous Network - Java Documentation - Version ${release.number}">
[14ac8fe5]831            <group title="Core SDK (i2p.jar)" packages="net.i2p:net.i2p.*:net.i2p.client:net.i2p.client.*:net.i2p.internal:net.i2p.internal.*:freenet.support.CPUInformation:org.bouncycastle.oldcrypto:org.bouncycastle.oldcrypto.*:gnu.crypto.*:gnu.getopt:gnu.gettext:com.nettgryppa.security:org.apache.http.conn.ssl:org.apache.http.conn.util:org.apache.http.util:org.json.simple:org.json.simple.*:com.southernstorm.noise.crypto.x25519:com.southernstorm.noise.crypto.chacha20" />
[4dc1241d]832            <group title="Streaming Library" packages="net.i2p.client.streaming:net.i2p.client.streaming.impl" />
[f1297e7c]833            <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.*" />
[5d06de8]834            <group title="Router Console" packages="net.i2p.router.web:net.i2p.router.web.*:net.i2p.router.update:net.i2p.router.sybil:edu.internet2.ndt:net.i2p.router.news:com.vuze.*" />
[19fd865]835            <!-- apps and bridges starting here, alphabetical please -->
[f3d931d]836            <group title="Addressbook Application" packages="net.i2p.addressbook:net.i2p.router.naming:net.metanotion:net.metanotion.*" />
[895c9a33]837            <group title="BOB Bridge" packages="net.i2p.BOB" />
[482a63c]838            <group title="BOB Demos" packages="net.i2p.BOB.Demos.echo.echoclient:net.i2p.BOB.Demos.echo.echoserver" />
[95eabfa]839            <group title="Desktopgui Application" packages="net.i2p.desktopgui:net.i2p.desktopgui.*" />
[d4caafb5]840            <group title="I2PControl Application" packages="net.i2p.i2pcontrol:net.i2p.i2pcontrol.*:org.mindrot.jbcrypt:com.thetransactioncompany.jsonrpc2:com.thetransactioncompany.jsonrpc2.*" />
[796a231]841            <group title="I2PSnark Application" packages="org.klomp.snark:org.klomp.snark.*" />
[895c9a33]842            <group title="I2PTunnel Application" packages="net.i2p.i2ptunnel:net.i2p.i2ptunnel.*" />
[5004626]843            <group title="Imagegen Application" packages="com.docuverse.identicon:com.google.zxing:com.google.zxing.*:net.i2p.imagegen" />
[667393e]844            <group title="Installer Utilities" packages="net.i2p.installer" />
[c299976]845            <group title="Jetty Utilities" packages="net.i2p.jetty:net.i2p.servlet:net.i2p.servlet.*" />
[0439206]846            <group title="JRobin Library" packages="org.jrobin:org.jrobin.*:engine.misc" />
[c902d4c]847            <group title="SAM Bridge" packages="net.i2p.sam" />
[482a63c]848            <group title="SAM Demos" packages="net.i2p.sam.client" />
[fda6730]849            <group title="SusiDNS Application" packages="i2p.susi.dns:net.i2p.addressbook.servlet" />
[7f472e4e]850            <group title="SusiMail Application" packages="i2p.susi.webmail:i2p.susi.webmail.*:i2p.susi.debug:i2p.susi.util" />
[895c9a33]851            <group title="Systray Application" packages="net.i2p.apps.systray" />
[44c54ec]852            <sourcepath>
853                <pathelement location="core/java/src" />
854                <pathelement location="router/java/src" />
855                <pathelement location="apps/ministreaming/java/src" />
[0c51f2b]856                <pathelement location="apps/streaming/java/src" />
[44c54ec]857                <pathelement location="apps/i2ptunnel/java/src" />
858                <pathelement location="apps/systray/java/src" />
[84d8683]859                <pathelement location="apps/desktopgui/src" />
[44c54ec]860                <pathelement location="apps/routerconsole/java/src" />
[093c696]861                <pathelement location="apps/addressbook/java/src" />
862                <pathelement location="apps/i2psnark/java/src" />
863                <pathelement location="apps/sam/java/src" />
[bb32672]864                <pathelement location="apps/BOB/src" />
[482a63c]865                <pathelement location="apps/BOB/Demos/echo/echoclient/src" />
866                <pathelement location="apps/BOB/Demos/echo/echoserver/src" />
[895c9a33]867                <pathelement location="apps/susidns/src/java/src" />
868                <pathelement location="apps/susimail/src/src" />
[92b9d0a]869                <pathelement location="apps/jetty/java/src" />
[5004626]870                <pathelement location="apps/imagegen/imagegen/webapp/src/main/java" />
871                <pathelement location="apps/imagegen/identicon/core/src/main/java" />
872                <pathelement location="apps/imagegen/zxing/core/src/main/java" />
873                <pathelement location="apps/imagegen/zxing/javase/src/main/java" />
[78acf70]874                <pathelement location="apps/jrobin/java/src" />
[667393e]875                <pathelement location="installer/java/src" />
[d4caafb5]876                <pathelement location="apps/i2pcontrol/java" />
[44c54ec]877            </sourcepath>
878            <classpath>
[884a42b]879                <!-- warning, some entries are needed for Debian builds only -->
[44c54ec]880                <pathelement location="apps/jetty/jettylib/org.mortbay.jetty.jar" />
[b57d7c6]881                <pathelement location="apps/jetty/jettylib/jasper-runtime.jar" />
[e103f33]882                <pathelement location="apps/jetty/jettylib/javax.servlet.jar" />
[e174a46]883                <pathelement location="apps/jetty/jettylib/jetty-deploy.jar" />
[f59ea79]884                <pathelement location="apps/jetty/jettylib/jetty-http.jar" />
885                <pathelement location="apps/jetty/jettylib/jetty-security.jar" />
886                <pathelement location="apps/jetty/jettylib/jetty-servlet.jar" />
[884a42b]887                <pathelement location="apps/jetty/jettylib/jetty-servlets.jar" />
[92b9d0a]888                <pathelement location="apps/jetty/jettylib/jetty-start.jar" />
889                <pathelement location="apps/jetty/jettylib/jetty-util.jar" />
[f59ea79]890                <pathelement location="apps/jetty/jettylib/jetty-webapp.jar" />
891                <pathelement location="apps/jetty/jettylib/jetty-xml.jar" />
[884a42b]892                <pathelement location="apps/jetty/jettylib/tomcat-api.jar" />
[b2e8d3c]893                <pathelement location="installer/lib/wrapper/all/wrapper.jar" />
[bb468ad3]894                <!-- following are only for debian builds -->
895                <pathelement location="core/java/build/libintl.jar" />
896                <pathelement location="core/java/build/gnu-getopt.jar" />
[d263e42]897                <pathelement location="core/java/build/json-simple.jar" />
[44c54ec]898            </classpath>
[58512b8]899            <!-- These variables are stored in build.properties.
900                  End-users can override by creating the file override.properties -->
[255ccdc]901            <link offline="true" href="${javasedocs.url}" packagelistLoc="installer/resources/package-lists/java/" />
[667393e]902            <link offline="true" href="${javaeedocs.url}" packagelistLoc="installer/resources/package-lists/javaee/" />
[255ccdc]903            <link offline="true" href="${jettydocs.url}" packagelistLoc="installer/resources/package-lists/jetty/" />
904            <link offline="true" href="${wrapperdocs.url}" packagelistLoc="installer/resources/package-lists/wrapper/" />
[44c54ec]905        </javadoc>
[58512b8]906    </target>
[e2f048b]907
[58512b8]908    <target name="javadoc-zip" depends="javadoc">
909        <zip destfile="javadoc.zip" basedir="build" level="9" includes="javadoc\**" />
[482a63c]910    </target>
911
912    <target name="javadoc-test" depends="buildRouter, javadoc" >
913        <mkdir dir="./build" />
914        <mkdir dir="./build/javadoc-test" />
[a02f931]915
916        <!-- set junit home to the old default unless overridden elsewhere -->
917        <property name="junit.home" value="${ant.home}/lib/" />
[482a63c]918        <javadoc access="package"
919            destdir="./build/javadoc-test"
920            packagenames="*"
921            use="true"
922            splitindex="true"
[51c73fa]923            doctitle="I2P Unit Test Javadocs for Release ${release.number} Build ${i2p.build.number}${build.extra}"
[482a63c]924            windowtitle="I2P Anonymous Network - Java Documentation - Version ${release.number}">
[5ffefd2]925            <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.*" />
[e2588a5]926            <group title="Router" packages="net.i2p.router:net.i2p.router.*:net.i2p.data.i2np:org.cybergarage.*:org.freenetproject:org.xlattice.crypto.filters" />
[482a63c]927            <sourcepath>
[e1525d9]928                <pathelement location="core/java/test/junit" />
929                <pathelement location="router/java/test/junit" />
[a02f931]930                <pathelement location="core/java/test/scalatest" />
[482a63c]931            </sourcepath>
932            <classpath>
933                <pathelement location="build/i2p.jar" />
934                <pathelement location="build/router.jar" />
[598a177]935                <pathelement location="${junit.home}/junit4.jar" />
[0773a30]936                <pathelement location="${hamcrest.home}/hamcrest-all.jar" />
[482a63c]937            </classpath>
[58512b8]938            <!--
939                 These variables are stored in build.properties.
940                 End-users can override by creating the file override.properties
941            -->
[482a63c]942            <link offline="true" href="${javasedocs.url}" packagelistLoc="installer/resources/package-lists/java/" />
943            <link offline="true" href="${junitdocs.url}" packagelistLoc="installer/resources/package-lists/junit/" />
944            <link offline="true" href="${i2pdocs.url}" packagelistLoc="build/javadoc/" />
945        </javadoc>
946        <echo message="Warning, javadoc embeds timestamps in the output, run with 'TZ=UTC ant javadoc' if you plan to distribute" />
[77bd69c]947    </target>
[19fd865]948
[406bcbe]949    <target name="getReleaseNumber">
950        <loadfile srcfile="core/java/src/net/i2p/CoreVersion.java" property="release.number">
951            <filterchain>
952                <linecontains>
953                    <contains value="public final static String VERSION"/>
954                </linecontains>
955                <tokenfilter>
[16be8deb]956                    <replaceregex pattern='.*"([^"]+)";' replace="\1" flags="gi" />
[406bcbe]957                </tokenfilter>
[dfcf1c1]958                <striplinebreaks/>
[406bcbe]959                <trim/>
960            </filterchain>
961        </loadfile>
[256b0553]962        <property name="release.number" value="unknown" />
[c655d23]963        <echo message="Release number is ${release.number}" />
964    </target>
965
[406bcbe]966    <target name="getBuildNumber">
967        <loadfile srcfile="router/java/src/net/i2p/router/RouterVersion.java" property="i2p.build.number">
968            <filterchain>
969                <linecontains>
970                    <contains value="public final static long BUILD" />
971                </linecontains>
972                <tokenfilter>
[85fda3e]973                    <replaceregex pattern=".*=\s+([0-9]+);" replace="\1" flags="gi" />
[406bcbe]974                </tokenfilter>
975                <trim/>
[16be8deb]976                <striplinebreaks/>
[406bcbe]977            </filterchain>
978        </loadfile>
979        <loadfile srcfile="router/java/src/net/i2p/router/RouterVersion.java" property="build.extra">
980            <filterchain>
981                <linecontains>
982                    <contains value="public final static String EXTRA" />
983                </linecontains>
984                <tokenfilter>
[16be8deb]985                    <replaceregex pattern='.*"(.*)";' replace="\1" flags="gi" />
[406bcbe]986                </tokenfilter>
987                <trim/>
[16be8deb]988                <striplinebreaks/>
[406bcbe]989            </filterchain>
990        </loadfile>
[51c73fa]991        <property name="i2p.build.number" value="??" />
[256b0553]992        <property name="build.extra" value="" />
[51c73fa]993        <echo message="Build number is ${i2p.build.number}${build.extra}" />
[c655d23]994    </target>
995
[256b0553]996    <target name="verifyReleaseBuildNumbers" depends="getReleaseNumber, getBuildNumber" >
[cf41068]997        <echo message="SDK: ${java.vendor} ${java.version} (${java.runtime.name} ${java.runtime.version})" />
[256b0553]998        <fail message="Bad release number: ${release.number}" >
999            <condition>
1000                <or>
1001                    <equals arg1="${release.number}" arg2="unknown"/>
1002                    <equals arg1="${release.number}" arg2=""/>
1003                </or>
1004            </condition>
1005        </fail>
[51c73fa]1006        <fail message="Non-zero build number: ${i2p.build.number}" >
[256b0553]1007            <condition>
1008                <not>
[51c73fa]1009                    <equals arg1="${i2p.build.number}" arg2="0"/>
[256b0553]1010                </not>
1011            </condition>
1012        </fail>
1013        <fail message="Non-empty extra build: ${build.extra}" >
1014            <condition>
1015                <not>
1016                    <equals arg1="${build.extra}" arg2=""/>
1017                </not>
1018            </condition>
1019        </fail>
1020    </target>
1021
[34e3909]1022    <target name="-pre-sign">
1023            <!-- if you're distributing su3 files to others, at a minimum you should set these -->
[679fe9b]1024            <fail message="javac.compilerargs must contain a -bootclasspath option in override.properties">
1025                <condition>
1026                    <not><contains string="${javac.compilerargs}" substring="-bootclasspath"/></not>
1027                </condition>
1028            </fail>
[df0aceb]1029            <fail message="javac.compilerargs7 must contain a -bootclasspath option in override.properties">
1030                <condition>
1031                    <not><contains string="${javac.compilerargs7}" substring="-bootclasspath"/></not>
[679fe9b]1032                </condition>
1033            </fail>
1034            <fail message="build.built-by must be set in override.properties">
1035                <condition>
1036                    <equals arg1="${build.built-by}" arg2="unknown"/>
1037                </condition>
1038            </fail>
1039            <fail message="require.gettext must be true">
1040                <condition>
1041                    <not><equals arg1="${require.gettext}" arg2="true"/></not>
1042                </condition>
1043            </fail>
[34e3909]1044    </target>
1045
[6a48910]1046    <target name="-pre-release" depends="-pre-sign, failIfNoMtn">
[4f12e81]1047            <echo message="================================================================" />
1048            <echo message="Did you update these files?" />
1049            <exec executable="ls" failonerror="true">
1050                    <arg value="-l" />
1051                    <arg value="history.txt" />
1052                    <arg value="installer/install.xml" />
1053                    <arg value="core/java/src/net/i2p/CoreVersion.java" />
1054                    <arg value="router/java/src/net/i2p/router/RouterVersion.java" />
1055            </exec>
1056            <echo message="Everything is checked in, right? Let's be sure:" />
1057            <exec executable="mtn" failonerror="true">
1058                    <arg value="st" />
1059            </exec>
1060            <echo message="If there are any modified files above, stop now!" />
1061            <echo message="================================================================" />
1062            <sleep seconds="3"/>
1063    </target>
1064
[62d6709]1065    <target name="clean" depends="pkgclean" >
[77bd69c]1066        <delete dir="./build" />
[b7c10d2]1067        <delete dir="./reports" />
1068        <delete file="installer/lib/izpack/patches.jar" failonerror="false" quiet="true" />
[c96965d]1069        <delete file="syndie-standalone.zip" failonerror="false" quiet="true" />
[c287bace]1070        <delete file="i2psnark-standalone.zip" failonerror="false" quiet="true" />
[b7c10d2]1071        <delete file="BOB-one.jar" failonerror="false" quiet="true" />
[f788ef9]1072        <delete file="core/java/cobertura.ser"/>
[ab612d0]1073        <delete file="javadoc.zip" />
1074        <delete file="i2p.fba" />
1075        <delete file="${sloccount.report.file}" />
[9a91443]1076        <delete file="mavencentral-i2p.jar" />
[e744793]1077        <delete file="mavencentral-router.jar" />
[9a91443]1078        <delete file="mavencentral-mstreaming.jar" />
1079        <delete file="mavencentral-streaming.jar" />
[e390e67]1080        <delete file="mavencentral-servlet-i2p.jar" />
[f1e36f7]1081    </target>
[fcbee9d9]1082
[f1e36f7]1083    <target name="distclean" depends="clean">
[ab612d0]1084        <delete failonerror="false" quiet="true">
[58512b8]1085            <fileset dir="." includes="i2pinstall* *.deb i2p_*.bz2 i2pupdate* i2psource* *.sig *.torrent" />
[d64a2b0]1086        </delete>
[77bd69c]1087        <ant dir="core/java/" target="distclean" />
1088        <ant dir="router/java/" target="distclean" />
[4389f27]1089        <ant dir="installer/java" target="distclean" />
[77bd69c]1090        <ant dir="apps/ministreaming/java/" target="distclean" />
[0c51f2b]1091        <ant dir="apps/streaming/java/" target="distclean" />
[77bd69c]1092        <ant dir="apps/i2ptunnel/java/" target="distclean" />
[4d0b3b2]1093        <ant dir="apps/sam/java/" target="distclean" />
[bb32672]1094        <ant dir="apps/BOB" target="clean" />
[84d8683]1095        <ant dir="apps/desktopgui" target="clean" />
[bd78a66]1096        <ant dir="apps/routerconsole/java/" target="distclean" />
[099f6a8]1097        <ant dir="apps/addressbook/" target="distclean" />
[aa3a44c4]1098        <ant dir="apps/susimail/" target="distclean" />
[d89f589f]1099        <ant dir="apps/susidns/src/" target="distclean" />
[d70c22d7]1100        <ant dir="apps/systray/java/" target="distclean" />
[aa5f1cb]1101        <ant dir="apps/i2psnark/java/" target="distclean" />
[1e32170]1102        <ant dir="apps/jetty/" target="distclean" />
[b95f30b]1103        <ant dir="apps/imagegen/" target="distclean" />
[78acf70]1104        <ant dir="apps/jrobin/java" target="distclean" />
[b7c10d2]1105        <delete dir="core/c/jbigi/bin" />
1106        <delete dir="core/c/jbigi/lib" />
1107        <delete dir="core/c/jcpuid/lib" />
[ba5be74]1108        <ant dir="installer/resources/locale" target="distclean" />
[b95f30b]1109        <ant dir="installer/tools/java" target="distclean" />
[370be48]1110        <!--
[25fc649]1111                NOTE! We need to turn off the default excludes for these
[370be48]1112                patterns to work.
[25fc649]1113                These are the defaultexcludes in Ant as seen on
1114                http://ant.apache.org/manual/CoreTasks/defaultexcludes.html
1115                     **/*~
1116                     **/#*#
1117                     **/.#*
1118                     **/%*%
1119                     **/._*
1120                     **/CVS
1121                     **/CVS/**
1122                     **/.cvsignore
1123                     **/SCCS
1124                     **/SCCS/**
1125                     **/vssver.scc
1126                     **/.svn
1127                     **/.svn/**
1128                     **/.DS_Store
1129                The only recourse is to remove the offending ones.
1130                We do this here, as we only need one change, and then put it
1131                back after we are done with it.
1132        -->
1133        <defaultexcludes remove="**/*~"/>
1134
[eec29f5]1135        <delete>
[b97197c]1136            <fileset dir="." includes="**/*.class **/*.java~ **/*.txt~ **/*.xml~ **/*.sh~ **/*.SlackBuild~" />
[370be48]1137            <!--
[25fc649]1138                Less common, but they pollute my workspace here, so we
1139                might as well nuke these as well. Are there any others?
[0a1191a]1140
[25fc649]1141                !!??? Why don't we just nuke "**/*~" ???!!
1142
1143                ++Sponge
1144            -->
[eec29f5]1145        </delete>
[25fc649]1146        <!--
1147                Now we put the defaults back
1148        -->
1149        <defaultexcludes default="true"/>
[77bd69c]1150    </target>
[a821ea2]1151
[3024b3f]1152    <target name="webappDistclean">
1153        <ant dir="apps/i2ptunnel/java/" target="distclean" />
1154        <ant dir="apps/routerconsole/java/" target="distclean" />
1155        <ant dir="apps/addressbook/" target="distclean" />
1156        <ant dir="apps/susimail/" target="distclean" />
1157        <ant dir="apps/susidns/src/" target="distclean" />
1158        <ant dir="apps/i2psnark/java/" target="distclean" />
[b95f30b]1159        <ant dir="apps/imagegen/" target="distclean" />
[3024b3f]1160    </target>
1161
[24264548]1162    <target name="pkg" depends="distclean, updater, preppkg, installer" />
[a821ea2]1163
[18f113d]1164    <target name="pkg200" depends="distclean, updater200, preppkg, installer" />
1165
[06a3417]1166    <target name="pkgclean" depends="deletepkg-temp">
[3cf3636]1167        <delete>
[ac79049]1168            <fileset dir="." includes="i2p.tar.bz2 install.jar i2pupdate.zip i2pupdate200.zip" />
[3cf3636]1169        </delete>
1170    </target>
[a821ea2]1171
[a29fd1e]1172    <target name="preppkg" depends="preppkg-linux, preppkg-freebsd, preppkg-osx, preppkg-windows, jbigi">
[a821ea2]1173        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
[8c880b2]1174        <copy todir="pkg-temp/lib/wrapper/solaris/">
[047c668]1175            <fileset dir="installer/lib/wrapper/solaris/" excludes="*.txt" />
[8c880b2]1176        </copy>
[cdafab27]1177     <!-- Force using the new wrapper.jar.
1178          The new jar with the old windows binaries will output a warning on windows.
1179          We do not generate release files from this target.
1180          See preppkg-windows-only target below.
1181      -->
1182        <copy overwrite="true" file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
[8c880b2]1183    </target>
1184
[e407c04]1185    <target name="preppkg-nowindows" depends="preppkg-linux, preppkg-freebsd, preppkg-osx, jbigi-nowindows">
1186        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
1187        <copy todir="pkg-temp/lib/wrapper/solaris/">
[047c668]1188            <fileset dir="installer/lib/wrapper/solaris/" excludes="*.txt" />
[e407c04]1189        </copy>
[c4a05ec4]1190        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
[e407c04]1191    </target>
1192
[65504e8]1193    <target name="preppkgRepack" depends="preppkg-linux, preppkg-freebsd, preppkg-osx, preppkg-windows, jbigi">
1194        <ant target="repack200" />
1195        <!-- no use doing repack200 on jbigi.jar -->
1196        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
1197        <copy todir="pkg-temp/lib/wrapper/solaris/">
[047c668]1198            <fileset dir="installer/lib/wrapper/solaris/" excludes="*.txt" />
[65504e8]1199        </copy>
1200    </target>
1201
[a29fd1e]1202    <target name="preppkg-freebsd" depends="preppkg-unix">
1203        <copy todir="pkg-temp/lib/wrapper/freebsd/">
[047c668]1204            <fileset dir="installer/lib/wrapper/freebsd/" excludes="*.txt" />
[a821ea2]1205        </copy>
[a29fd1e]1206        <copy todir="pkg-temp/lib/wrapper/freebsd64/">
[047c668]1207            <fileset dir="installer/lib/wrapper/freebsd64" excludes="*.txt" />
[162c5bc]1208        </copy>
[a821ea2]1209    </target>
1210
[a29fd1e]1211    <target name="preppkg-freebsd-only" depends="preppkg-freebsd, jbigi-freebsd-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
[d608f45]1216    <!-- only what is needed for debian, etc. -->
[18119890]1217    <target name="preppkg-linux-only" depends="preppkg-linux, jbigi-linux-only" >
1218        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
[b03f7536]1219        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
[d608f45]1220    </target>
1221
[e2f048b]1222    <!-- This is the target called by debian/rules -->
[ba5be74]1223    <target name="preppkg-unix" depends="preppkg-base, prep-script-translation" >
[8c880b2]1224        <copy file="installer/resources/runplain.sh" todir="pkg-temp/" />
1225        <copy file="installer/resources/eepget" todir="pkg-temp/" />
1226        <copy file="installer/resources/i2prouter" todir="pkg-temp/" />
1227        <copy file="installer/resources/osid" todir="pkg-temp/" />
1228        <copy file="installer/resources/postinstall.sh" todir="pkg-temp/" />
[ff828e6]1229        <copy todir="pkg-temp/man/">
1230            <fileset dir="installer/resources/man/" />
1231        </copy>
[a29fd1e]1232    </target>
1233
[9c0c733]1234    <target name="preppkg-linux" depends="preppkg-linux-x86,preppkg-linux-nonx86" />
1235
1236    <target name="preppkg-linux-x86" depends="preppkg-unix">
[8c880b2]1237        <copy todir="pkg-temp/lib/wrapper/linux/">
[047c668]1238            <fileset dir="installer/lib/wrapper/linux/" excludes="*.txt" />
[8c880b2]1239        </copy>
1240        <copy todir="pkg-temp/lib/wrapper/linux64/">
[047c668]1241            <fileset dir="installer/lib/wrapper/linux64/" excludes="*.txt" />
[8c880b2]1242        </copy>
1243    </target>
1244
[9c0c733]1245    <target name="preppkg-linux-nonx86" depends="preppkg-unix">
[b435857]1246        <copy todir="pkg-temp/lib/wrapper/linux-ppc/">
1247            <fileset dir="installer/lib/wrapper/linux-ppc/" excludes="*.txt" />
[9c0c733]1248        </copy>
1249        <copy todir="pkg-temp/lib/wrapper/linux-armv5/">
[047c668]1250            <fileset dir="installer/lib/wrapper/linux-armv5/" excludes="*.txt" />
[9c0c733]1251        </copy>
[ec22a6ec]1252        <copy todir="pkg-temp/lib/wrapper/linux-armv6/">
1253            <fileset dir="installer/lib/wrapper/linux-armv6/" excludes="*.txt" />
1254        </copy>
[9c0c733]1255    </target>
1256
[a29fd1e]1257    <target name="preppkg-osx" depends="preppkg-unix">
[5a64a86]1258        <!--<copy file="installer/resources/I2P Router Console.webloc" todir="pkg-temp/" />-->
1259        <copy todir="pkg-temp/Start I2P Router.app">
1260            <fileset dir="installer/resources/Start I2P Router.app" />
1261        </copy>
[a29fd1e]1262        <copy todir="pkg-temp/lib/wrapper/macosx/">
[047c668]1263            <fileset dir="installer/lib/wrapper/macosx/" excludes="*.txt" />
[a29fd1e]1264        </copy>
[5056706]1265        <copy file="installer/resources/net.i2p.router.plist.template" todir="pkg-temp/" />
1266        <copy file="installer/resources/install_i2p_service_osx.command" todir="pkg-temp/" />
1267        <copy file="installer/resources/uninstall_i2p_service_osx.command" todir="pkg-temp/" />
[5a64a86]1268    </target>
1269
[a29fd1e]1270    <target name="preppkg-osx-only" depends="preppkg-osx, jbigi-osx-only" >
1271        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
[b7c10d2]1272        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
[a29fd1e]1273    </target>
[b7c10d2]1274
[ee138a2]1275    <target name="preppkg-windows" depends="preppkg-base, preplicenses-windows, buildUtilityJar, buildexe">
[6ebd1f1]1276        <copy file="build/i2p.exe" todir="pkg-temp/" failonerror="false" />
[a29fd1e]1277        <copy file="installer/resources/eepget.bat" todir="pkg-temp/" />
1278        <copy file="installer/resources/i2prouter.bat" todir="pkg-temp/" />
1279        <copy file="installer/resources/fixperms.bat" todir="pkg-temp/" />
1280        <copy file="installer/resources/install_i2p_service_winnt.bat" todir="pkg-temp/" />
1281        <copy file="installer/resources/set_config_dir_for_nt_service.bat" todir="pkg-temp/" />
1282        <copy file="installer/resources/uninstall_i2p_service_winnt.bat" todir="pkg-temp/" />
[44498ca8]1283        <copy file="build/utility.jar" todir="pkg-temp" />
[a29fd1e]1284        <copy todir="pkg-temp/lib/wrapper/win32/">
[047c668]1285            <fileset dir="installer/lib/wrapper/win32/" excludes="*.txt" />
[a29fd1e]1286        </copy>
[44498ca8]1287        <copy todir="pkg-temp/lib/wrapper/win64/">
1288            <fileset dir="installer/lib/wrapper/win64/" excludes="*.txt" />
[a29fd1e]1289        </copy>
1290    </target>
1291
1292    <target name="preppkg-windows-only" depends="preppkg-windows, jbigi-windows-only">
1293        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
[cdafab27]1294     <!-- Win binaries are down-rev from the others, so use the old jar.
1295          This will not overwrite, so preppkg (for all OSes) will get the new jar with
1296          the old binaries, which will probably work but will output a warning.
1297          The windows-only installer will get the correct jar.
[44498ca8]1298        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
[cdafab27]1299      -->
1300        <copy overwrite="true" file="installer/lib/wrapper/win-all/wrapper.jar" todir="pkg-temp/lib" />
[a29fd1e]1301    </target>
[b7c10d2]1302
[e2f048b]1303    <!-- see targets below for conditional copying -->
[9b17b52]1304    <target name="preppkg-base" depends="build, preplicenses, prepConsoleDocs, prepthemeupdates, prepCertificates, prepRouterInfos, copyjetty, copytomcat-unlesspkg, copyjstl-unlesspkg, copystandard-unlesspkg, copyflags-unlesspkg, truncatehistory">
[ac79049]1305        <!-- if updater200 was run previously, it left *.pack files in pkg-temp -->
[bf461ee]1306        <!-- Also remove deletelist.txt used for updater only -->
[ac79049]1307        <delete>
[bf461ee]1308            <fileset dir="pkg-temp" includes="**/*.jar.pack **/*.war.pack deletelist.txt" />
[ac79049]1309        </delete>
[3cf3636]1310        <copy file="build/i2p.jar" todir="pkg-temp/lib/" />
1311        <copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
1312        <copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
[0c51f2b]1313        <copy file="build/streaming.jar" todir="pkg-temp/lib/" />
[3cf3636]1314        <copy file="build/router.jar" todir="pkg-temp/lib/" />
[84d8683]1315        <copy file="build/desktopgui.jar" todir="pkg-temp/lib/" />
[3cf3636]1316        <copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
[78acf70]1317        <!-- Updated in 0.9.28; name without version so we can overwrite if we upgrade  -->
[ef26acc]1318        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
[3cf3636]1319        <copy file="build/sam.jar" todir="pkg-temp/lib/" />
[bb32672]1320        <copy file="build/BOB.jar" todir="pkg-temp/lib/" />
[d70c22d7]1321        <copy file="build/systray.jar" todir="pkg-temp/lib" />
[aa5f1cb]1322        <copy file="build/i2psnark.jar" todir="pkg-temp/lib/" />
[3cf3636]1323        <copy file="build/i2ptunnel.war" todir="pkg-temp/webapps/" />
1324        <copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
[fda6730]1325        <copy file="build/addressbook.jar" todir="pkg-temp/lib/" />
[aa3a44c4]1326        <copy file="build/susimail.war" todir="pkg-temp/webapps/" />
[d89f589f]1327        <copy file="build/susidns.war" todir="pkg-temp/webapps/" />
[5004626]1328        <copy file="build/imagegen.war" todir="pkg-temp/webapps/" />
[d4caafb5]1329        <copy file="build/jsonrpc.war" todir="pkg-temp/webapps/" />
[3ec92c8]1330        <copy file="build/i2psnark.war" todir="pkg-temp/webapps/" />
[b73b3fc]1331        <copy file="apps/i2psnark/i2psnark.config" todir="pkg-temp/" />
[f1fd352]1332        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
[62d6709]1333        <copy file="installer/resources/clients.config" todir="pkg-temp/" />
[c88c2450]1334        <copy file="installer/resources/i2ptunnel.config" todir="pkg-temp/" />
[58461ff]1335        <copy file="installer/resources/wrapper.config" todir="pkg-temp/" />
[1e32170]1336        <copy file="installer/resources/hosts.txt" todir="pkg-temp/" />
[0bc67f5a]1337        <copy file="INSTALL-headless.txt" todir="pkg-temp/" />
[382cbb1]1338        <mkdir dir="pkg-temp/scripts" />
1339        <copy file="apps/proxyscript/i2pProxy.pac" todir="pkg-temp/scripts/" />
[8bd99f6]1340        <copy file="installer/resources/startconsole.html" todir="pkg-temp/docs/" />
1341        <copy file="installer/resources/start.ico" todir="pkg-temp/docs/" />
1342        <copy file="installer/resources/console.ico" todir="pkg-temp/docs/" />
1343        <copy file="installer/resources/uninstall.ico" todir="pkg-temp/docs/" />
[6c25f0f]1344        <!-- Eepsite stuff here -->
[6eb7ecc]1345        <mkdir dir="pkg-temp/eepsite" />
[92b9d0a]1346        <copy todir="pkg-temp/eepsite/" >
[c9b6a3f0]1347            <fileset dir="installer/resources/eepsite/" excludes="**/.placeholder" />
[b8ab14b]1348        </copy>
[9b17b52]1349        <copy file="installer/resources/themes/console/images/favicon.ico" tofile="pkg-temp/eepsite/docroot/favicon.ico" />
1350    </target>
1351
1352    <target name="copyflags-unlesspkg" unless="${with-famfamfam-flag-png}" >
[b8ab14b]1353        <copy todir="pkg-temp/eepsite/docroot/help/lib/" >
[f2e00ca]1354            <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" />
[6c25f0f]1355        </copy>
[629eff2]1356        <copy todir="pkg-temp/docs/icons/flags" >
[baa11d8]1357          <!-- base flags/ dir only. flags16x11/ and flags48x48/ dirs already copied by prepConsoleDocs target -->
[629eff2]1358          <fileset dir="installer/resources/icons/flags" />
1359        </copy>
[06a3417]1360    </target>
[a821ea2]1361
[d6b1f81]1362    <target name="copyjetty" depends="copyjetty-unlesspkg" >
[d940aa5]1363        <copy file="build/jetty-i2p.jar" todir="pkg-temp/lib" />
[d6b1f81]1364    </target>
1365
[b72085bc]1366    <target name="copyjetty-unlesspkg" unless="${with-libjetty9-java}" >
[e2f048b]1367        <copy todir="pkg-temp/lib" >
[d6b1f81]1368            <fileset dir="build" includes="javax.servlet.jar jetty*.jar org.mortbay.*.jar" excludes="jetty-i2p.jar" />
[e2f048b]1369        </copy>
1370    </target>
1371
[11e8611]1372    <target name="settomcatprop" >
1373        <condition property="with-libtomcat-java" >
1374            <or>
1375                <istrue value="${with-libtomcat6-java}" />
1376                <istrue value="${with-libtomcat7-java}" />
1377                <istrue value="${with-libtomcat8-java}" />
[3527f25]1378                <istrue value="${with-libtomcat9-java}" />
[11e8611]1379            </or>
1380        </condition>
1381    </target>
1382
1383    <target name="copytomcat-unlesspkg" depends="settomcatprop" unless="${with-libtomcat-java}" >
[e2f048b]1384        <copy todir="pkg-temp/lib" >
1385            <fileset dir="build" includes="commons*.jar jasper*.jar javax*.jar" />
1386        </copy>
1387    </target>
1388
[1af23a4]1389    <!--
[a3a17a4f]1390       jstl.jar
1391       glassfish-javaee.jar has ancient and conflicting classes, e.g. javax.mail,
1392       and libjstl1.1-java isn't sufficient,
1393       so we only skip it with libtaglibs-standard
[1af23a4]1394    -->
[a3a17a4f]1395    <target name="copyjstl-unlesspkg" unless="${with-libtaglibs-standard}" >
[094cf14]1396        <copy file="apps/susidns/src/lib/jstl.jar" todir="pkg-temp/lib/" />
[e2f048b]1397    </target>
1398
[a3a17a4f]1399    <!-- standard.jar -->
1400    <target name="copystandard-unlesspkg" depends="copystandard-unlesspkg1, copystandard-unlesspkg2" />
1401    <target name="copystandard-unlesspkg1" >
1402        <condition property="with-any-standard-pkg" >
1403            <or>
1404                <istrue value="${with-libtaglibs-standard}" />
1405                <istrue value="${with-glassfish-javaee}" />
1406                <istrue value="${libjakarta-taglibs-standard-java}" />
1407            </or>
1408
1409        </condition>
1410    </target>
1411    <target name="copystandard-unlesspkg2" unless="${with-any-standard-pkg}" >
[094cf14]1412        <copy file="apps/susidns/src/lib/standard.jar" todir="pkg-temp/lib/" />
[e2f048b]1413    </target>
1414
[ee138a2]1415    <!-- does NOT include launch4j licenses for Windows builds -->
[e2f048b]1416    <target name="preplicenses" depends="preplicenses-unlesspkg" >
[6b0a2464]1417        <copy file="LICENSE.txt" todir="pkg-temp/" />
1418        <copy todir="pkg-temp/licenses/" >
1419          <fileset dir="licenses/" />
1420        </copy>
[ee138a2]1421        <copy file="apps/imagegen/identicon/README.md" tofile="pkg-temp/licenses/LICENSE-Identicon.txt" />
[70f9cb1]1422        <copy file="apps/desktopgui/LICENSE" tofile="pkg-temp/licenses/LICENSE-DesktopGUI.txt" />
[ee138a2]1423    </target>
1424
[11e8611]1425    <target name="preplicenses-unlesspkg" depends="settomcatprop" unless="${with-libtomcat-java}" >
[9ac3157]1426        <copy file="apps/jetty/apache-tomcat-${tomcat.ver}/NOTICE" tofile="pkg-temp/licenses/NOTICE-Tomcat.txt" />
[e2f048b]1427    </target>
[ee138a2]1428
1429    <!-- DOES include launch4j licenses for Windows builds -->
1430    <target name="preplicenses-windows" depends="preplicenses">
[7212f85]1431        <!--
1432              The license in launch4j/ is a BSD license for launch4j
1433              The license in launch4j/head is a MIT license for the code that is actually wrapped around the jars
1434              So we include the MIT one in our binary package
1435         -->
1436        <copy file="installer/lib/launch4j/head/LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-Launch4j.txt" />
1437        <!--  Not sure if these are used or should be included -->
[06a3417]1438        <copy file="installer/lib/launch4j/lib/foxtrot.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-Foxtrot.txt" />
1439        <copy file="installer/lib/launch4j/lib/JGoodies.Forms.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-JGoodies-Forms.txt" />
1440        <copy file="installer/lib/launch4j/lib/JGoodies.Looks.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-JGoodies-Looks.txt" />
1441        <copy file="installer/lib/launch4j/lib/XStream.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-XStream.txt" />
[3cf3636]1442    </target>
[106af99]1443
[5906fb7]1444    <target name="prepthemeupdates">
[106af99]1445        <copy todir="pkg-temp/docs/themes/" >
1446            <fileset dir="installer/resources/themes/" />
[e60e29b]1447        </copy>
[106af99]1448    </target>
1449
1450    <!-- SSL Certs -->
[4786081]1451    <target name="prepCertificates" depends="buildCore">
[106af99]1452        <copy todir="pkg-temp/certificates/" >
1453          <fileset dir="installer/resources/certificates/" />
[5c20574]1454        </copy>
[4786081]1455        <java classname="net.i2p.crypto.CertUtil" fork="true" failonerror="true">
1456            <classpath>
1457                <pathelement location="build/i2p.jar" />
1458            </classpath>
1459            <arg value="checkall" />
1460            <arg value="pkg-temp/certificates" />
1461        </java>
[5906fb7]1462    </target>
1463
[0c5c18a]1464    <condition property="no.bundle.routerInfos">
1465        <isfalse value="${bundle.routerInfos}" />
1466    </condition>
1467
[73256f6]1468    <target name="prepRouterInfos" depends="buildrouter, buildTools" unless="no.bundle.routerInfos">
[6dc3cd9]1469        <delete dir="pkg-temp/netDb" />
[0c5c18a]1470        <mkdir dir="pkg-temp/netDb" />
[d510aad]1471        <java classname="net.i2p.router.networkdb.kademlia.BundleRouterInfos" fork="true" failonerror="true">
[0c5c18a]1472            <classpath>
1473                <pathelement location="build/i2p.jar" />
[7ae1483]1474                <pathelement location="core/java/build/gnu-getopt.jar" />
[0c5c18a]1475                <pathelement location="build/router.jar" />
[73256f6]1476                <pathelement location="build/tools.jar" />
[0c5c18a]1477            </classpath>
1478            <arg value="-i" />
1479            <arg value="${bundle.routerInfos.i2pConfigDir}" />
1480            <arg value="-o" />
1481            <arg value="pkg-temp/netDb" />
1482            <arg value="-c" />
1483            <arg value="${bundle.routerInfos.count}" />
1484        </java>
1485    </target>
1486
[6dc3cd9]1487    <target name="-areRouterInfosEnabled">
1488        <fail message="Option requires &quot;bundle.routerInfos&quot; to be configured. Please read &quot;build.properties&quot; for more info." >
1489            <condition>
1490                <isfalse value="${bundle.routerInfos}" />
1491            </condition>
1492        </fail>
1493    </target>
1494
[9f3d5bf]1495    <target name="i2pseeds" depends="-setepoch, -areRouterInfosEnabled, prepRouterInfos">
[6dc3cd9]1496        <delete file="i2pseeds.zip" />
1497        <delete file="i2pseeds.su3" />
1498        <zip destfile="i2pseeds.zip" basedir="pkg-temp/netDb" whenempty="fail" />
[9f3d5bf]1499        <su3sign infile="i2pseeds.zip" sigtype="RESEED" outfile="i2pseeds.su3" su3.ver="${epoch}" />
[6dc3cd9]1500    </target>
1501
[ce50a9ca]1502    <!-- this is no longer required, izpack 4.3.0 supports headless installs with java -jar i2pinstall.exe -console -->
[b611d023]1503    <!-- and this is no longer used by the SlackBuild -->
[3cf3636]1504    <target name="tarball" depends="preppkg">
1505        <tar compression="bzip2" destfile="i2p.tar.bz2">
1506            <tarfileset dir="pkg-temp" includes="**/*" prefix="i2p" />
1507        </tar>
1508    </target>
[106af99]1509
[06a3417]1510    <target name="deletepkg-temp">
[9ae4fce]1511        <delete dir="pkg-temp" />
[9a91443]1512        <delete dir="./pkg-mavencentral" />
[06a3417]1513    </target>
[106af99]1514
[ec51ea6]1515    <!-- readme and proxy error page files, initialNews.xml files, GeoIP files, and flag icons -->
1516    <target name="prepConsoleDocs" depends="prepConsoleDocUpdates, prepgeoupdate" >
[f02a0d9]1517        <copy todir="pkg-temp/docs/initialNews/">
[ec51ea6]1518          <fileset dir="installer/resources/initialNews/" />
1519        </copy>
[73e25aa]1520        <!-- ensure the proxy files have the correct line endings -->
1521        <fixcrlf srcdir="pkg-temp/docs" includes="*.ht" encoding="utf8" eol="crlf" />
[ec51ea6]1522    </target>
[106af99]1523
1524    <!-- readme and proxy error page files -->
1525    <target name="prepConsoleDocUpdates">
[9ae4fce]1526        <copy todir="pkg-temp/docs/" >
[0e853a31]1527          <fileset dir="installer/resources/readme/" includes="readme*.html" />
[106af99]1528          <fileset dir="installer/resources/proxy/" includes="*.ht" />
[baa11d8]1529          <!--
1530               As of 0.9.36:
1531               All new and changed flags must go in the flags16x11/ dir,
1532               which will be checked first by flags.jsp.
1533               The flags/ dir is the original set from famfamfam,
1534               which may be symlinked in package installs.
1535           -->
1536          <fileset dir="installer/resources/" includes="icons/flags16x11/*" />
[da9c06e]1537          <!-- flags48x48 added in 0.9.32 -->
1538          <fileset dir="installer/resources/" includes="icons/flags48x48/*" />
[9ae4fce]1539        </copy>
1540    </target>
[106af99]1541
1542    <target name="consoleDocs" depends="deletepkg-temp, prepConsoleDocs">
[06a3417]1543        <zip destfile="docs.zip" basedir="pkg-temp" whenempty="fail" />
1544    </target>
[87fcaf2]1545
[ff828e6]1546    <target name="copyJavadoc" depends="javadoc">
1547        <copy todir="pkg-temp/docs/javadoc" >
1548          <fileset dir="build/javadoc/" />
1549        </copy>
1550    </target>
1551
[ac79049]1552    <target name="updater200" depends="prepupdate, preplicenses, pack200, zipit200" />
[2db086e]1553    <target name="updater200WithJetty" depends="prepjupdate, preplicenses, pack200, zipit200" />
[f592f22]1554    <target name="updater200WithJettyAndJbigi" depends="prepjupdate, prepjbigiupdate, preplicenses, pack200, zipit200" />
[41672dde]1555    <target name="updater200WithJettyAndGeoIP" depends="prepjupdate, prepgeoupdate, preplicenses, pack200, zipit200" />
[ac79049]1556    <target name="updater200WithJettyFixes" depends="prepjupdatefixes, preplicenses, pack200, zipit200" />
[19fd865]1557    <target name="updater200WithJettyFixesAndJbigi" depends="prepjupdatefixes, prepjbigiupdate, preplicenses, pack200, zipit200" />
[13d3730]1558    <target name="updater200WithJbigi" depends="prepupdate, prepjbigiupdate, preplicenses, pack200, zipit200" />
[06a3417]1559    <target name="updater" depends="prepupdate, preplicenses, zipit" />
[65504e8]1560    <target name="updaterRepack" depends="prepupdate, preplicenses, repack200, zipit" />
[ff828e6]1561    <target name="updaterWithJavadoc" depends="prepupdate, preplicenses, copyJavadoc, zipit" />
[0874b3e]1562    <target name="updater200WithJavadoc" depends="prepupdate, preplicenses, copyJavadoc, pack200, zipit200" />
[5376858]1563    <target name="updaterWithJavadocAndJetty" depends="prepjupdate, preplicenses, copyJavadoc, zipit" />
1564    <target name="updater200WithJavadocAndJetty" depends="prepjupdate, preplicenses, copyJavadoc, pack200, zipit200" />
[dcaa059]1565    <target name="updaterWithGeoIP" depends="prepupdate, prepgeoupdate, preplicenses, zipit" />
[06a3417]1566    <target name="updaterWithJetty" depends="prepjupdate, preplicenses, zipit" />
[65504e8]1567    <target name="updaterWithJettyRepack" depends="prepjupdate, preplicenses, repack200, zipit" />
[f592f22]1568    <target name="updaterWithJettyAndJbigiRepack" depends="prepjupdate, prepjbigiupdate, preplicenses, repack200, zipit" />
[41672dde]1569    <target name="updaterWithJettyAndGeoIPRepack" depends="prepjupdate, prepgeoupdate, preplicenses, repack200, zipit" />
[06a3417]1570    <target name="updaterWithJettyFixes" depends="prepjupdatefixes, preplicenses, zipit" />
[19fd865]1571    <target name="updaterWithJettyFixesAndJbigi" depends="prepjupdatefixes, prepjbigiupdate, preplicenses, zipit" />
[dcaa059]1572    <target name="updaterWithJettyFixesAndGeoIP" depends="prepjupdatefixes, prepgeoupdate, preplicenses, zipit" />
[13d3730]1573    <target name="updaterWithJbigi" depends="prepupdate, prepjbigiupdate, preplicenses, zipit" />
[3ba43a77]1574    <target name="updaterSmall" depends="prepupdateSmall, zipit" />
1575    <target name="updaterRouter" depends="prepupdateRouter, zipit" />
[c655d23]1576
[6dc3cd9]1577    <target name="-sign-update" depends="buildrouter">
[9f3d5bf]1578        <su3sign infile="i2pupdate200.zip" sigtype="ROUTER" outfile="i2pupdate.su3" su3.ver="${full.version}" />
[6dc3cd9]1579    </target>
1580
[34e3909]1581    <target name="signed-updater200" depends="-pre-sign, updater200, -sign-update" />
1582    <target name="signed-updater200WithJetty" depends="-pre-sign, updater200WithJetty, -sign-update" />
1583    <target name="signed-updater200WithJettyAndGeoIP" depends="-pre-sign, updater200WithJettyAndGeoIP, -sign-update" />
1584    <target name="signed-updater200WithJavadoc" depends="-pre-sign, updater200WithJavadoc, -sign-update" />
1585    <target name="signed-updater200WithJavadocAndJetty" depends="-pre-sign, updater200WithJavadocAndJetty, -sign-update" />
[6dc3cd9]1586
1587    <target name="zipit" depends="getReleaseNumber">
[c655d23]1588        <!--
1589             As of release 0.8.8, the router will enforce a zipfile comment equal to the
1590             version number in the sud/su2 header, since the version in the header is NOT
1591             covered by the signature.
1592         -->
1593        <zip destfile="i2pupdate.zip" basedir="pkg-temp" whenempty="fail" comment="${release.number}" />
[87fcaf2]1594       <!-- just a test, makes almost no difference
1595        <tar destfile="i2pupdate.tgz" basedir="pkg-temp" compression="gzip" />
1596        <tar destfile="i2pupdate.tbz" basedir="pkg-temp" compression="bzip2" />
1597       -->
1598    </target>
[c655d23]1599
1600    <target name="zipit200" depends="getReleaseNumber" >
1601        <zip destfile="i2pupdate200.zip" basedir="pkg-temp" whenempty="fail" comment="${release.number}" />
[ac79049]1602    </target>
[afb3c76]1603
[87fcaf2]1604    <target name="pack200">
[65504e8]1605        <!-- pack200 will only pack to a .pack file, and only from a .jar file, so we put another .jar on the end -->
[ccb8483]1606        <!-- can't pack an empty jar or one without classes, it will fail to unpack on Java 5;
1607          -  see http://bugs.sun.com/view_bug.do?bug_id=6712743
1608          -->
[65504e8]1609        <!-- *nix here -->
[ac79049]1610        <exec executable="sh" osfamily="unix" failonerror="true">
[afb3c76]1611            <arg value="-c" />
[fda6730]1612            <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" />
[afb3c76]1613        </exec>
[ac79049]1614        <exec executable="sh" osfamily="mac" failonerror="true">
[87fcaf2]1615            <arg value="-c" />
[fda6730]1616            <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" />
[87fcaf2]1617        </exec>
[65504e8]1618        <!-- windoz here : i admit, i hate escaped symbols in xml, indeed = =! -->
1619        <exec executable="cmd" osfamily="windows" failonerror="true">
1620            <arg value="/c" />
[ccb8483]1621            <!-- TODO implement fix above -->
[65504e8]1622            <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" />
1623        </exec>
1624        <exec executable="cmd" osfamily="windows" failonerror="true">
1625                <arg value="/c" />
1626                <arg value="for %i in (pkg-temp\lib\*.jar) do pack200 -g %i.pack %i &amp;&amp; del %i" />
1627        </exec>
1628    </target>
1629
1630    <!-- saves about 1% on average (more on jars with multiple compiled po files since they have lots of common strings) -->
1631    <target name="repack200">
1632        <!-- pack200 will only repack a .jar file, so we put another .jar on the end -->
1633        <!-- *nix here -->
1634        <exec executable="sh" osfamily="unix" failonerror="true">
1635            <arg value="-c" />
1636            <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" />
1637        </exec>
1638        <exec executable="sh" osfamily="mac" failonerror="true">
1639            <arg value="-c" />
1640            <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" />
1641        </exec>
1642        <!-- windoz here : i admit, i hate escaped symbols in xml, indeed = =! -->
1643        <exec executable="cmd" osfamily="windows" failonerror="true">
1644            <arg value="/c" />
1645            <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" />
[afb3c76]1646        </exec>
[65504e8]1647        <exec executable="cmd" osfamily="windows" failonerror="true">
1648                <arg value="/c" />
1649                <arg value="for %i in (pkg-temp\lib\*.jar) do pack200 -r %i" />
[afb3c76]1650        </exec>
[ffc67d1]1651    </target>
[87fcaf2]1652
[aeeee0e]1653    <target name="prepupdate" depends="build2, prepupdateSmall, prepConsoleDocUpdates, prepCertificates, prep-script-translation, truncatehistory">
[bb32672]1654        <copy file="build/BOB.jar" todir="pkg-temp/lib/" />
[2f72f5c]1655        <copy file="build/sam.jar" todir="pkg-temp/lib/" />
1656        <copy file="build/i2psnark.jar" todir="pkg-temp/lib" />
[fd4e57aa]1657        <!-- include systray changes in 0.7.5 -->
[daac598b]1658        <copy file="build/systray.jar" todir="pkg-temp/lib/" />
[70f9cb1]1659       <!-- removed from updater in 0.9, added back in 0.9.26 -->
[84d8683]1660        <copy file="build/desktopgui.jar" todir="pkg-temp/lib/" />
[2f72f5c]1661        <copy file="build/susimail.war" todir="pkg-temp/webapps/" />
1662        <copy file="build/susidns.war" todir="pkg-temp/webapps/" />
[5004626]1663        <copy file="build/imagegen.war" todir="pkg-temp/webapps/" />
[d4caafb5]1664        <copy file="build/jsonrpc.war" todir="pkg-temp/webapps/" />
[70f9cb1]1665        <!-- as of 0.7.12; last changed in 0.9; removed from update in 0.9.26 -->
1666      <!--
[094cf14]1667        <copy file="apps/susidns/src/lib/jstl.jar" todir="pkg-temp/lib/" />
1668        <copy file="apps/susidns/src/lib/standard.jar" todir="pkg-temp/lib/" />
[70f9cb1]1669       -->
[2f72f5c]1670        <copy file="build/i2psnark.war" todir="pkg-temp/webapps/" />
[aeeee0e]1671        <copy file="installer/resources/deletelist.txt" todir="pkg-temp/" />
1672        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
1673        <copy todir="pkg-temp/man/">
1674            <fileset dir="installer/resources/man/" />
1675        </copy>
1676    </target>
1677
1678    <target name="truncatehistory">
[2f72f5c]1679        <copy file="history.txt" todir="pkg-temp/" />
[deae0e8]1680        <!-- the following overwrites history.txt on unix to shrink the update file -->
[8998bde]1681        <copy file="history.txt" tofile="pkg-temp/history.txt" overwrite="true">
1682            <filterchain>
1683                <headfilter lines="1500" />
1684            </filterchain>
1685        </copy>
[aeeee0e]1686        <concat append="true" destfile="pkg-temp/history.txt">&#10;&#10;----------------&#10;&#10;EARLIER HISTORY IS AVAILABLE IN THE SOURCE PACKAGE</concat>
[2f72f5c]1687    </target>
[106af99]1688
[cbc9165]1689    <target name="prepupdateSmall" depends="buildSmall, prepupdateRouter, prepjupdatefixes, prepthemeupdates">
[44c54ec]1690        <copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
1691        <copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
[0c51f2b]1692        <copy file="build/streaming.jar" todir="pkg-temp/lib/" />
[44c54ec]1693        <copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
[78acf70]1694        <!-- Updated in 0.9.28 -->
[880f186]1695        <!-- name without version so we can overwrite if we upgrade  -->
[ef26acc]1696        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
[44c54ec]1697        <copy file="build/i2ptunnel.war" todir="pkg-temp/webapps/" />
1698        <copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
[fda6730]1699        <copy file="build/addressbook.jar" todir="pkg-temp/lib/" />
[099f6a8]1700        <copy file="build/addressbook.war" todir="pkg-temp/webapps/" />
[a0b4b7db]1701        <!-- decapitalized the file in 0.7.8 -->
[3daf287]1702        <copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
[1caf3e7]1703        <copy file="installer/resources/continents.txt" todir="pkg-temp/geoip/" />
[40c4a42]1704      <!--
1705        <copy file="installer/resources/public-suffix-list.txt" todir="pkg-temp/geoip/" />
1706       -->
[44c54ec]1707    </target>
[106af99]1708
[06a3417]1709    <target name="prepupdateRouter" depends="buildrouter, deletepkg-temp">
[ffc67d1]1710        <copy file="build/i2p.jar" todir="pkg-temp/lib/" />
1711        <copy file="build/router.jar" todir="pkg-temp/lib/" />
1712    </target>
[106af99]1713
[19fd865]1714    <!-- jbigi.jar -->
1715    <target name="prepjbigiupdate" depends="jbigi">
1716        <copy file="build/jbigi.jar" todir="pkg-temp/lib/" />
1717    </target>
1718
[169fd56]1719    <!-- GeoIP files -->
[e69f39f6]1720    <target name="prepgeoupdate" depends="prepgeoupdate-unlesspkg" >
[3ba43a77]1721        <copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
[1caf3e7]1722        <copy file="installer/resources/continents.txt" todir="pkg-temp/geoip/" />
[40c4a42]1723      <!--
1724        <copy file="installer/resources/public-suffix-list.txt" todir="pkg-temp/geoip/" />
1725       -->
[3ba43a77]1726    </target>
[106af99]1727
[e69f39f6]1728    <!-- GeoIP files, set withGeoIPDatabase=true in override.properties to prevent -->
1729    <!-- As of 0.9.26, the files are not included in Debian/Ubuntu builds. -->
1730    <target name="prepgeoupdate-unlesspkg" unless="${with-geoip-database}" >
[5c0c69c]1731        <mkdir dir="pkg-temp/geoip" />
1732      <!--
[e69f39f6]1733        <copy file="installer/resources/geoip.txt" todir="pkg-temp/geoip/" />
1734        <copy file="installer/resources/geoipv6.dat.gz" todir="pkg-temp/geoip/" />
[5c0c69c]1735       -->
1736        <gunzip src="installer/resources/GeoLite2-Country.mmdb.gz" dest="pkg-temp/geoip/GeoLite2-Country.mmdb" />
[e69f39f6]1737    </target>
[106af99]1738
[92b9d0a]1739    <!-- All jetty jars required for update.
1740         TODO do we need to bother updating jasper?
1741      -->
[a5c4ba3]1742    <target name="prepjupdate" depends="prepupdate, buildWEB">
[2083d8c6]1743        <copy todir="pkg-temp/lib" >
[4045785]1744            <fileset dir="build" includes="commons*.jar jasper*.jar javax*.jar jetty*.jar jsp*.jar org.mortbay.*.jar" />
[2083d8c6]1745        </copy>
[b5f97d0]1746        <!--  We have to package the new eepsite files for MigrateJetty.java, but we
1747              can't overwrite an existing eepsite dir in a non-split configuration.
1748          -->
[4e236fc]1749        <copy todir="pkg-temp/eepsite-jetty9" >
[33b25b57]1750            <fileset dir="installer/resources/eepsite" includes="*.xml contexts/* etc/*" />
[92b9d0a]1751        </copy>
[a5c4ba3]1752    </target>
[92b9d0a]1753
[ed92411]1754    <target name="delete-j6-update">
[4e236fc]1755        <delete dir="pkg-temp/eepsite-jetty9" />
[ed92411]1756    </target>
1757
[327f38b5]1758    <!-- Jetty 6 I2P logging addons, not really fixes -->
[cbc9165]1759    <target name="prepjupdatefixes" depends="buildWEB">
[327f38b5]1760        <copy file="build/jetty-i2p.jar" todir="pkg-temp/lib/" />
[89f0f09]1761    </target>
[c5f04ee]1762
1763    <target name="util-list-changes" depends="checkForMtn" if="mtn.available" >
[fd91927c]1764        <exec executable="mtn" outputproperty="workspace.changes.util" errorproperty="mtn.error.util" failifexecutionfails="false" >
1765            <arg value="list" />
1766            <arg value="changed" />
1767            <arg value="core/java/src/net/i2p/util" />
1768        </exec>
1769        <!-- \n in an attribute value generates an invalid manifest -->
1770        <exec executable="tr" inputstring="${workspace.changes.util}" outputproperty="workspace.changes.util.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
1771            <arg value="-s" />
1772            <arg value="[:space:]" />
1773            <arg value="," />
1774        </exec>
[c5f04ee]1775    </target>
1776
[fcbee9d9]1777    <target name="izpack-patches" >
[166e36a]1778            <taskdef name="izpack"
1779                     classpath="${basedir}/installer/lib/izpack/patches.jar:${basedir}/installer/lib/izpack/standalone-compiler.jar"
1780                     classname="com.izforge.izpack.ant.IzPackTask" />
[fcbee9d9]1781        <jar destfile="${basedir}/installer/lib/izpack/patches.jar"
1782             basedir="${basedir}/installer/lib/izpack/patches" />
1783    </target>
1784
[4389f27]1785    <target name="buildUtilityJar" depends="buildCore">
1786        <ant dir="installer/java" target="build" />
[3240dac]1787    </target>
1788
[307a68aa]1789    <!-- IzPack 4 -->
[4389f27]1790    <target name="installer" depends="preppkg, buildProperties, util-list-changes, izpack-patches, buildUtilityJar" >
[6e295a7a]1791        <izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
[307a68aa]1792        <ant target="installerexe" />
1793    </target>
[d89f589f]1794
[307a68aa]1795    <!-- IzPack 5 -->
1796    <target name="ensureIzpack5" >
1797        <!-- set if unset -->
1798        <property name="izpack5.home" value="${user.home}/IzPack" />
1799        <condition property="izpack5.available" >
1800            <available file="${izpack5.home}" type="dir" />
1801        </condition>
1802        <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" >
1803            <condition>
1804                <not>
1805                    <isset property="izpack5.available" />
1806                </not>
1807            </condition>
1808        </fail>
1809        <path id="izpack5.lib.path">
1810            <fileset dir="${izpack5.home}/lib" includes="*.jar"/>
1811        </path>
1812        <taskdef name="izpack5"
1813                 classpathref="izpack5.lib.path"
1814                 classname="com.izforge.izpack.ant.IzPackTask" />
1815    </target>
1816
1817    <target name="installer5" depends="ensureIzpack5, preppkg, buildProperties, util-list-changes, buildUtilityJar" >
1818        <izpack5 input="${basedir}/installer/install5.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
[21504f15]1819        <ant target="installer5exe" />
[d89f589f]1820    </target>
[fcbee9d9]1821
[21504f15]1822    <!-- This makes i2pinstall.exe from install.jar using the bundled launch4j.
1823         Warning: launch4j-created files CANNOT be Windows-signed.
1824         They will be corrupted.
1825      -->
[7527a02]1826    <target name="installerexe" depends="launch4j" unless="noExe">
[224405d7]1827        <echo message="See the file &quot;build.properties&quot; if this step fails." />
[91c9bfe]1828        <!-- now the installer exe -->
[d89f589f]1829        <launch4j configFile="./installer/i2pinstaller.xml" />
[91c9bfe]1830        <!-- thazzit -->
[6e295a7a]1831    </target>
[b208295]1832
[21504f15]1833    <!-- This makes i2pinstall.exe from install.jar using IzPack5's izpack2exe.py (not bundled)
1834         izpack2exe-created files CAN be Windows-signed.
1835      -->
1836    <target name="installer5exe" unless="noExe">
1837        <!-- You must have the optional IzPack utils installed for this -->
1838        <!-- izpack doesn't come with +x permission when installed -->
1839        <chmod type="file" file="${izpack5.home}/utils/wrappers/izpack2exe/7za" perm="+x" />
1840        <chmod type="file" file="${izpack5.home}/utils/wrappers/izpack2exe/izpack2exe.py" perm="+x" />
1841        <!--
1842             Note that we must specify the 7za path to use the one from IzPack, which is very old.
1843             Either 7zr (from Debian package p7zip) or 7za (from Debian package p7zip-full)
1844             will work, but ONLY if the 7za/7zr command line is changed in izpack2exe.py
1845             as follows, because their default is LZMA2, which dosn't work on Windows.
1846             So we don't want any Debian 7za picked up in the PATH.
1847             See /usr/share/doc/p7zip/DOC/MANUAL/cmdline/switches/method.htm
1848             old:
1849             p7zcmd = '"%s" a -mmt -t7z -mx=9 installer.7z "%s"' % (p7z, files)
1850             new:
1851             p7zcmd = '"%s" a -mmt -t7z -mx=9 -m0=LZMA installer.7z "%s"' % (p7z, files)
1852
1853             We also use IzPack's customized 7zS.sfx file, which uses a customized icon
1854             (but not our icon, sadly)
1855
1856             More info: https://izpack.atlassian.net/wiki/spaces/IZPACK/pages/491541/IzPack+Utilities
1857         -->
1858        <exec executable="${izpack5.home}/utils/wrappers/izpack2exe/izpack2exe.py" failonerror="true">
1859            <arg value="--file=${basedir}/install.jar" />
1860            <arg value="--with-7z=${izpack5.home}/utils/wrappers/izpack2exe/7za" />
1861            <arg value="--no-upx" />
1862            <arg value="--output=${basedir}/i2pinstall.exe" />
1863        </exec>
1864    </target>
1865
[a29fd1e]1866    <!-- Custom installers -->
[30fc954]1867    <!-- IzPack 4 -->
[6ebd1f1]1868    <target name="installer-nowindows" depends="clean, preppkg-nowindows, izpack-patches" >
[73e25aa]1869        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
[91c9bfe]1870        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}.jar" installerType="standard" basedir="${basedir}" />
[e407c04]1871    </target>
[a29fd1e]1872
[30fc954]1873    <!-- IzPack 5 -->
1874    <target name="installer5-nowindows" depends="ensureIzpack5, clean, preppkg-nowindows" >
1875        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1876        <izpack5 input="${basedir}/installer/install5.xml" output="${basedir}/i2pinstall_${full.version}.jar" installerType="standard" basedir="${basedir}" />
1877    </target>
1878
[a29fd1e]1879
[6ebd1f1]1880    <target name="installer-freebsd" depends="clean, preppkg-freebsd-only, izpack-patches" >
[73e25aa]1881        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
[91c9bfe]1882        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_freebsd-only.jar" installerType="standard" basedir="${basedir}" />
[a29fd1e]1883    </target>
1884
[30fc954]1885    <!-- IzPack 4 -->
[6ebd1f1]1886    <target name="installer-linux" depends="clean, preppkg-linux-only, izpack-patches" >
[73e25aa]1887        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
[91c9bfe]1888        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_linux-only.jar" installerType="standard" basedir="${basedir}" />
[a29fd1e]1889    </target>
1890
[30fc954]1891    <!-- IzPack 5 -->
1892    <target name="installer5-linux" depends="ensureIzpack5, clean, preppkg-linux-only" >
1893        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1894        <izpack5 input="${basedir}/installer/install5.xml" output="${basedir}/i2pinstall_${full.version}_linux-only.jar" installerType="standard" basedir="${basedir}" />
1895    </target>
1896
[a29fd1e]1897
[6ebd1f1]1898    <target name="installer-osx" depends="clean, checkForIzpack2App, preppkg-osx-only, izpack-patches">
[73e25aa]1899        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1900        <mkdir dir="pkg-temp/osx" />
1901        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_osx-only.jar" installerType="standard" basedir="${basedir}" />
1902        <ant target="installer2app" />
1903        <delete dir="pkg-temp/osx" />
[a29fd1e]1904    </target>
1905
1906    <target name="checkForIzpack2App">
[f3f4529]1907        <!-- we'll set the izpack2app binary name if it's not been set elsewhere yet -->
1908        <property name="izpack2app.binary" value="${user.home}/IzPack/utils/wrappers/izpack2app/izpack2app.py" />
1909        <available property="izpack2app.available" file="${izpack2app.binary}" />
[a29fd1e]1910    </target>
1911
1912    <target name="installer2app" if="izpack2app.available">
[f3f4529]1913        <mkdir dir="pkg-temp/osx" />
1914        <exec executable="python" failonerror="true">
1915            <arg value="${izpack2app.binary}" />
1916            <arg value="${basedir}/i2pinstall_${full.version}_osx-only.jar" />
1917            <arg value="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" />
1918        </exec>
1919
1920        <tar longfile="gnu" destfile="${basedir}/i2pinstall_${full.version}_osx.tar.bz2" compression="bzip2">
1921            <tarfileset dir="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" prefix="/i2p-${full.version}_osx-install.app" filemode="644">
1922                <include name="**/**" />
1923                <exclude name="Contents/MacOS/*" />
1924            </tarfileset>
1925            <tarfileset dir="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" prefix="/i2p-${full.version}_osx-install.app" filemode="755">
1926                <include name="Contents/MacOS/*" />
1927            </tarfileset>
1928        </tar>
[a29fd1e]1929    </target>
1930
[ed92411]1931    <!-- call between installer-xxx and installer-windows -->
1932    <target name="delete-nonwindows">
1933        <delete dir="pkg-temp/lib/wrapper/" />
1934        <delete dir="pkg-temp/locale/" />
1935        <delete dir="pkg-temp/man/" />
1936        <delete dir="pkg-temp/Start I2P Router.app/" />
1937        <delete dir="pkg-temp" includes="eepget i2prouter INSTALL-headless.txt osid postinstall.sh runplain.sh" />
1938    </target>
1939
[307a68aa]1940    <!-- IzPack 4 -->
[4389f27]1941    <target name="installer-windows" depends="clean, preppkg-windows-only, util-list-changes, izpack-patches, buildUtilityJar" >
[73e25aa]1942        <fixcrlf srcdir="pkg-temp" includes="*.config *.bat *.cmd **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="crlf"/>
1943        <izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
[6ebd1f1]1944        <ant target="installerexe" />
1945        <delete file="${basedir}/install.jar" />
[58512b8]1946        <move file="${basedir}/i2pinstall.exe" tofile="${basedir}/i2pinstall_${full.version}_windows.exe" />
[a29fd1e]1947    </target>
1948
[307a68aa]1949    <!-- IzPack 5 -->
1950    <target name="installer5-windows" depends="ensureIzpack5, clean, preppkg-windows-only, util-list-changes, buildUtilityJar" >
1951        <fixcrlf srcdir="pkg-temp" includes="*.config *.bat *.cmd **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="crlf"/>
1952        <izpack5 input="${basedir}/installer/install5.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
[21504f15]1953        <ant target="installer5exe" />
[307a68aa]1954        <delete file="${basedir}/install.jar" />
1955        <move file="${basedir}/i2pinstall.exe" tofile="${basedir}/i2pinstall_${full.version}_windows.exe" />
1956    </target>
1957
[ed92411]1958    <!-- this is broken as installer-xxx targets may delete (or not delete) things in pkg-temp -->
[6a103a1]1959    <target name="installer-all" depends="installer-freebsd, installer-linux, installer-osx, installer-windows, installer-nowindows, installer" >
[a29fd1e]1960    </target>
1961    <!-- end custom installers -->
[2654ada]1962
[8a32aad]1963    <!-- unit tests -->
[6cc39a2]1964    <target name="buildCoreTest">
[8a32aad]1965        <ant dir="core/java/" target="jarTest" />
[6cc39a2]1966    </target>
1967    <target name="buildRouterTest" depends="buildCoreTest">
[fcdf837]1968        <ant dir="router/java/" target="jarTest" />
[6cc39a2]1969    </target>
1970    <target name="buildTest" depends="buildRouterTest">
[fcdf837]1971        <copy file="core/java/build/i2ptest.jar" todir="build" />
1972        <copy file="router/java/build/routertest.jar" todir="build" />
[f85d0308]1973        <!-- broken -->
1974      <!--
1975        <ant dir="apps/ministreaming/java/" target="junit.compileTest" />
1976        <ant dir="apps/streaming/java/" target="junit.compileTest" />
1977       -->
[8a32aad]1978    </target>
[fcdf837]1979    <target name="prepTest" depends="prepupdate, buildTest">
1980        <!-- overwrite i2p.jar and router.jar with the test versions -->
1981        <copy file="build/i2ptest.jar" tofile="pkg-temp/lib/i2p.jar" overwrite="true" />
1982        <copy file="build/routertest.jar" tofile="pkg-temp/lib/router.jar" overwrite="true" />
[8a32aad]1983    </target>
[fcdf837]1984    <target name="updateTest" depends="prepTest, zipit" />
[e4ec046]1985    <target name="junit.test" depends="buildProperties, jbigi" >
1986        <ant dir="core/java/" target="junit.test" />
1987        <ant dir="router/java/" target="junit.test" />
[8d3fb0c]1988        <ant dir="apps/ministreaming/java/" target="junit.test" />
[10bf74e]1989        <ant dir="apps/streaming/java/" target="junit.test" />
[e4ec046]1990    </target>
1991    <target name="scalatest.test" depends="buildProperties, jbigi" >
1992        <ant dir="core/java/" target="scalatest.test" />
[fcdf837]1993        <!-- note there are no router scala tests yet -->
[e4ec046]1994        <ant dir="router/java/" target="scalatest.test" />
1995    </target>
[9f7ec39]1996    <!-- both junit and scala -->
1997    <target name="test" depends="testCore, testRouter, testMinistreaming, testStreaming" />
1998    <target name="testCore" depends="buildProperties, jbigi" >
[440cf2c]1999        <ant dir="core/java/" target="test" />
[9f7ec39]2000    </target>
2001    <target name="testRouter" depends="buildProperties, jbigi" >
[e4ec046]2002        <ant dir="router/java/" target="test" />
[9f7ec39]2003    </target>
2004    <target name="testMinistreaming" depends="buildProperties, jbigi" >
[8d3fb0c]2005        <ant dir="apps/ministreaming/java/" target="test" />
[9f7ec39]2006    </target>
2007    <target name="testStreaming" depends="buildProperties" >
[10bf74e]2008        <ant dir="apps/streaming/java/" target="test" />
[440cf2c]2009    </target>
[d6d1b51]2010    <target name="scalatest.report" depends="buildProperties" >
2011        <ant dir="core/java/" target="scalatest.report" />
2012        <ant dir="router/java/" target="scalatest.report" />
2013    </target>
[b208295]2014    <target name="junit.report" depends="buildProperties" >
[440cf2c]2015        <ant dir="core/java/" target="junit.report" />
[d6d1b51]2016        <ant dir="router/java/" target="junit.report" />
[8d3fb0c]2017        <ant dir="apps/ministreaming/java/" target="junit.report" />
[10bf74e]2018        <ant dir="apps/streaming/java/" target="junit.report" />
[440cf2c]2019    </target>
[c955adf]2020    <target name="clover.report" depends="buildProperties" if="with.clover">
[440cf2c]2021        <ant dir="core/java/" target="clover.report" />
[d6d1b51]2022        <ant dir="router/java/" target="clover.report" />
[8d3fb0c]2023        <ant dir="apps/ministreaming/java" target="clover.report" />
[b611d023]2024        <ant dir="apps/streaming/java" target="clover.report" />
[440cf2c]2025    </target>
[c955adf]2026    <target name="cobertura.report" depends="buildProperties" if="with.cobertura">
2027        <ant dir="core/java/" target="cobertura.report" />
[d6d1b51]2028        <ant dir="router/java/" target="cobertura.report" />
[8d3fb0c]2029        <ant dir="apps/ministreaming/java" target="cobertura.report" />
[b611d023]2030        <ant dir="apps/streaming/java" target="cobertura.report" />
[c955adf]2031    </target>
[d6d1b51]2032    <target name="test.report" depends="junit.report, scalatest.report, clover.report, cobertura.report"/>
2033    <target name="fulltest" depends="buildProperties, jbigi" >
2034        <ant dir="core/java/" target="fulltest" />
2035        <ant dir="router/java/" target="fulltest" />
[8d3fb0c]2036        <ant dir="apps/ministreaming/java" target="fulltest" />
[98d932a]2037        <ant dir="apps/streaming/java" target="fulltest" />
[440cf2c]2038    </target>
[e7d48f1]2039    <target name="jenkins.cobertura.report" depends="cobertura.report">
2040        <!--
2041             The jenkins cobertura plugin couldn't find the source files.
2042         -->
2043        <replaceregexp byline="true" file="reports/core/cobertura/coverage.xml"
2044            match='filename="net' replace='filename="core/java/src/net'/>
2045        <replaceregexp byline="true" file="reports/core/cobertura/coverage.xml"
2046            match="&lt;source&gt;./src" replace='&lt;source&gt;./core/java/src'/>
[98d932a]2047
[e7d48f1]2048        <replaceregexp byline="true" file="reports/router/cobertura/coverage.xml"
2049            match='filename="net' replace='filename="router/java/src/net'/>
2050        <replaceregexp byline="true" file="reports/router/cobertura/coverage.xml"
2051            match="&lt;source&gt;./src" replace="&lt;source&gt;router/java/src"/>
[98d932a]2052
[8d3fb0c]2053        <replaceregexp byline="true" file="reports/ministreaming/cobertura/coverage.xml"
2054            match='filename="net' replace='filename="apps/ministreaming/java/src/net'/>
2055        <replaceregexp byline="true" file="reports/ministreaming/cobertura/coverage.xml"
2056            match="&lt;source&gt;./src" replace="&lt;source&gt;apps/ministreaming/java/src"/>
2057
[10bf74e]2058        <replaceregexp byline="true" file="reports/streaming/cobertura/coverage.xml"
[98d932a]2059            match='filename="net' replace='filename="apps/streaming/java/src/net'/>
[10bf74e]2060        <replaceregexp byline="true" file="reports/streaming/cobertura/coverage.xml"
[98d932a]2061            match="&lt;source&gt;./src" replace="&lt;source&gt;apps/streaming/java/src"/>
[e7d48f1]2062    </target>
[8a32aad]2063    <!-- end unit tests -->
[b208295]2064
[0018ac0]2065    <target name="testscripts" >
2066        <exec executable="tests/scripts/checkcerts.sh" failonerror="true" />
2067        <exec executable="tests/scripts/checkpo.sh" failonerror="true" />
2068        <exec executable="tests/scripts/checkutf8.sh" failonerror="true" />
2069        <exec executable="tests/scripts/checkxml.sh" failonerror="true" />
[683ce32]2070        <exec executable="tests/scripts/checkscripts.sh" failonerror="true" />
[0018ac0]2071    </target>
2072
2073
[c161649]2074    <target name="testscripts-net" >
2075        <exec executable="tests/scripts/checkremotecerts.sh" failonerror="true" />
2076    </target>
2077
2078    <target name="testscripts-all" depends="testscripts,testscripts-net" />
2079
[3d24cc9]2080    <target name="bench" depends="jbigi" >
2081        <ant dir="core/java/" target="bench.jar" />
[49ed170]2082    </target>
2083
[313ee79b]2084    <!-- <target name="syndie" >
[c96965d]2085        <ant dir="apps/syndie/java/" target="standalone" />
2086        <copy file="apps/syndie/java/syndie-standalone.zip" todir="." />
[313ee79b]2087    </target> -->
[e27af37]2088
2089    <!-- standalone i2psnark zip -->
[4ee66c82]2090    <target name="i2psnark" depends="buildStreaming, buildJetty, buildSystray" >
[c287bace]2091        <ant dir="apps/i2psnark/java" target="standalone" />
2092        <copy file="apps/i2psnark/java/i2psnark-standalone.zip" todir="." />
2093    </target>
[e27af37]2094
[b6b1491]2095    <target name="slackpkg">
2096        <ant dir="Slackware/i2p/" target="slackpkg" />
2097    </target>
[cf10cb1c]2098    <target name="justBOB" depends="builddepSmall, jbigi">
[4f548b7]2099        <ant dir="apps/BOB/" target="onejar" />
2100        <copy file="apps/BOB/dist/BOB-one.jar" todir="." />
2101    </target>
[9eb25f6]2102
2103    <target name="sloccount.report">
[7fd59c4]2104        <property name="sloccount.report.file" value="sloccount.sc" />
2105        <echo message="Generating sloccount report (this will take awhile)" />
[9eb25f6]2106        <exec executable="sloccount" failonerror="true">
2107            <arg value="--details"/>
2108            <arg value="--wide"/>
[8998bde]2109            <arg value="${basedir}"/>
[7fd59c4]2110            <redirector output="${sloccount.report.file}">
[9eb25f6]2111                <outputfilterchain>
2112                    <linecontainsregexp negate="true">
[7fd59c4]2113                        <regexp pattern="(Warning: |lib/launch4j|_MTN|reports|pkg-temp|licenses|i2p\.fba|gmp-|WEB-INF)" />
[9eb25f6]2114                    </linecontainsregexp>
[8998bde]2115                    <linecontains negate="true">
2116                        <contains value="${sloccount.report.file}" />
2117                    </linecontains>
[9eb25f6]2118                </outputfilterchain>
2119            </redirector>
2120        </exec>
[7fd59c4]2121        <echo message="sloccount report saved to the file &quot;${sloccount.report.file}&quot;" />
[9eb25f6]2122    </target>
2123
[44498ca8]2124    <target name="findbugs" depends="build2, buildUtilityJar">
[bd6c63cc]2125        <echo message="Starting findbugs, this will take a while..." />
[1f92232]2126        <!-- ref: https://github.com/spotbugs/spotbugs/issues/148 -->
2127        <echo message="If this doesn't work with Java 9+. try Java 8" />
[a51ae64e]2128        <exec executable="nice" failonerror="true">
[bd6c63cc]2129            <arg value="findbugs"/>
2130            <arg value="-textui"/>
2131            <arg value="-projectName"/>
2132            <arg value="i2p"/>
2133            <arg value="-sortByClass"/>
2134            <arg value="-xml"/>
2135            <arg value="-output"/>
[2e51577f]2136            <arg value="i2p.fba"/>
[bd6c63cc]2137            <arg value="-auxclasspath"/>
[1f92232]2138            <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"/>
[bd6c63cc]2139            <arg value="-sourcepath"/>
[44498ca8]2140            <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"/>
[bd6c63cc]2141            <!-- start of the files to be analyzed -->
2142            <arg value="build/BOB.jar"/>
[1f9bb04]2143            <arg value="build/addressbook.jar"/>
[bd6c63cc]2144            <arg value="build/i2p.jar"/>
2145            <arg value="build/i2psnark.jar"/>
2146            <arg value="build/i2psnark.war"/>
2147            <arg value="build/i2ptunnel.jar"/>
2148            <arg value="build/i2ptunnel.war"/>
[5004626]2149            <arg value="build/imagegen.war"/>
[8845ce6]2150            <arg value="build/jetty-i2p.jar"/>
[d4caafb5]2151            <arg value="build/jsonrpc.war"/>
[bd6c63cc]2152            <arg value="build/mstreaming.jar"/>
2153            <arg value="build/router.jar/"/>
[84d8683]2154            <arg value="build/desktopgui.jar"/>
[2e51577f]2155            <arg value="build/routerconsole.jar"/>
2156            <arg value="build/routerconsole.war"/>
[bd6c63cc]2157            <arg value="build/sam.jar"/>
2158            <arg value="build/streaming.jar"/>
2159            <arg value="build/susidns.war"/>
2160            <arg value="build/susimail.war"/>
2161            <arg value="build/systray.jar"/>
[44498ca8]2162            <arg value="build/utility.jar"/>
[bd6c63cc]2163        </exec>
[2e51577f]2164        <echo message="Findbugs output stored in i2p.fba" />
2165        <echo message="Now run: findbugs i2p.fba" />
[bd6c63cc]2166    </target>
[ac79049]2167
2168    <!-- this is the same dependency as pkg, but with updater200 in the middle,
2169         since preppkg puts too much stuff in pkg-temp -->
[6b923c7]2170<!--
[21504f15]2171    <target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyAndJbigiRepack, updater200WithJettyAndJbigi, delete-j6-update, installer-nowindows, delete-nonwindows, installer5-windows">
2172    <target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyRepack, updater200WithJetty, delete-j6-update, installer-nowindows, delete-nonwindows, installer5-windows">
[5c0c69c]2173-->
[21504f15]2174    <target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyAndGeoIPRepack, updater200WithJettyAndGeoIP, delete-j6-update, installer-nowindows, delete-nonwindows, installer5-windows">
[960cd18]2175        <echo message="New version number is ${release.number}" />
[0bef852]2176        <copy file="i2pupdate.zip" tofile="i2pupdate_${release.number}.zip" />
[3240dac]2177        <copy file="i2pinstall_${full.version}.jar" tofile="i2pinstall_${release.number}.jar" />
[58512b8]2178        <copy file="i2pinstall_${full.version}_windows.exe" tofile="i2pinstall_${release.number}_windows.exe" />
[9483e09]2179        <!-- remove these, we don't build them anymore -->
[d0dca20]2180        <delete file="i2pupdate.sud" />
2181        <delete file="i2pupdate.su2" />
[9483e09]2182        <!-- make this a lot easier by putting release.privkey.su3=/path/to/su3keystore.ks in override.properties -->
[6dc3cd9]2183
[e004b0e]2184        <!-- now build and verify the packed su3 from the packed zip -->
[9f3d5bf]2185        <su3sign infile="i2pupdate200.zip" sigtype="ROUTER" outfile="i2pupdate.su3" su3.ver="${release.number}" />
[b611d023]2186        <!-- this will use the monotonerc file in the current workspace -->
[fdfbab8]2187        <echo message="Checking out fresh copy into ../i2p-${release.number} for tarballing:" />
[960cd18]2188        <delete dir="../i2p-${release.number}" />
[7efab75]2189        <exec executable="mtn" failonerror="true">
[0bef852]2190            <arg value="co" />
[7efab75]2191            <!-- w: is the revision of the current workspace -->
2192            <arg value="-r" />
2193            <arg value="w:" />
[0bef852]2194            <arg value="../i2p-${release.number}/" />
2195        </exec>
[7efab75]2196        <exec executable="tar" failonerror="true">
[0bef852]2197            <arg value="cjf" />
2198            <arg value="i2psource_${release.number}.tar.bz2" />
2199            <arg value="-C" />
2200            <arg value=".." />
2201            <arg value="--exclude" />
[960cd18]2202            <arg value="i2p-${release.number}/_MTN*" />
[0bef852]2203            <arg value="i2p-${release.number}/" />
2204        </exec>
2205        <echo message="Sign the files:" />
[cfdbef0]2206        <input message="Enter GPG key ID (e.g. 0x12345678) for signing:" addproperty="release.gpg.keyid" />
2207        <fail message="You must enter a key ID." >
2208            <condition>
2209                <equals arg1="${release.gpg.keyid}" arg2=""/>
2210            </condition>
2211        </fail>
[58512b8]2212
2213        <!-- the gpgsign macro sets the permission of signed files and the sigs themselves to 444 -->
[21504f15]2214      <!--
[58512b8]2215        <gpgsign file="i2pinstall_${release.number}_windows.exe" />
[21504f15]2216       -->
[58512b8]2217        <gpgsign file="i2pinstall_${release.number}.jar" />
2218        <gpgsign file="i2psource_${release.number}.tar.bz2" />
2219        <gpgsign file="i2pupdate_${release.number}.zip" />
2220
2221        <chmod perm="444" type="file">
2222            <fileset dir="${basedir}">
2223                <include name="i2pupdate.su3" />
2224            </fileset>
2225        </chmod>
[0bef852]2226        <echo message="File sizes:" />
[7efab75]2227        <exec executable="ls" failonerror="true">
[0bef852]2228            <arg value="-l" />
[21504f15]2229          <!--
[7a690b24]2230            <arg value="i2pinstall_${release.number}_windows.exe" />
[21504f15]2231           -->
[3240dac]2232            <arg value="i2pinstall_${release.number}.jar" />
[0bef852]2233            <arg value="i2psource_${release.number}.tar.bz2" />
2234            <arg value="i2pupdate_${release.number}.zip" />
[e004b0e]2235            <arg value="i2pupdate.su3" />
[21504f15]2236          <!--
[7a690b24]2237            <arg value="i2pinstall_${release.number}_windows.exe.sig" />
[21504f15]2238           -->
[3240dac]2239            <arg value="i2pinstall_${release.number}.jar.sig" />
[0bef852]2240            <arg value="i2psource_${release.number}.tar.bz2.sig" />
2241            <arg value="i2pupdate_${release.number}.zip.sig" />
2242        </exec>
[21504f15]2243        <echo message="   TBD    i2pinstall_${release.number}_windows.exe" />
2244        <echo message="   TBD    i2pinstall_${release.number}_windows.exe.sig" />
[0bef852]2245        <echo message="SHA256 sums:" />
[21504f15]2246      <!--
[58512b8]2247        <sha256sum file="i2pinstall_${release.number}_windows.exe" />
[21504f15]2248       -->
2249        <echo message="   TBD    i2pinstall_${release.number}_windows.exe" />
[58512b8]2250        <sha256sum file="i2pinstall_${release.number}.jar" />
2251        <sha256sum file="i2psource_${release.number}.tar.bz2" />
2252        <sha256sum file="i2pupdate_${release.number}.zip" />
2253        <sha256sum file="i2pupdate.su3" />
[efb986f]2254        <!-- make torrent files -->
[e004b0e]2255        <copy file="i2pupdate.su3" tofile="i2pupdate-${release.number}.su3" />
[58512b8]2256        <mktorrent file="i2pupdate-${release.number}.su3" />
[21504f15]2257        <echo message="Don't forget to sign i2pinstall_${release.number}_windows.exe on Windows and then:" />
2258        <echo message="    ${gpg} -u ${release.gpg.keyid} -b i2pinstall_${release.number}_windows.exe" />
2259        <echo message="    sha256sum i2pinstall_${release.number}_windows.exe" />
[fdfbab8]2260        <echo message="Don't forget to mtn tag w: i2p-${release.number}" />
[7efab75]2261        <echo message="... and mtn cert t:i2p-${release.number} branch i2p.i2p.release" />
[0bef852]2262    </target>
[ac79049]2263
[6cc39a2]2264    <!-- depends on buildCoreTest so that the router unit test javadocs can find the core unit test classes -->
2265    <target name="mavenCentral.deps" depends="buildRouter, buildStreaming, buildCoreTest">
[6a48910]2266        <ant dir="core/java/">
2267            <target name="javadocJar" />
2268            <target name="sourcesJar" />
2269        </ant>
2270        <ant dir="router/java/">
2271            <target name="javadocJar" />
2272            <target name="sourcesJar" />
2273        </ant>
2274        <ant dir="apps/ministreaming/java/">
2275            <target name="javadocJar" />
2276            <target name="sourcesJar" />
2277        </ant>
2278        <ant dir="apps/streaming/java/">
2279            <target name="javadocJar" />
2280            <target name="sourcesJar" />
2281        </ant>
2282        <ant dir="apps/jetty/">
2283            <target name="servletJar" />
2284            <target name="servletJavadocJar" />
2285            <target name="servletSourcesJar" />
2286        </ant>
[9a91443]2287    </target>
2288
2289    <target name="mavenCentral" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, mavenCentral.deps">
2290        <mkdir dir="./pkg-mavencentral" />
2291        <!-- Libraries -->
2292        <copy file="build/i2p.jar" tofile="pkg-mavencentral/i2p-${release.number}.jar" />
[e744793]2293        <copy file="build/router.jar" tofile="pkg-mavencentral/router-${release.number}.jar" />
[9a91443]2294        <copy file="build/mstreaming.jar" tofile="pkg-mavencentral/mstreaming-${release.number}.jar" />
2295        <copy file="build/streaming.jar" tofile="pkg-mavencentral/streaming-${release.number}.jar" />
[e390e67]2296        <copy file="apps/jetty/build/servlet-i2p-${release.number}.jar" todir="pkg-mavencentral/" />
[9a91443]2297        <!-- JavaDocs -->
2298        <copy file="core/java/build/i2p-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
[e744793]2299        <copy file="router/java/build/router-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
[9a91443]2300        <copy file="apps/ministreaming/java/build/mstreaming-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
2301        <copy file="apps/streaming/java/build/streaming-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
[e390e67]2302        <copy file="apps/jetty/build/servlet-i2p-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
[9a91443]2303        <!-- Sources -->
2304        <copy file="core/java/build/i2p-${release.number}-sources.jar" todir="pkg-mavencentral/" />
[e744793]2305        <copy file="router/java/build/router-${release.number}-sources.jar" todir="pkg-mavencentral/" />
[9a91443]2306        <copy file="apps/ministreaming/java/build/mstreaming-${release.number}-sources.jar" todir="pkg-mavencentral/" />
2307        <copy file="apps/streaming/java/build/streaming-${release.number}-sources.jar" todir="pkg-mavencentral/" />
[e390e67]2308        <copy file="apps/jetty/build/servlet-i2p-${release.number}-sources.jar" todir="pkg-mavencentral/" />
[6cc39a2]2309        <echo message="This requires the Maven Ant Tasks to be installed." />
2310        <echo message="If this fails, on Debian jessie or, Ubuntu trusty/xenial:" />
2311        <echo message="sudo apt-get install libmaven-ant-tasks-java" />
2312        <echo message="Sorry, not available on more recent distributions" />
[9a91443]2313        <!-- POMs -->
2314        <artifact:pom id="i2ppom" groupId="net.i2p" artifactId="i2p" version="${release.number}"
2315                name="I2P Core"
2316                description="The core I2P APIs"
2317                url="https://geti2p.net/">
2318            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
2319            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
2320            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/"/>
2321            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
2322                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
2323                 url="git@github.com:i2p/i2p.i2p.git" />
2324        </artifact:pom>
[e744793]2325        <artifact:pom id="routerpom" groupId="net.i2p" artifactId="router" version="${release.number}"
2326                name="I2P Router"
2327                description="The I2P router"
2328                url="https://geti2p.net/">
2329            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
2330            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
2331            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/"/>
2332            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
2333                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
2334                 url="git@github.com:i2p/i2p.i2p.git" />
2335            <dependency groupId="net.i2p" artifactId="i2p" version="${release.number}" />
2336        </artifact:pom>
[9a91443]2337        <artifact:pom id="mstreamingpom" groupId="net.i2p.client" artifactId="mstreaming" version="${release.number}"
2338                name="I2P Ministreaming"
2339                description="API, interfaces, and factory for a TCP-like set of sockets for communicating over I2P."
2340                url="https://geti2p.net/en/docs/api/streaming">
2341            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
2342            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
2343            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/" />
2344            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
2345                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
2346                 url="git@github.com:i2p/i2p.i2p.git" />
2347            <dependency groupId="net.i2p" artifactId="i2p" version="${release.number}" />
2348        </artifact:pom>
2349        <artifact:pom id="streamingpom" groupId="net.i2p.client" artifactId="streaming" version="${release.number}"
2350                name="I2P Streaming"
2351                description="Implementation of a TCP-like set of sockets for communicating over I2P."
2352                url="https://geti2p.net/en/docs/api/streaming">
2353            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
2354            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
2355            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/" />
2356            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
2357                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
2358                 url="git@github.com:i2p/i2p.i2p.git" />
2359            <dependency groupId="net.i2p" artifactId="i2p" version="${release.number}" />
2360            <dependency groupId="net.i2p.client" artifactId="mstreaming" version="${release.number}" />
2361        </artifact:pom>
[e390e67]2362        <artifact:pom id="servletpom" groupId="net.i2p" artifactId="servlet-i2p" version="${release.number}"
2363                name="I2P Servlet classes"
2364                description="Various servlet classes provided to plugins by Java I2P."
2365                url="https://geti2p.net/">
2366            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
2367            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
2368            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/" />
2369            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
2370                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
2371                 url="git@github.com:i2p/i2p.i2p.git" />
2372            <dependency groupId="net.i2p" artifactId="i2p" version="${release.number}" />
2373            <dependency groupId="org.apache.tomcat" artifactId="tomcat-servlet-api" version="8.0.33" />
2374        </artifact:pom>
[9a91443]2375        <artifact:writepom pomRefId="i2ppom" file="pkg-mavencentral/i2p-${release.number}.pom"/>
[e744793]2376        <artifact:writepom pomRefId="routerpom" file="pkg-mavencentral/router-${release.number}.pom"/>
[9a91443]2377        <artifact:writepom pomRefId="mstreamingpom" file="pkg-mavencentral/mstreaming-${release.number}.pom" />
2378        <artifact:writepom pomRefId="streamingpom" file="pkg-mavencentral/streaming-${release.number}.pom" />
[e390e67]2379        <artifact:writepom pomRefId="servletpom" file="pkg-mavencentral/servlet-i2p-${release.number}.pom" />
[9a91443]2380        <!-- Signatures -->
2381        <echo message="Sign the files:" />
2382        <input message="Enter GPG key ID (e.g. 0x12345678) for signing:" addproperty="release.gpg.keyid" />
2383        <fail message="You must enter a key ID." >
2384            <condition>
2385                <equals arg1="${release.gpg.keyid}" arg2=""/>
2386            </condition>
2387        </fail>
2388        <!-- the gpgsign macro sets the permission of signed files and the sigs themselves to 444 -->
2389        <gpgsignasc file="pkg-mavencentral/i2p-${release.number}.jar" />
2390        <gpgsignasc file="pkg-mavencentral/i2p-${release.number}.pom" />
2391        <gpgsignasc file="pkg-mavencentral/i2p-${release.number}-javadoc.jar" />
2392        <gpgsignasc file="pkg-mavencentral/i2p-${release.number}-sources.jar" />
[e744793]2393        <gpgsignasc file="pkg-mavencentral/router-${release.number}.jar" />
2394        <gpgsignasc file="pkg-mavencentral/router-${release.number}.pom" />
2395        <gpgsignasc file="pkg-mavencentral/router-${release.number}-javadoc.jar" />
2396        <gpgsignasc file="pkg-mavencentral/router-${release.number}-sources.jar" />
[9a91443]2397        <gpgsignasc file="pkg-mavencentral/mstreaming-${release.number}.jar" />
2398        <gpgsignasc file="pkg-mavencentral/mstreaming-${release.number}.pom" />
2399        <gpgsignasc file="pkg-mavencentral/mstreaming-${release.number}-javadoc.jar" />
2400        <gpgsignasc file="pkg-mavencentral/mstreaming-${release.number}-sources.jar" />
2401        <gpgsignasc file="pkg-mavencentral/streaming-${release.number}.jar" />
2402        <gpgsignasc file="pkg-mavencentral/streaming-${release.number}.pom" />
2403        <gpgsignasc file="pkg-mavencentral/streaming-${release.number}-javadoc.jar" />
2404        <gpgsignasc file="pkg-mavencentral/streaming-${release.number}-sources.jar" />
[e390e67]2405        <gpgsignasc file="pkg-mavencentral/servlet-i2p-${release.number}.jar" />
2406        <gpgsignasc file="pkg-mavencentral/servlet-i2p-${release.number}.pom" />
2407        <gpgsignasc file="pkg-mavencentral/servlet-i2p-${release.number}-javadoc.jar" />
2408        <gpgsignasc file="pkg-mavencentral/servlet-i2p-${release.number}-sources.jar" />
[9a91443]2409        <!-- Bundle -->
2410        <jar destfile="mavencentral-i2p.jar">
2411            <fileset dir="./pkg-mavencentral">
2412                <include name="i2p-*" />
2413            </fileset>
2414        </jar>
[e744793]2415        <jar destfile="mavencentral-router.jar">
2416            <fileset dir="./pkg-mavencentral">
2417                <include name="router-*" />
2418            </fileset>
2419        </jar>
[9a91443]2420        <jar destfile="mavencentral-mstreaming.jar">
2421            <fileset dir="./pkg-mavencentral">
2422                <include name="mstreaming-*" />
2423            </fileset>
2424        </jar>
2425        <jar destfile="mavencentral-streaming.jar">
2426            <fileset dir="./pkg-mavencentral">
2427                <include name="streaming-*" />
2428            </fileset>
2429        </jar>
[e390e67]2430        <jar destfile="mavencentral-servlet-i2p.jar">
2431            <fileset dir="./pkg-mavencentral">
2432                <include name="servlet-i2p-*" />
2433            </fileset>
2434        </jar>
[9a91443]2435        <echo message="Now upload mavencentral-*.jar to Maven Central." />
2436    </target>
2437
[3396626a]2438    <target name="debian" depends="debian-clean, debchange, debian-binary" />
[61c6242]2439    <target name="precise" depends="copy-precise, debian" />
2440    <target name="wheezy" depends="precise" />
2441    <target name="trusty" depends="copy-trusty, debian" />
2442    <target name="jessie" depends="trusty" />
2443    <target name="xenial" depends="copy-xenial, debian" />
2444    <target name="bionic" depends="copy-bionic, debian" />
2445    <target name="disco" depends="copy-disco, debian" />
2446    <target name="buster" depends="disco" />
2447
2448    <target name="copy-precise">
2449        <copy todir="debian" overwrite="true">
2450            <fileset dir="debian-alt/precise/" />
2451        </copy>
2452    </target>
2453    <target name="copy-trusty">
2454        <copy todir="debian" overwrite="true">
2455            <fileset dir="debian-alt/trusty/" />
2456        </copy>
2457    </target>
2458    <target name="copy-xenial">
2459        <copy todir="debian" overwrite="true">
2460            <fileset dir="debian-alt/xenial/" />
2461        </copy>
2462    </target>
2463    <target name="copy-bionic">
2464        <copy todir="debian" overwrite="true">
2465            <fileset dir="debian-alt/bionic/" />
2466        </copy>
2467    </target>
2468    <target name="copy-disco">
2469        <copy todir="debian" overwrite="true">
2470            <fileset dir="debian-alt/disco/" />
2471        </copy>
2472    </target>
[f1e36f7]2473
[3396626a]2474    <target name="getExtendedVersion" depends="buildProperties, trimMtnRev">
2475        <property name="MtnShortHash" value="unknown" />
2476        <condition property="Extended.Version" value="${full.version}-${MtnShortHash}">
2477            <not>
2478                <or>
2479                    <equals arg1="${MtnShortHash}" arg2="" />
2480                    <equals arg1="${MtnShortHash}" arg2="unknown" />
2481                </or>
2482            </not>
2483        </condition>
2484        <!-- if not set above we'll set it here -->
2485        <property name="Extended.Version" value="${full.version}" />
2486    </target>
2487
2488    <target name="debchange" depends="getExtendedVersion" unless="noAutoDebchange">
2489        <echo message= "Debian version is ${Extended.Version}-1" />
2490        <exec executable="dch" failonerror="true">
2491            <arg value="-b" />
2492            <arg value="--check-dirname-level" />
2493            <arg value="0" />
2494            <arg value="-v" />
2495            <arg value="${Extended.Version}-1" />
2496            <arg value="Unofficial Debian package built using &quot;ant debian&quot;" />
[84e4558]2497        </exec>
[3396626a]2498    </target>
[84e4558]2499
[3396626a]2500    <target name="debian-binary" depends="getExtendedVersion">
[84e4558]2501        <exec executable="fakeroot" failonerror="true">
2502            <arg value="debian/rules" />
2503            <arg value="patch" />
2504            <arg value="binary" />
2505            <arg value="clean" />
[b4524c6]2506        </exec>
[84e4558]2507        <delete dir=".pc" />
[3396626a]2508        <move todir=".">
[5dbe629]2509            <fileset dir=".." includes="libjbigi*${release.number}*.deb i2p*${release.number}*.deb" />
[3396626a]2510        </move>
2511        <echo message="" />
2512        <echo message="====================" />
2513        <echo message="Packages have been built and moved to ${basedir}" />
2514        <echo message="====================" />
[b6fab82]2515    </target>
[84e4558]2516
[3396626a]2517    <target name="debian-clean" depends="getExtendedVersion" >
[b6fab82]2518        <exec executable="fakeroot" failonerror="true">
[84e4558]2519            <arg value="debian/rules" />
2520            <arg value="clean" />
[b97197c]2521        </exec>
[84e4558]2522        <delete dir="./.pc" />
[b97197c]2523    </target>
[84e4558]2524
[6a48910]2525    <!-- stretch+, zesty+ -->
2526    <target name="debian-tarball" depends="getExtendedVersion, failIfNoMtn">
[b611d023]2527        <!-- this will use the monotonerc file in the current workspace -->
[3396626a]2528        <property name="debian.tarball.name" value="i2p_${Extended.Version}.orig.tar.bz2" />
2529        <echo message="Checking out fresh copy into ../i2p-${Extended.Version} for tarballing:" />
2530        <delete dir="../i2p-${Extended.Version}" />
2531        <exec executable="mtn" failonerror="true">
2532            <arg value="co" />
2533            <!-- w: is the revision of the current workspace -->
2534            <arg value="-r" />
2535            <arg value="w:" />
2536            <arg value="../i2p-${Extended.Version}" />
2537        </exec>
[ec6c244]2538        <delete includeemptydirs="true" quiet="false" failonerror="false">
[17b1d524]2539            <fileset dir="../i2p-${Extended.Version}/debian-alt/" />
[884a42b]2540            <fileset dir="../i2p-${Extended.Version}/installer/" includes="*.xml" />
2541            <fileset dir="../i2p-${Extended.Version}/installer/c/" />
2542            <fileset dir="../i2p-${Extended.Version}/installer/doc/" />
[3396626a]2543            <fileset dir="../i2p-${Extended.Version}/installer/lib/" />
[884a42b]2544            <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" />
2545            <fileset dir="../i2p-${Extended.Version}/installer/resources/Start I2P Router.app/" />
2546            <fileset dir="../i2p-${Extended.Version}/installer/resources/portable/" />
2547            <fileset dir="../i2p-${Extended.Version}/installer/resources/small/" />
[3396626a]2548            <fileset dir="../i2p-${Extended.Version}/Slackware" />
2549            <fileset dir="../i2p-${Extended.Version}/_MTN" />
[6c56d67]2550            <fileset dir="../i2p-${Extended.Version}/.idea" />
2551            <fileset dir="../i2p-${Extended.Version}/.tx" />
2552            <file name="../i2p-${Extended.Version}/.mtn-ignore" />
2553            <fileset dir="../i2p-${Extended.Version}/" includes="Docker*" />
2554            <file name="../i2p-${Extended.Version}/Makefile.gcj" />
[884a42b]2555            <fileset dir="../i2p-${Extended.Version}/docs" />
2556            <fileset dir="../i2p-${Extended.Version}/launchers" />
2557            <file name="../i2p-${Extended.Version}/.travis.yml" />
2558            <file name="../i2p-${Extended.Version}/.gitignore" />
[6c56d67]2559            <!-- gradle files -->
2560            <fileset dir="../i2p-${Extended.Version}/" includes="**/build.gradle" />
2561            <fileset dir="../i2p-${Extended.Version}/gradle" />
[884a42b]2562            <file name="../i2p-${Extended.Version}/gradlew" />
[6c56d67]2563            <file name="../i2p-${Extended.Version}/gradlew.bat" />
2564            <file name="../i2p-${Extended.Version}/gradle.properties" />
2565            <file name="../i2p-${Extended.Version}/settings.gradle" />
[f2239ba]2566            <!-- gettext-base -->
2567            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/gettext" />
[2e15488]2568            <!-- libgetopt-java -->
[c3f5c04]2569            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/getopt" />
[d263e42]2570            <!-- libjson-simple-java -->
2571            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/json" />
[2fe1f97]2572            <!-- libhttpclient-java and libhttpcore-java -->
[1754240]2573          <!--
[2fe1f97]2574            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/apache/http" />
[1754240]2575           -->
[094cf14]2576            <!-- geoip-database -->
[e2f048b]2577            <file name="../i2p-${Extended.Version}/installer/resources/geoip.txt" />
2578            <file name="../i2p-${Extended.Version}/installer/resources/geoipv6.dat.gz" />
[5c0c69c]2579            <file name="../i2p-${Extended.Version}/installer/resources/GeoLite2-Country.mmdb.gz" />
[b72085bc]2580            <!-- libjetty9-java -->
[9ac3157]2581            <fileset dir="../i2p-${Extended.Version}/apps/jetty/jetty-distribution-${jetty.ver}" />
[d28220c]2582            <!-- libtomcat8-java -->
[9ac3157]2583            <fileset dir="../i2p-${Extended.Version}/apps/jetty/apache-tomcat-${tomcat.ver}" />
[a3a17a4f]2584            <!-- libjstl1.1-java or glassfish-javaee or libtaglibs-standard -->
[094cf14]2585            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/jstl.jar" />
[a3a17a4f]2586            <!-- libjakarta-taglibs-standard-java or glassfish-javaee or libtaglibs-standard -->
[094cf14]2587            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/standard.jar" />
[9b17b52]2588            <fileset dir="../i2p-${Extended.Version}/installer/resources/icons/flags" />
[e2f048b]2589            <!-- anything added above, add in debian-release-tarball also -->
[3396626a]2590        </delete>
2591        <tar longfile="gnu" destfile="../${debian.tarball.name}" compression="bzip2">
2592            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${Extended.Version}">
2593                <include name=