source: build.xml @ d8cc2a3

Last change on this file since d8cc2a3 was d8cc2a3, checked in by zzz <zzz@…>, 2 years ago

Debian: Add build option for reproducible builds;
remove timestamp from manifests and javadocs (ticket #2279)

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