source: build.xml @ a8bacd8

Last change on this file since a8bacd8 was 5c0c69c, checked in by zzz <zzz@…>, 20 months ago

GeoIP: Add MaxMind? GeoLite2-Country database 2018113, gzipped
Database and Contents Copyright © 2018 MaxMind?, Inc.
This work is licensed under the Creative Commons Attribution-ShareAlike? 4.0 International License.
To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/.
This database incorporates GeoNames? http://www.geonames.org geographical data,
which is made available under the Creative Commons Attribution 3.0 License.
To view a copy of this license, visit http://www.creativecommons.org/licenses/by/3.0/us/.

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