source: build.xml @ 9ac3157

Last change on this file since 9ac3157 was 9ac3157, checked in by zzz <zzz@…>, 22 months ago

Build: Move Jetty/Tomcat? version properties to top-level build.xml

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