source: build.xml @ d28220c

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

Tomcat 8.5.23
Prior to Jetty 9, we used the Tomcat 6 distribution.
As of Jetty 9, we used Tomcat 8.0.33 that was included in the Jetty 9 distribution,
but that is old and doesn't get updated.
Now use the latest Tomcat 8 distribution, and pick the same packages
as Jetty 9 did in their distribution.

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