source: build.xml @ a3a17a4f

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

Debian: Replace glassfish-javaee with libtaglibs-standard-* (ticket #2093)
Only for stretch and later, zesty and later
Copy more files for previous stretch setup to xenial

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