source: build.xml @ 318ebb3

Last change on this file since 318ebb3 was 4786081, checked in by zzz <zzz@…>, 18 months ago

Build: Check cert validity
Reseed updates

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