source: build.xml @ 25d16b13

Last change on this file since 25d16b13 was c299976, checked in by zzz <zzz@…>, 3 years ago

Jetty: Refactor (rather than remove) RequestWrapper? to use Servlet 3.0 API.
Remove old org.mortbay helper classes copied from Jetty 5, saving about 24 KB.
Large attachments will now be written to temp files. (ticket #2109)

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