source: build.xml @ 97267a4

Last change on this file since 97267a4 was 8f4f7b7b, checked in by str4d <str4d@…>, 3 years ago

propagate from branch 'i2p.i2p.str4d.bench' (head 61fcef0f1004c55f7b15ba3982173050a952a08c)

to branch 'i2p.i2p' (head 8374318b8b49df7f47dfa0d2653413ceccab9b52)

Core: New benchmarking framework based on JMH (ticket #2036)

  • Property mode set to 100644
File size: 132.1 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    </target>
1245
1246    <target name="copyjetty" depends="copyjetty-unlesspkg" >
1247        <copy file="build/jetty-i2p.jar" todir="pkg-temp/lib" />
1248    </target>
1249
1250    <target name="copyjetty-unlesspkg" unless="${with-libjetty9-java}" >
1251        <copy todir="pkg-temp/lib" >
1252            <fileset dir="build" includes="javax.servlet.jar jetty*.jar org.mortbay.*.jar" excludes="jetty-i2p.jar" />
1253        </copy>
1254    </target>
1255
1256    <target name="settomcatprop" >
1257        <condition property="with-libtomcat-java" >
1258            <or>
1259                <istrue value="${with-libtomcat6-java}" />
1260                <istrue value="${with-libtomcat7-java}" />
1261                <istrue value="${with-libtomcat8-java}" />
1262            </or>
1263        </condition>
1264    </target>
1265
1266    <target name="copytomcat-unlesspkg" depends="settomcatprop" unless="${with-libtomcat-java}" >
1267        <copy todir="pkg-temp/lib" >
1268            <fileset dir="build" includes="commons*.jar jasper*.jar javax*.jar" />
1269        </copy>
1270    </target>
1271
1272    <!-- todo handle alt package too -->
1273    <!--
1274       glassfish-javaee.jar has ancient and conflicting classes, e.g. javax.mail
1275    <target name="copyjstl-unlesspkg" unless="${with-glassfish-javaee}" >
1276    -->
1277    <target name="copyjstl-unlesspkg" >
1278        <copy file="apps/susidns/src/lib/jstl.jar" todir="pkg-temp/lib/" />
1279    </target>
1280
1281    <!-- todo handle alt package too -->
1282    <target name="copystandard-unlesspkg" unless="${with-glassfish-javaee}" >
1283        <copy file="apps/susidns/src/lib/standard.jar" todir="pkg-temp/lib/" />
1284    </target>
1285
1286    <!-- does NOT include launch4j licenses for Windows builds -->
1287    <target name="preplicenses" depends="preplicenses-unlesspkg" >
1288        <copy file="LICENSE.txt" todir="pkg-temp/" />
1289        <copy todir="pkg-temp/licenses/" >
1290          <fileset dir="licenses/" />
1291        </copy>
1292        <copy file="apps/imagegen/identicon/README.md" tofile="pkg-temp/licenses/LICENSE-Identicon.txt" />
1293        <copy file="apps/desktopgui/LICENSE" tofile="pkg-temp/licenses/LICENSE-DesktopGUI.txt" />
1294    </target>
1295
1296    <target name="preplicenses-unlesspkg" depends="settomcatprop" unless="${with-libtomcat-java}" >
1297<!--  replacement?
1298        <copy file="apps/jetty/apache-tomcat-deployer/NOTICE" tofile="pkg-temp/licenses/NOTICE-Tomcat.txt" />
1299-->
1300    </target>
1301
1302    <!-- DOES include launch4j licenses for Windows builds -->
1303    <target name="preplicenses-windows" depends="preplicenses">
1304        <!--
1305              The license in launch4j/ is a BSD license for launch4j
1306              The license in launch4j/head is a MIT license for the code that is actually wrapped around the jars
1307              So we include the MIT one in our binary package
1308         -->
1309        <copy file="installer/lib/launch4j/head/LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-Launch4j.txt" />
1310        <!--  Not sure if these are used or should be included -->
1311        <copy file="installer/lib/launch4j/lib/foxtrot.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-Foxtrot.txt" />
1312        <copy file="installer/lib/launch4j/lib/JGoodies.Forms.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-JGoodies-Forms.txt" />
1313        <copy file="installer/lib/launch4j/lib/JGoodies.Looks.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-JGoodies-Looks.txt" />
1314        <copy file="installer/lib/launch4j/lib/XStream.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-XStream.txt" />
1315    </target>
1316
1317    <target name="prepthemeupdates">
1318        <copy todir="pkg-temp/docs/themes/" >
1319            <fileset dir="installer/resources/themes/" />
1320        </copy>
1321    </target>
1322
1323    <!-- SSL Certs -->
1324    <target name="prepCertificates">
1325        <copy todir="pkg-temp/certificates/" >
1326          <fileset dir="installer/resources/certificates/" />
1327        </copy>
1328    </target>
1329
1330    <condition property="no.bundle.routerInfos">
1331        <isfalse value="${bundle.routerInfos}" />
1332    </condition>
1333
1334    <target name="prepRouterInfos" depends="buildrouter, buildTools" unless="no.bundle.routerInfos">
1335        <delete dir="pkg-temp/netDb" />
1336        <mkdir dir="pkg-temp/netDb" />
1337        <java classname="net.i2p.router.networkdb.kademlia.BundleRouterInfos" fork="true" failonerror="true">
1338            <classpath>
1339                <pathelement location="build/i2p.jar" />
1340                <pathelement location="core/java/build/gnu-getopt.jar" />
1341                <pathelement location="build/router.jar" />
1342                <pathelement location="build/tools.jar" />
1343            </classpath>
1344            <arg value="-i" />
1345            <arg value="${bundle.routerInfos.i2pConfigDir}" />
1346            <arg value="-o" />
1347            <arg value="pkg-temp/netDb" />
1348            <arg value="-c" />
1349            <arg value="${bundle.routerInfos.count}" />
1350        </java>
1351    </target>
1352
1353    <target name="-areRouterInfosEnabled">
1354        <fail message="Option requires &quot;bundle.routerInfos&quot; to be configured. Please read &quot;build.properties&quot; for more info." >
1355            <condition>
1356                <isfalse value="${bundle.routerInfos}" />
1357            </condition>
1358        </fail>
1359    </target>
1360
1361    <target name="i2pseeds" depends="-setepoch, -areRouterInfosEnabled, prepRouterInfos">
1362        <delete file="i2pseeds.zip" />
1363        <delete file="i2pseeds.su3" />
1364        <zip destfile="i2pseeds.zip" basedir="pkg-temp/netDb" whenempty="fail" />
1365        <su3sign infile="i2pseeds.zip" sigtype="RESEED" outfile="i2pseeds.su3" su3.ver="${epoch}" />
1366    </target>
1367
1368    <!-- this is no longer required, izpack 4.3.0 supports headless installs with java -jar i2pinstall.exe -console -->
1369    <!-- and this is no longer used by the SlackBuild -->
1370    <target name="tarball" depends="preppkg">
1371        <tar compression="bzip2" destfile="i2p.tar.bz2">
1372            <tarfileset dir="pkg-temp" includes="**/*" prefix="i2p" />
1373        </tar>
1374    </target>
1375
1376    <target name="deletepkg-temp">
1377        <delete dir="pkg-temp" />
1378        <delete dir="./pkg-mavencentral" />
1379    </target>
1380
1381    <!-- readme and proxy error page files, initialNews.xml files, GeoIP files, and flag icons -->
1382    <target name="prepConsoleDocs" depends="prepConsoleDocUpdates, prepgeoupdate" >
1383        <copy todir="pkg-temp/docs/initialNews/">
1384          <fileset dir="installer/resources/initialNews/" />
1385        </copy>
1386        <!-- ensure the proxy files have the correct line endings -->
1387        <fixcrlf srcdir="pkg-temp/docs" includes="*.ht" encoding="utf8" eol="crlf" />
1388    </target>
1389
1390    <!-- readme and proxy error page files -->
1391    <target name="prepConsoleDocUpdates">
1392        <copy todir="pkg-temp/docs/" >
1393          <fileset dir="installer/resources/readme/" includes="readme*.html" />
1394          <fileset dir="installer/resources/proxy/" includes="*.ht" />
1395          <!-- 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;
1396               im.png added in 0.8.12; cw.png added in 0.9.5; ap,bl,bq,ss,sx added in 0.9.21;
1397               lang_gl added in 0.9.28; a0.png added in 0.9.31 -->
1398          <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" />
1399        </copy>
1400    </target>
1401
1402    <target name="consoleDocs" depends="deletepkg-temp, prepConsoleDocs">
1403        <zip destfile="docs.zip" basedir="pkg-temp" whenempty="fail" />
1404    </target>
1405
1406    <target name="copyJavadoc" depends="javadoc">
1407        <copy todir="pkg-temp/docs/javadoc" >
1408          <fileset dir="build/javadoc/" />
1409        </copy>
1410    </target>
1411
1412    <target name="updater200" depends="prepupdate, preplicenses, pack200, zipit200" />
1413    <target name="updater200WithJetty" depends="prepjupdate, preplicenses, pack200, zipit200" />
1414    <target name="updater200WithJettyAndJbigi" depends="prepjupdate, prepjbigiupdate, preplicenses, pack200, zipit200" />
1415    <target name="updater200WithJettyAndGeoIP" depends="prepjupdate, prepgeoupdate, preplicenses, pack200, zipit200" />
1416    <target name="updater200WithJettyFixes" depends="prepjupdatefixes, preplicenses, pack200, zipit200" />
1417    <target name="updater200WithJettyFixesAndJbigi" depends="prepjupdatefixes, prepjbigiupdate, preplicenses, pack200, zipit200" />
1418    <target name="updater200WithJbigi" depends="prepupdate, prepjbigiupdate, preplicenses, pack200, zipit200" />
1419    <target name="updater" depends="prepupdate, preplicenses, zipit" />
1420    <target name="updaterRepack" depends="prepupdate, preplicenses, repack200, zipit" />
1421    <target name="updaterWithJavadoc" depends="prepupdate, preplicenses, copyJavadoc, zipit" />
1422    <target name="updater200WithJavadoc" depends="prepupdate, preplicenses, copyJavadoc, pack200, zipit200" />
1423    <target name="updaterWithJavadocAndJetty" depends="prepjupdate, preplicenses, copyJavadoc, zipit" />
1424    <target name="updater200WithJavadocAndJetty" depends="prepjupdate, preplicenses, copyJavadoc, pack200, zipit200" />
1425    <target name="updaterWithGeoIP" depends="prepupdate, prepgeoupdate, preplicenses, zipit" />
1426    <target name="updaterWithJetty" depends="prepjupdate, preplicenses, zipit" />
1427    <target name="updaterWithJettyRepack" depends="prepjupdate, preplicenses, repack200, zipit" />
1428    <target name="updaterWithJettyAndJbigiRepack" depends="prepjupdate, prepjbigiupdate, preplicenses, repack200, zipit" />
1429    <target name="updaterWithJettyAndGeoIPRepack" depends="prepjupdate, prepgeoupdate, preplicenses, repack200, zipit" />
1430    <target name="updaterWithJettyFixes" depends="prepjupdatefixes, preplicenses, zipit" />
1431    <target name="updaterWithJettyFixesAndJbigi" depends="prepjupdatefixes, prepjbigiupdate, preplicenses, zipit" />
1432    <target name="updaterWithJettyFixesAndGeoIP" depends="prepjupdatefixes, prepgeoupdate, preplicenses, zipit" />
1433    <target name="updaterWithJbigi" depends="prepupdate, prepjbigiupdate, preplicenses, zipit" />
1434    <target name="updaterSmall" depends="prepupdateSmall, zipit" />
1435    <target name="updaterRouter" depends="prepupdateRouter, zipit" />
1436
1437    <target name="-sign-update" depends="buildrouter">
1438        <su3sign infile="i2pupdate200.zip" sigtype="ROUTER" outfile="i2pupdate.su3" su3.ver="${full.version}" />
1439    </target>
1440
1441    <target name="signed-updater200" depends="-pre-sign, updater200, -sign-update" />
1442    <target name="signed-updater200WithJetty" depends="-pre-sign, updater200WithJetty, -sign-update" />
1443    <target name="signed-updater200WithJettyAndGeoIP" depends="-pre-sign, updater200WithJettyAndGeoIP, -sign-update" />
1444    <target name="signed-updater200WithJavadoc" depends="-pre-sign, updater200WithJavadoc, -sign-update" />
1445    <target name="signed-updater200WithJavadocAndJetty" depends="-pre-sign, updater200WithJavadocAndJetty, -sign-update" />
1446
1447    <target name="zipit" depends="getReleaseNumber">
1448        <!--
1449             As of release 0.8.8, the router will enforce a zipfile comment equal to the
1450             version number in the sud/su2 header, since the version in the header is NOT
1451             covered by the signature.
1452         -->
1453        <zip destfile="i2pupdate.zip" basedir="pkg-temp" whenempty="fail" comment="${release.number}" />
1454       <!-- just a test, makes almost no difference
1455        <tar destfile="i2pupdate.tgz" basedir="pkg-temp" compression="gzip" />
1456        <tar destfile="i2pupdate.tbz" basedir="pkg-temp" compression="bzip2" />
1457       -->
1458    </target>
1459
1460    <target name="zipit200" depends="getReleaseNumber" >
1461        <zip destfile="i2pupdate200.zip" basedir="pkg-temp" whenempty="fail" comment="${release.number}" />
1462    </target>
1463
1464    <target name="pack200">
1465        <!-- pack200 will only pack to a .pack file, and only from a .jar file, so we put another .jar on the end -->
1466        <!-- can't pack an empty jar or one without classes, it will fail to unpack on Java 5;
1467          -  see http://bugs.sun.com/view_bug.do?bug_id=6712743
1468          -->
1469        <!-- *nix here -->
1470        <exec executable="sh" osfamily="unix" failonerror="true">
1471            <arg value="-c" />
1472            <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" />
1473        </exec>
1474        <exec executable="sh" osfamily="mac" failonerror="true">
1475            <arg value="-c" />
1476            <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" />
1477        </exec>
1478        <!-- windoz here : i admit, i hate escaped symbols in xml, indeed = =! -->
1479        <exec executable="cmd" osfamily="windows" failonerror="true">
1480            <arg value="/c" />
1481            <!-- TODO implement fix above -->
1482            <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" />
1483        </exec>
1484        <exec executable="cmd" osfamily="windows" failonerror="true">
1485                <arg value="/c" />
1486                <arg value="for %i in (pkg-temp\lib\*.jar) do pack200 -g %i.pack %i &amp;&amp; del %i" />
1487        </exec>
1488    </target>
1489
1490    <!-- saves about 1% on average (more on jars with multiple compiled po files since they have lots of common strings) -->
1491    <target name="repack200">
1492        <!-- pack200 will only repack a .jar file, so we put another .jar on the end -->
1493        <!-- *nix here -->
1494        <exec executable="sh" osfamily="unix" failonerror="true">
1495            <arg value="-c" />
1496            <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" />
1497        </exec>
1498        <exec executable="sh" osfamily="mac" failonerror="true">
1499            <arg value="-c" />
1500            <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" />
1501        </exec>
1502        <!-- windoz here : i admit, i hate escaped symbols in xml, indeed = =! -->
1503        <exec executable="cmd" osfamily="windows" failonerror="true">
1504            <arg value="/c" />
1505            <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" />
1506        </exec>
1507        <exec executable="cmd" osfamily="windows" failonerror="true">
1508                <arg value="/c" />
1509                <arg value="for %i in (pkg-temp\lib\*.jar) do pack200 -r %i" />
1510        </exec>
1511    </target>
1512
1513    <target name="prepupdate" depends="build2, prepupdateSmall, prepConsoleDocUpdates, prepCertificates, prep-script-translation, truncatehistory">
1514        <copy file="build/BOB.jar" todir="pkg-temp/lib/" />
1515        <copy file="build/sam.jar" todir="pkg-temp/lib/" />
1516        <copy file="build/i2psnark.jar" todir="pkg-temp/lib" />
1517        <!-- include systray changes in 0.7.5 -->
1518        <copy file="build/systray.jar" todir="pkg-temp/lib/" />
1519       <!-- removed from updater in 0.9, added back in 0.9.26 -->
1520        <copy file="build/desktopgui.jar" todir="pkg-temp/lib/" />
1521        <copy file="build/susimail.war" todir="pkg-temp/webapps/" />
1522        <copy file="build/susidns.war" todir="pkg-temp/webapps/" />
1523        <copy file="build/imagegen.war" todir="pkg-temp/webapps/" />
1524        <!-- as of 0.7.12; last changed in 0.9; removed from update in 0.9.26 -->
1525      <!--
1526        <copy file="apps/susidns/src/lib/jstl.jar" todir="pkg-temp/lib/" />
1527        <copy file="apps/susidns/src/lib/standard.jar" todir="pkg-temp/lib/" />
1528       -->
1529        <copy file="build/i2psnark.war" todir="pkg-temp/webapps/" />
1530        <copy file="installer/resources/deletelist.txt" todir="pkg-temp/" />
1531        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
1532        <copy todir="pkg-temp/man/">
1533            <fileset dir="installer/resources/man/" />
1534        </copy>
1535    </target>
1536
1537    <target name="truncatehistory">
1538        <copy file="history.txt" todir="pkg-temp/" />
1539        <!-- the following overwrites history.txt on unix to shrink the update file -->
1540        <copy file="history.txt" tofile="pkg-temp/history.txt" overwrite="true">
1541            <filterchain>
1542                <headfilter lines="1500" />
1543            </filterchain>
1544        </copy>
1545        <concat append="true" destfile="pkg-temp/history.txt">&#10;&#10;----------------&#10;&#10;EARLIER HISTORY IS AVAILABLE IN THE SOURCE PACKAGE</concat>
1546    </target>
1547
1548    <target name="prepupdateSmall" depends="buildSmall, prepupdateRouter, prepjupdatefixes, prepthemeupdates">
1549        <copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
1550        <copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
1551        <copy file="build/streaming.jar" todir="pkg-temp/lib/" />
1552        <copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
1553        <!-- Updated in 0.9.28 -->
1554        <!-- name without version so we can overwrite if we upgrade  -->
1555        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
1556        <copy file="build/i2ptunnel.war" todir="pkg-temp/webapps/" />
1557        <copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
1558        <copy file="build/addressbook.jar" todir="pkg-temp/lib/" />
1559        <copy file="build/addressbook.war" todir="pkg-temp/webapps/" />
1560        <!-- decapitalized the file in 0.7.8 -->
1561        <copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
1562        <!-- small enough to include for now -->
1563        <copy file="installer/resources/geoipv6.dat.gz" todir="pkg-temp/geoip/" />
1564        <copy file="installer/resources/continents.txt" todir="pkg-temp/geoip/" />
1565      <!--
1566        <copy file="installer/resources/public-suffix-list.txt" todir="pkg-temp/geoip/" />
1567       -->
1568    </target>
1569
1570    <target name="prepupdateRouter" depends="buildrouter, deletepkg-temp">
1571        <copy file="build/i2p.jar" todir="pkg-temp/lib/" />
1572        <copy file="build/router.jar" todir="pkg-temp/lib/" />
1573    </target>
1574
1575    <!-- jbigi.jar -->
1576    <target name="prepjbigiupdate" depends="jbigi">
1577        <copy file="build/jbigi.jar" todir="pkg-temp/lib/" />
1578    </target>
1579
1580    <!-- GeoIP files -->
1581    <target name="prepgeoupdate" depends="prepgeoupdate-unlesspkg" >
1582        <copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
1583        <copy file="installer/resources/continents.txt" todir="pkg-temp/geoip/" />
1584      <!--
1585        <copy file="installer/resources/public-suffix-list.txt" todir="pkg-temp/geoip/" />
1586       -->
1587    </target>
1588
1589    <!-- GeoIP files, set withGeoIPDatabase=true in override.properties to prevent -->
1590    <!-- As of 0.9.26, the files are not included in Debian/Ubuntu builds. -->
1591    <target name="prepgeoupdate-unlesspkg" unless="${with-geoip-database}" >
1592        <copy file="installer/resources/geoip.txt" todir="pkg-temp/geoip/" />
1593        <copy file="installer/resources/geoipv6.dat.gz" todir="pkg-temp/geoip/" />
1594    </target>
1595
1596    <!-- All jetty jars required for update.
1597         TODO do we need to bother updating jasper?
1598      -->
1599    <target name="prepjupdate" depends="prepupdate, buildWEB">
1600        <copy todir="pkg-temp/lib" >
1601            <fileset dir="build" includes="commons*.jar jasper*.jar javax*.jar jetty*.jar jsp*.jar org.mortbay.*.jar" />
1602        </copy>
1603        <!--  We have to package the new eepsite files for MigrateJetty.java, but we
1604              can't overwrite an existing eepsite dir in a non-split configuration.
1605          -->
1606        <copy todir="pkg-temp/eepsite-jetty9" >
1607            <fileset dir="installer/resources/eepsite" includes="*.xml contexts/* etc/*" />
1608        </copy>
1609    </target>
1610
1611    <target name="delete-j6-update">
1612        <delete dir="pkg-temp/eepsite-jetty9" />
1613    </target>
1614
1615    <!-- Jetty 6 I2P logging addons, not really fixes -->
1616    <target name="prepjupdatefixes" depends="buildWEB">
1617        <copy file="build/jetty-i2p.jar" todir="pkg-temp/lib/" />
1618    </target>
1619
1620    <target name="util-list-changes" depends="checkForMtn" if="mtn.available" >
1621        <exec executable="mtn" outputproperty="workspace.changes.util" errorproperty="mtn.error.util" failifexecutionfails="false" >
1622            <arg value="list" />
1623            <arg value="changed" />
1624            <arg value="core/java/src/net/i2p/util" />
1625        </exec>
1626        <!-- \n in an attribute value generates an invalid manifest -->
1627        <exec executable="tr" inputstring="${workspace.changes.util}" outputproperty="workspace.changes.util.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
1628            <arg value="-s" />
1629            <arg value="[:space:]" />
1630            <arg value="," />
1631        </exec>
1632    </target>
1633
1634    <target name="izpack-patches" >
1635            <taskdef name="izpack"
1636                     classpath="${basedir}/installer/lib/izpack/patches.jar:${basedir}/installer/lib/izpack/standalone-compiler.jar"
1637                     classname="com.izforge.izpack.ant.IzPackTask" />
1638        <jar destfile="${basedir}/installer/lib/izpack/patches.jar"
1639             basedir="${basedir}/installer/lib/izpack/patches" />
1640    </target>
1641
1642    <target name="buildUtilityJar" depends="buildCore">
1643        <ant dir="installer/java" target="build" />
1644    </target>
1645
1646    <target name="installer" depends="preppkg, buildProperties, util-list-changes, izpack-patches, buildUtilityJar" >
1647        <!--
1648          Force 1.5 pack200 output
1649          Doesnt work!
1650          http://jira.codehaus.org/browse/IZPACK-404
1651          http://forums.sun.com/thread.jspa?threadID=773439
1652          http://bfo.co.uk/blog/2010/05/13/combining_ant_jar_signatures_and_pack200.html
1653        <property name="com.sun.java.util.jar.pack.package.majver" value="150" />
1654        <property name="com.sun.java.util.jar.pack.package.minver" value="7" />
1655        -->
1656        <izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
1657
1658        <ant target="installerexe" />
1659    </target>
1660
1661    <!-- this makes i2pinstall.exe from install.jar -->
1662    <target name="installerexe" depends="launch4j" unless="noExe">
1663        <echo message="See the file &quot;build.properties&quot; if this step fails." />
1664        <!-- now the installer exe -->
1665        <launch4j configFile="./installer/i2pinstaller.xml" />
1666        <!-- thazzit -->
1667    </target>
1668
1669    <!-- Custom installers -->
1670    <target name="installer-nowindows" depends="clean, preppkg-nowindows, izpack-patches" >
1671        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1672        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}.jar" installerType="standard" basedir="${basedir}" />
1673    </target>
1674
1675
1676    <target name="installer-freebsd" depends="clean, preppkg-freebsd-only, izpack-patches" >
1677        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1678        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_freebsd-only.jar" installerType="standard" basedir="${basedir}" />
1679    </target>
1680
1681    <target name="installer-linux" depends="clean, preppkg-linux-only, izpack-patches" >
1682        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1683        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_linux-only.jar" installerType="standard" basedir="${basedir}" />
1684    </target>
1685
1686
1687    <target name="installer-osx" depends="clean, checkForIzpack2App, preppkg-osx-only, izpack-patches">
1688        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1689        <mkdir dir="pkg-temp/osx" />
1690        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_osx-only.jar" installerType="standard" basedir="${basedir}" />
1691        <ant target="installer2app" />
1692        <delete dir="pkg-temp/osx" />
1693    </target>
1694
1695    <target name="checkForIzpack2App">
1696        <!-- we'll set the izpack2app binary name if it's not been set elsewhere yet -->
1697        <property name="izpack2app.binary" value="${user.home}/IzPack/utils/wrappers/izpack2app/izpack2app.py" />
1698        <available property="izpack2app.available" file="${izpack2app.binary}" />
1699    </target>
1700
1701    <target name="installer2app" if="izpack2app.available">
1702        <mkdir dir="pkg-temp/osx" />
1703        <exec executable="python" failonerror="true">
1704            <arg value="${izpack2app.binary}" />
1705            <arg value="${basedir}/i2pinstall_${full.version}_osx-only.jar" />
1706            <arg value="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" />
1707        </exec>
1708
1709        <tar longfile="gnu" destfile="${basedir}/i2pinstall_${full.version}_osx.tar.bz2" compression="bzip2">
1710            <tarfileset dir="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" prefix="/i2p-${full.version}_osx-install.app" filemode="644">
1711                <include name="**/**" />
1712                <exclude name="Contents/MacOS/*" />
1713            </tarfileset>
1714            <tarfileset dir="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" prefix="/i2p-${full.version}_osx-install.app" filemode="755">
1715                <include name="Contents/MacOS/*" />
1716            </tarfileset>
1717        </tar>
1718    </target>
1719
1720    <!-- call between installer-xxx and installer-windows -->
1721    <target name="delete-nonwindows">
1722        <delete dir="pkg-temp/lib/wrapper/" />
1723        <delete dir="pkg-temp/locale/" />
1724        <delete dir="pkg-temp/man/" />
1725        <delete dir="pkg-temp/Start I2P Router.app/" />
1726        <delete dir="pkg-temp" includes="eepget i2prouter INSTALL-headless.txt osid postinstall.sh runplain.sh" />
1727    </target>
1728
1729    <target name="installer-windows" depends="clean, preppkg-windows-only, util-list-changes, izpack-patches, buildUtilityJar" >
1730        <fixcrlf srcdir="pkg-temp" includes="*.config *.bat *.cmd **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="crlf"/>
1731        <izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
1732        <ant target="installerexe" />
1733        <delete file="${basedir}/install.jar" />
1734        <move file="${basedir}/i2pinstall.exe" tofile="${basedir}/i2pinstall_${full.version}_windows.exe" />
1735    </target>
1736
1737    <!-- this is broken as installer-xxx targets may delete (or not delete) things in pkg-temp -->
1738    <target name="installer-all" depends="installer-freebsd, installer-linux, installer-osx, installer-windows, installer-nowindows, installer" >
1739    </target>
1740    <!-- end custom installers -->
1741
1742    <!-- unit tests -->
1743    <target name="buildTest">
1744        <ant dir="core/java/" target="jarTest" />
1745        <ant dir="router/java/" target="jarTest" />
1746        <copy file="core/java/build/i2ptest.jar" todir="build" />
1747        <copy file="router/java/build/routertest.jar" todir="build" />
1748        <!-- broken -->
1749      <!--
1750        <ant dir="apps/ministreaming/java/" target="junit.compileTest" />
1751        <ant dir="apps/streaming/java/" target="junit.compileTest" />
1752       -->
1753    </target>
1754    <target name="prepTest" depends="prepupdate, buildTest">
1755        <!-- overwrite i2p.jar and router.jar with the test versions -->
1756        <copy file="build/i2ptest.jar" tofile="pkg-temp/lib/i2p.jar" overwrite="true" />
1757        <copy file="build/routertest.jar" tofile="pkg-temp/lib/router.jar" overwrite="true" />
1758    </target>
1759    <target name="updateTest" depends="prepTest, zipit" />
1760    <target name="junit.test" depends="buildProperties, jbigi" >
1761        <ant dir="core/java/" target="junit.test" />
1762        <ant dir="router/java/" target="junit.test" />
1763        <ant dir="apps/ministreaming/java/" target="junit.test" />
1764        <ant dir="apps/streaming/java/" target="junit.test" />
1765    </target>
1766    <target name="scalatest.test" depends="buildProperties, jbigi" >
1767        <ant dir="core/java/" target="scalatest.test" />
1768        <!-- note there are no router scala tests yet -->
1769        <ant dir="router/java/" target="scalatest.test" />
1770    </target>
1771    <target name="test" depends="buildProperties, jbigi" >
1772        <!-- both junit and scala -->
1773        <ant dir="core/java/" target="test" />
1774        <ant dir="router/java/" target="test" />
1775        <ant dir="apps/ministreaming/java/" target="test" />
1776        <ant dir="apps/streaming/java/" target="test" />
1777    </target>
1778    <target name="scalatest.report" depends="buildProperties" >
1779        <ant dir="core/java/" target="scalatest.report" />
1780        <ant dir="router/java/" target="scalatest.report" />
1781    </target>
1782    <target name="junit.report" depends="buildProperties" >
1783        <ant dir="core/java/" target="junit.report" />
1784        <ant dir="router/java/" target="junit.report" />
1785        <ant dir="apps/ministreaming/java/" target="junit.report" />
1786        <ant dir="apps/streaming/java/" target="junit.report" />
1787    </target>
1788    <target name="clover.report" depends="buildProperties" if="with.clover">
1789        <ant dir="core/java/" target="clover.report" />
1790        <ant dir="router/java/" target="clover.report" />
1791        <ant dir="apps/ministreaming/java" target="clover.report" />
1792        <ant dir="apps/streaming/java" target="clover.report" />
1793    </target>
1794    <target name="cobertura.report" depends="buildProperties" if="with.cobertura">
1795        <ant dir="core/java/" target="cobertura.report" />
1796        <ant dir="router/java/" target="cobertura.report" />
1797        <ant dir="apps/ministreaming/java" target="cobertura.report" />
1798        <ant dir="apps/streaming/java" target="cobertura.report" />
1799    </target>
1800    <target name="test.report" depends="junit.report, scalatest.report, clover.report, cobertura.report"/>
1801    <target name="fulltest" depends="buildProperties, jbigi" >
1802        <ant dir="core/java/" target="fulltest" />
1803        <ant dir="router/java/" target="fulltest" />
1804        <ant dir="apps/ministreaming/java" target="fulltest" />
1805        <ant dir="apps/streaming/java" target="fulltest" />
1806    </target>
1807    <target name="jenkins.cobertura.report" depends="cobertura.report">
1808        <!--
1809             The jenkins cobertura plugin couldn't find the source files.
1810         -->
1811        <replaceregexp byline="true" file="reports/core/cobertura/coverage.xml"
1812            match='filename="net' replace='filename="core/java/src/net'/>
1813        <replaceregexp byline="true" file="reports/core/cobertura/coverage.xml"
1814            match="&lt;source&gt;./src" replace='&lt;source&gt;./core/java/src'/>
1815
1816        <replaceregexp byline="true" file="reports/router/cobertura/coverage.xml"
1817            match='filename="net' replace='filename="router/java/src/net'/>
1818        <replaceregexp byline="true" file="reports/router/cobertura/coverage.xml"
1819            match="&lt;source&gt;./src" replace="&lt;source&gt;router/java/src"/>
1820
1821        <replaceregexp byline="true" file="reports/ministreaming/cobertura/coverage.xml"
1822            match='filename="net' replace='filename="apps/ministreaming/java/src/net'/>
1823        <replaceregexp byline="true" file="reports/ministreaming/cobertura/coverage.xml"
1824            match="&lt;source&gt;./src" replace="&lt;source&gt;apps/ministreaming/java/src"/>
1825
1826        <replaceregexp byline="true" file="reports/streaming/cobertura/coverage.xml"
1827            match='filename="net' replace='filename="apps/streaming/java/src/net'/>
1828        <replaceregexp byline="true" file="reports/streaming/cobertura/coverage.xml"
1829            match="&lt;source&gt;./src" replace="&lt;source&gt;apps/streaming/java/src"/>
1830    </target>
1831    <!-- end unit tests -->
1832
1833    <target name="testscripts" >
1834        <exec executable="tests/scripts/checkcerts.sh" failonerror="true" />
1835        <exec executable="tests/scripts/checkpo.sh" failonerror="true" />
1836        <exec executable="tests/scripts/checkutf8.sh" failonerror="true" />
1837        <exec executable="tests/scripts/checkxml.sh" failonerror="true" />
1838        <exec executable="tests/scripts/checkscripts.sh" failonerror="true" />
1839    </target>
1840
1841
1842    <target name="testscripts-net" >
1843        <exec executable="tests/scripts/checkremotecerts.sh" failonerror="true" />
1844    </target>
1845
1846    <target name="testscripts-all" depends="testscripts,testscripts-net" />
1847
1848    <target name="bench" depends="jbigi" >
1849        <ant dir="core/java/" target="bench.jar" />
1850    </target>
1851
1852    <!-- <target name="syndie" >
1853        <ant dir="apps/syndie/java/" target="standalone" />
1854        <copy file="apps/syndie/java/syndie-standalone.zip" todir="." />
1855    </target> -->
1856
1857    <!-- standalone i2psnark zip -->
1858    <target name="i2psnark" depends="buildStreaming, buildJetty, buildSystray" >
1859        <ant dir="apps/i2psnark/java" target="standalone" />
1860        <copy file="apps/i2psnark/java/i2psnark-standalone.zip" todir="." />
1861    </target>
1862
1863    <target name="slackpkg">
1864        <ant dir="Slackware/i2p/" target="slackpkg" />
1865    </target>
1866    <target name="justBOB" depends="builddepSmall, jbigi">
1867        <ant dir="apps/BOB/" target="onejar" />
1868        <copy file="apps/BOB/dist/BOB-one.jar" todir="." />
1869    </target>
1870
1871    <target name="sloccount.report">
1872        <property name="sloccount.report.file" value="sloccount.sc" />
1873        <echo message="Generating sloccount report (this will take awhile)" />
1874        <exec executable="sloccount" failonerror="true">
1875            <arg value="--details"/>
1876            <arg value="--wide"/>
1877            <arg value="${basedir}"/>
1878            <redirector output="${sloccount.report.file}">
1879                <outputfilterchain>
1880                    <linecontainsregexp negate="true">
1881                        <regexp pattern="(Warning: |lib/launch4j|_MTN|reports|pkg-temp|licenses|i2p\.fba|gmp-|WEB-INF)" />
1882                    </linecontainsregexp>
1883                    <linecontains negate="true">
1884                        <contains value="${sloccount.report.file}" />
1885                    </linecontains>
1886                </outputfilterchain>
1887            </redirector>
1888        </exec>
1889        <echo message="sloccount report saved to the file &quot;${sloccount.report.file}&quot;" />
1890    </target>
1891
1892    <target name="findbugs" depends="build2, buildUtilityJar">
1893        <echo message="Starting findbugs, this will take a while..." />
1894        <exec executable="nice" failonerror="true">
1895            <arg value="findbugs"/>
1896            <arg value="-textui"/>
1897            <arg value="-projectName"/>
1898            <arg value="i2p"/>
1899            <arg value="-sortByClass"/>
1900            <arg value="-xml"/>
1901            <arg value="-output"/>
1902            <arg value="i2p.fba"/>
1903            <arg value="-auxclasspath"/>
1904            <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"/>
1905            <arg value="-sourcepath"/>
1906            <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"/>
1907            <!-- start of the files to be analyzed -->
1908            <arg value="build/BOB.jar"/>
1909            <arg value="build/addressbook.jar"/>
1910            <arg value="build/i2p.jar"/>
1911            <arg value="build/i2psnark.jar"/>
1912            <arg value="build/i2psnark.war"/>
1913            <arg value="build/i2ptunnel.jar"/>
1914            <arg value="build/i2ptunnel.war"/>
1915            <arg value="build/imagegen.war"/>
1916            <arg value="build/jetty-i2p.jar"/>
1917            <arg value="build/mstreaming.jar"/>
1918            <arg value="build/router.jar/"/>
1919            <arg value="build/desktopgui.jar"/>
1920            <arg value="build/routerconsole.jar"/>
1921            <arg value="build/routerconsole.war"/>
1922            <arg value="build/sam.jar"/>
1923            <arg value="build/streaming.jar"/>
1924            <arg value="build/susidns.war"/>
1925            <arg value="build/susimail.war"/>
1926            <arg value="build/systray.jar"/>
1927            <arg value="build/utility.jar"/>
1928        </exec>
1929        <echo message="Findbugs output stored in i2p.fba" />
1930        <echo message="Now run: findbugs i2p.fba" />
1931    </target>
1932
1933    <!-- this is the same dependency as pkg, but with updater200 in the middle,
1934         since preppkg puts too much stuff in pkg-temp -->
1935<!--
1936    <target name="release" depends="distclean, updaterWithJettyFixesAndJbigi , updater200WithJettyFixes, preppkg, installer, getReleaseNumber" >
1937    <target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyAndGeoIPRepack, updater200WithJettyAndGeoIP, delete-j6-update, installer-nowindows, delete-nonwindows, installer-windows">
1938    <target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyAndJbigiRepack, updater200WithJettyAndJbigi, delete-j6-update, installer-nowindows, delete-nonwindows, installer-windows">
1939-->
1940    <target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyRepack, updater200WithJetty, delete-j6-update, installer-nowindows, delete-nonwindows, installer-windows">
1941        <echo message="New version number is ${release.number}" />
1942        <copy file="i2pupdate.zip" tofile="i2pupdate_${release.number}.zip" />
1943        <copy file="i2pinstall_${full.version}.jar" tofile="i2pinstall_${release.number}.jar" />
1944        <copy file="i2pinstall_${full.version}_windows.exe" tofile="i2pinstall_${release.number}_windows.exe" />
1945        <!-- remove these, we don't build them anymore -->
1946        <delete file="i2pupdate.sud" />
1947        <delete file="i2pupdate.su2" />
1948        <!-- make this a lot easier by putting release.privkey.su3=/path/to/su3keystore.ks in override.properties -->
1949
1950        <!-- now build and verify the packed su3 from the packed zip -->
1951        <su3sign infile="i2pupdate200.zip" sigtype="ROUTER" outfile="i2pupdate.su3" su3.ver="${release.number}" />
1952        <!-- this will use the monotonerc file in the current workspace -->
1953        <echo message="Checking out fresh copy into ../i2p-${release.number} for tarballing:" />
1954        <delete dir="../i2p-${release.number}" />
1955        <exec executable="mtn" failonerror="true">
1956            <arg value="co" />
1957            <!-- w: is the revision of the current workspace -->
1958            <arg value="-r" />
1959            <arg value="w:" />
1960            <arg value="../i2p-${release.number}/" />
1961        </exec>
1962        <exec executable="tar" failonerror="true">
1963            <arg value="cjf" />
1964            <arg value="i2psource_${release.number}.tar.bz2" />
1965            <arg value="-C" />
1966            <arg value=".." />
1967            <arg value="--exclude" />
1968            <arg value="i2p-${release.number}/_MTN*" />
1969            <arg value="i2p-${release.number}/" />
1970        </exec>
1971        <echo message="Sign the files:" />
1972        <input message="Enter GPG key ID (e.g. 0x12345678) for signing:" addproperty="release.gpg.keyid" />
1973        <fail message="You must enter a key ID." >
1974            <condition>
1975                <equals arg1="${release.gpg.keyid}" arg2=""/>
1976            </condition>
1977        </fail>
1978
1979        <!-- the gpgsign macro sets the permission of signed files and the sigs themselves to 444 -->
1980        <gpgsign file="i2pinstall_${release.number}_windows.exe" />
1981        <gpgsign file="i2pinstall_${release.number}.jar" />
1982        <gpgsign file="i2psource_${release.number}.tar.bz2" />
1983        <gpgsign file="i2pupdate_${release.number}.zip" />
1984
1985        <chmod perm="444" type="file">
1986            <fileset dir="${basedir}">
1987                <include name="i2pupdate.su3" />
1988            </fileset>
1989        </chmod>
1990        <echo message="File sizes:" />
1991        <exec executable="ls" failonerror="true">
1992            <arg value="-l" />
1993            <arg value="i2pinstall_${release.number}_windows.exe" />
1994            <arg value="i2pinstall_${release.number}.jar" />
1995            <arg value="i2psource_${release.number}.tar.bz2" />
1996            <arg value="i2pupdate_${release.number}.zip" />
1997            <arg value="i2pupdate.su3" />
1998            <arg value="i2pinstall_${release.number}_windows.exe.sig" />
1999            <arg value="i2pinstall_${release.number}.jar.sig" />
2000            <arg value="i2psource_${release.number}.tar.bz2.sig" />
2001            <arg value="i2pupdate_${release.number}.zip.sig" />
2002        </exec>
2003        <echo message="SHA256 sums:" />
2004        <sha256sum file="i2pinstall_${release.number}_windows.exe" />
2005        <sha256sum file="i2pinstall_${release.number}.jar" />
2006        <sha256sum file="i2psource_${release.number}.tar.bz2" />
2007        <sha256sum file="i2pupdate_${release.number}.zip" />
2008        <sha256sum file="i2pupdate.su3" />
2009        <!-- make torrent files -->
2010        <copy file="i2pupdate.su3" tofile="i2pupdate-${release.number}.su3" />
2011        <mktorrent file="i2pupdate-${release.number}.su3" />
2012        <echo message="Don't forget to mtn tag w: i2p-${release.number}" />
2013        <echo message="... and mtn cert t:i2p-${release.number} branch i2p.i2p.release" />
2014    </target>
2015
2016    <target name="mavenCentral.deps" depends="buildRouter, buildStreaming">
2017        <ant dir="core/java/" target="javadocJar" />
2018        <ant dir="core/java/" target="sourcesJar" />
2019        <ant dir="router/java/" target="javadocJar" />
2020        <ant dir="router/java/" target="sourcesJar" />
2021        <ant dir="apps/ministreaming/java/" target="javadocJar" />
2022        <ant dir="apps/ministreaming/java/" target="sourcesJar" />
2023        <ant dir="apps/streaming/java/" target="javadocJar" />
2024        <ant dir="apps/streaming/java/" target="sourcesJar" />
2025        <ant dir="apps/jetty/" target="servletJar" />
2026        <ant dir="apps/jetty/" target="servletJavadocJar" />
2027        <ant dir="apps/jetty/" target="servletSourcesJar" />
2028    </target>
2029
2030    <target name="mavenCentral" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, mavenCentral.deps">
2031        <mkdir dir="./pkg-mavencentral" />
2032        <!-- Libraries -->
2033        <copy file="build/i2p.jar" tofile="pkg-mavencentral/i2p-${release.number}.jar" />
2034        <copy file="build/router.jar" tofile="pkg-mavencentral/router-${release.number}.jar" />
2035        <copy file="build/mstreaming.jar" tofile="pkg-mavencentral/mstreaming-${release.number}.jar" />
2036        <copy file="build/streaming.jar" tofile="pkg-mavencentral/streaming-${release.number}.jar" />
2037        <copy file="apps/jetty/build/servlet-i2p-${release.number}.jar" todir="pkg-mavencentral/" />
2038        <!-- JavaDocs -->
2039        <copy file="core/java/build/i2p-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
2040        <copy file="router/java/build/router-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
2041        <copy file="apps/ministreaming/java/build/mstreaming-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
2042        <copy file="apps/streaming/java/build/streaming-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
2043        <copy file="apps/jetty/build/servlet-i2p-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
2044        <!-- Sources -->
2045        <copy file="core/java/build/i2p-${release.number}-sources.jar" todir="pkg-mavencentral/" />
2046        <copy file="router/java/build/router-${release.number}-sources.jar" todir="pkg-mavencentral/" />
2047        <copy file="apps/ministreaming/java/build/mstreaming-${release.number}-sources.jar" todir="pkg-mavencentral/" />
2048        <copy file="apps/streaming/java/build/streaming-${release.number}-sources.jar" todir="pkg-mavencentral/" />
2049        <copy file="apps/jetty/build/servlet-i2p-${release.number}-sources.jar" todir="pkg-mavencentral/" />
2050        <!-- POMs -->
2051        <artifact:pom id="i2ppom" groupId="net.i2p" artifactId="i2p" version="${release.number}"
2052                name="I2P Core"
2053                description="The core I2P APIs"
2054                url="https://geti2p.net/">
2055            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
2056            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
2057            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/"/>
2058            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
2059                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
2060                 url="git@github.com:i2p/i2p.i2p.git" />
2061        </artifact:pom>
2062        <artifact:pom id="routerpom" groupId="net.i2p" artifactId="router" version="${release.number}"
2063                name="I2P Router"
2064                description="The I2P router"
2065                url="https://geti2p.net/">
2066            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
2067            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
2068            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/"/>
2069            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
2070                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
2071                 url="git@github.com:i2p/i2p.i2p.git" />
2072            <dependency groupId="net.i2p" artifactId="i2p" version="${release.number}" />
2073        </artifact:pom>
2074        <artifact:pom id="mstreamingpom" groupId="net.i2p.client" artifactId="mstreaming" version="${release.number}"
2075                name="I2P Ministreaming"
2076                description="API, interfaces, and factory for a TCP-like set of sockets for communicating over I2P."
2077                url="https://geti2p.net/en/docs/api/streaming">
2078            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
2079            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
2080            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/" />
2081            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
2082                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
2083                 url="git@github.com:i2p/i2p.i2p.git" />
2084            <dependency groupId="net.i2p" artifactId="i2p" version="${release.number}" />
2085        </artifact:pom>
2086        <artifact:pom id="streamingpom" groupId="net.i2p.client" artifactId="streaming" version="${release.number}"
2087                name="I2P Streaming"
2088                description="Implementation of a TCP-like set of sockets for communicating over I2P."
2089                url="https://geti2p.net/en/docs/api/streaming">
2090            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
2091            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
2092            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/" />
2093            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
2094                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
2095                 url="git@github.com:i2p/i2p.i2p.git" />
2096            <dependency groupId="net.i2p" artifactId="i2p" version="${release.number}" />
2097            <dependency groupId="net.i2p.client" artifactId="mstreaming" version="${release.number}" />
2098        </artifact:pom>
2099        <artifact:pom id="servletpom" groupId="net.i2p" artifactId="servlet-i2p" version="${release.number}"
2100                name="I2P Servlet classes"
2101                description="Various servlet classes provided to plugins by Java I2P."
2102                url="https://geti2p.net/">
2103            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
2104            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
2105            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/" />
2106            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
2107                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
2108                 url="git@github.com:i2p/i2p.i2p.git" />
2109            <dependency groupId="net.i2p" artifactId="i2p" version="${release.number}" />
2110            <dependency groupId="org.apache.tomcat" artifactId="tomcat-servlet-api" version="8.0.33" />
2111        </artifact:pom>
2112        <artifact:writepom pomRefId="i2ppom" file="pkg-mavencentral/i2p-${release.number}.pom"/>
2113        <artifact:writepom pomRefId="routerpom" file="pkg-mavencentral/router-${release.number}.pom"/>
2114        <artifact:writepom pomRefId="mstreamingpom" file="pkg-mavencentral/mstreaming-${release.number}.pom" />
2115        <artifact:writepom pomRefId="streamingpom" file="pkg-mavencentral/streaming-${release.number}.pom" />
2116        <artifact:writepom pomRefId="servletpom" file="pkg-mavencentral/servlet-i2p-${release.number}.pom" />
2117        <!-- Signatures -->
2118        <echo message="Sign the files:" />
2119        <input message="Enter GPG key ID (e.g. 0x12345678) for signing:" addproperty="release.gpg.keyid" />
2120        <fail message="You must enter a key ID." >
2121            <condition>
2122                <equals arg1="${release.gpg.keyid}" arg2=""/>
2123            </condition>
2124        </fail>
2125        <!-- the gpgsign macro sets the permission of signed files and the sigs themselves to 444 -->
2126        <gpgsignasc file="pkg-mavencentral/i2p-${release.number}.jar" />
2127        <gpgsignasc file="pkg-mavencentral/i2p-${release.number}.pom" />
2128        <gpgsignasc file="pkg-mavencentral/i2p-${release.number}-javadoc.jar" />
2129        <gpgsignasc file="pkg-mavencentral/i2p-${release.number}-sources.jar" />
2130        <gpgsignasc file="pkg-mavencentral/router-${release.number}.jar" />
2131        <gpgsignasc file="pkg-mavencentral/router-${release.number}.pom" />
2132        <gpgsignasc file="pkg-mavencentral/router-${release.number}-javadoc.jar" />
2133        <gpgsignasc file="pkg-mavencentral/router-${release.number}-sources.jar" />
2134        <gpgsignasc file="pkg-mavencentral/mstreaming-${release.number}.jar" />
2135        <gpgsignasc file="pkg-mavencentral/mstreaming-${release.number}.pom" />
2136        <gpgsignasc file="pkg-mavencentral/mstreaming-${release.number}-javadoc.jar" />
2137        <gpgsignasc file="pkg-mavencentral/mstreaming-${release.number}-sources.jar" />
2138        <gpgsignasc file="pkg-mavencentral/streaming-${release.number}.jar" />
2139        <gpgsignasc file="pkg-mavencentral/streaming-${release.number}.pom" />
2140        <gpgsignasc file="pkg-mavencentral/streaming-${release.number}-javadoc.jar" />
2141        <gpgsignasc file="pkg-mavencentral/streaming-${release.number}-sources.jar" />
2142        <gpgsignasc file="pkg-mavencentral/servlet-i2p-${release.number}.jar" />
2143        <gpgsignasc file="pkg-mavencentral/servlet-i2p-${release.number}.pom" />
2144        <gpgsignasc file="pkg-mavencentral/servlet-i2p-${release.number}-javadoc.jar" />
2145        <gpgsignasc file="pkg-mavencentral/servlet-i2p-${release.number}-sources.jar" />
2146        <!-- Bundle -->
2147        <jar destfile="mavencentral-i2p.jar">
2148            <fileset dir="./pkg-mavencentral">
2149                <include name="i2p-*" />
2150            </fileset>
2151        </jar>
2152        <jar destfile="mavencentral-router.jar">
2153            <fileset dir="./pkg-mavencentral">
2154                <include name="router-*" />
2155            </fileset>
2156        </jar>
2157        <jar destfile="mavencentral-mstreaming.jar">
2158            <fileset dir="./pkg-mavencentral">
2159                <include name="mstreaming-*" />
2160            </fileset>
2161        </jar>
2162        <jar destfile="mavencentral-streaming.jar">
2163            <fileset dir="./pkg-mavencentral">
2164                <include name="streaming-*" />
2165            </fileset>
2166        </jar>
2167        <jar destfile="mavencentral-servlet-i2p.jar">
2168            <fileset dir="./pkg-mavencentral">
2169                <include name="servlet-i2p-*" />
2170            </fileset>
2171        </jar>
2172        <echo message="Now upload mavencentral-*.jar to Maven Central." />
2173    </target>
2174
2175    <target name="debian" depends="debian-clean, debchange, debian-binary" />
2176
2177    <target name="getExtendedVersion" depends="buildProperties, trimMtnRev">
2178        <property name="MtnShortHash" value="unknown" />
2179        <condition property="Extended.Version" value="${full.version}-${MtnShortHash}">
2180            <not>
2181                <or>
2182                    <equals arg1="${MtnShortHash}" arg2="" />
2183                    <equals arg1="${MtnShortHash}" arg2="unknown" />
2184                </or>
2185            </not>
2186        </condition>
2187        <!-- if not set above we'll set it here -->
2188        <property name="Extended.Version" value="${full.version}" />
2189    </target>
2190
2191    <target name="debchange" depends="getExtendedVersion" unless="noAutoDebchange">
2192        <echo message= "Debian version is ${Extended.Version}-1" />
2193        <exec executable="dch" failonerror="true">
2194            <arg value="-b" />
2195            <arg value="--check-dirname-level" />
2196            <arg value="0" />
2197            <arg value="-v" />
2198            <arg value="${Extended.Version}-1" />
2199            <arg value="Unofficial Debian package built using &quot;ant debian&quot;" />
2200        </exec>
2201    </target>
2202
2203    <target name="debian-binary" depends="getExtendedVersion">
2204        <exec executable="fakeroot" failonerror="true">
2205            <arg value="debian/rules" />
2206            <arg value="patch" />
2207            <arg value="binary" />
2208            <arg value="clean" />
2209        </exec>
2210        <delete dir=".pc" />
2211        <move todir=".">
2212            <fileset dir=".." includes="libjbigi*${release.number}*.deb i2p*${release.number}*.deb" />
2213        </move>
2214        <echo message="" />
2215        <echo message="====================" />
2216        <echo message="Packages have been built and moved to ${basedir}" />
2217        <echo message="====================" />
2218    </target>
2219
2220    <target name="debian-clean" depends="getExtendedVersion" >
2221        <exec executable="fakeroot" failonerror="true">
2222            <arg value="debian/rules" />
2223            <arg value="clean" />
2224        </exec>
2225        <delete dir="./.pc" />
2226    </target>
2227
2228    <target name="debian-tarball" depends="getExtendedVersion">
2229        <!-- this will use the monotonerc file in the current workspace -->
2230        <fail message="This target cannot be used without Monotone! Use &quot;fakeroot debian/rules get-orig-source&quot; instead.">
2231            <condition>
2232                <not>
2233                    <isset property="mtn.available" />
2234                </not>
2235            </condition>
2236        </fail>
2237        <property name="debian.tarball.name" value="i2p_${Extended.Version}.orig.tar.bz2" />
2238        <echo message="Checking out fresh copy into ../i2p-${Extended.Version} for tarballing:" />
2239        <delete dir="../i2p-${Extended.Version}" />
2240        <exec executable="mtn" failonerror="true">
2241            <arg value="co" />
2242            <!-- w: is the revision of the current workspace -->
2243            <arg value="-r" />
2244            <arg value="w:" />
2245            <arg value="../i2p-${Extended.Version}" />
2246        </exec>
2247        <delete includeemptydirs="true" quiet="false" failonerror="false">
2248            <fileset dir="../i2p-${Extended.Version}/debian-alt/" />
2249            <fileset dir="../i2p-${Extended.Version}/installer/lib/" />
2250            <fileset dir="../i2p-${Extended.Version}/Slackware" />
2251            <fileset dir="../i2p-${Extended.Version}/_MTN" />
2252            <!-- gettext-base -->
2253            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/gettext" />
2254            <!-- libgetopt-java -->
2255            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/getopt" />
2256            <!-- libhttpclient-java and libhttpcore-java -->
2257          <!--
2258            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/apache/http" />
2259           -->
2260            <!-- geoip-database -->
2261            <file name="../i2p-${Extended.Version}/installer/resources/geoip.txt" />
2262            <file name="../i2p-${Extended.Version}/installer/resources/geoipv6.dat.gz" />
2263            <!-- libjetty9-java -->
2264            <fileset dir="../i2p-${Extended.Version}/apps/jetty/jetty-distribution-9.2.21.v20170120" />
2265            <!-- libjstl1.1-java or glassfish-javaee -->
2266          <!--
2267            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/jstl.jar" />
2268           -->
2269            <!-- libjakarta-taglibs-standard-java or glassfish-javaee -->
2270            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/standard.jar" />
2271            <!-- anything added above, add in debian-release-tarball also -->
2272        </delete>
2273        <tar longfile="gnu" destfile="../${debian.tarball.name}" compression="bzip2">
2274            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${Extended.Version}">
2275                <include name="**/**" />
2276                <exclude name="debian/**"/>
2277                <exclude name="debian-alt/**"/>
2278                <exclude name="**/*.sh"/>
2279                <exclude name="installer/resources/geoip.txt"/>
2280                <exclude name="installer/resources/geoipv6.dat.gz"/>
2281                <exclude name="apps/jetty/jetty-distribution-*/**"/>
2282          <!--
2283                <exclude name="apps/susidns/src/lib/jstl.jar" />
2284           -->
2285                <exclude name="apps/susidns/src/lib/standard.jar" />
2286                <!-- anything added above, add in debian-release-tarball also -->
2287            </tarfileset>
2288            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${Extended.Version}" filemode="755">
2289                <exclude name="debian/**" />
2290                <include name="**/*.sh" />
2291            </tarfileset>
2292        </tar>
2293    </target>
2294
2295    <!-- same as debian-release-tarball but with bundled jetty
2296      -  We add a 'p' to the release name and tarball since the source package is different;
2297      -  Launchpad does not allow different source packages with the same name.
2298      -->
2299    <target name="precise-release-tarball" depends="getExtendedVersion">
2300        <!-- this will use the monotonerc file in the current workspace -->
2301        <fail message="This target cannot be used without Monotone! Use &quot;fakeroot debian/rules get-orig-source&quot; instead.">
2302            <condition>
2303                <not>
2304                    <isset property="mtn.available" />
2305                </not>
2306            </condition>
2307        </fail>
2308        <property name="debian.tarball.name" value="i2p_${release.number}p.orig.tar.bz2" />
2309        <echo message="Checking out fresh copy into ../i2p-${Extended.Version} for tarballing:" />
2310        <delete dir="../i2p-${Extended.Version}" />
2311        <exec executable="mtn" failonerror="true">
2312            <arg value="co" />
2313            <!-- w: is the revision of the current workspace -->
2314            <arg value="-r" />
2315            <arg value="w:" />
2316            <arg value="-b" />
2317            <arg value="i2p.i2p" />
2318            <arg value="../i2p-${Extended.Version}" />
2319        </exec>
2320        <delete includeemptydirs="true" quiet="false" failonerror="false">
2321            <fileset dir="../i2p-${Extended.Version}/debian-alt/" />
2322            <fileset dir="../i2p-${Extended.Version}/installer/lib/" />
2323            <fileset dir="../i2p-${Extended.Version}/Slackware" />
2324            <fileset dir="../i2p-${Extended.Version}/_MTN" />
2325            <!-- gettext-base -->
2326            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/gettext" />
2327            <!-- libgetopt-java -->
2328            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/getopt" />
2329            <!-- libhttpclient-java and libhttpcore-java -->
2330          <!--
2331            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/apache/http" />
2332           -->
2333            <!-- geoip-database -->
2334            <file name="../i2p-${Extended.Version}/installer/resources/geoip.txt" />
2335            <file name="../i2p-${Extended.Version}/installer/resources/geoipv6.dat.gz" />
2336            <!-- libjetty9-java -->
2337          <!--
2338            <fileset dir="../i2p-${Extended.Version}/apps/jetty/jetty-distribution-9.2.21.v20170120" />
2339           -->
2340            <!-- libjstl1.1-java or glassfish-javaee -->
2341          <!--
2342            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/jstl.jar" />
2343           -->
2344            <!-- libjakarta-taglibs-standard-java or glassfish-javaee -->
2345            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/standard.jar" />
2346            <!-- anything added above, add in debian-release-tarball also -->
2347        </delete>
2348        <tar longfile="gnu" destfile="../${debian.tarball.name}" compression="bzip2">
2349            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${Extended.Version}">
2350                <include name="**/**" />
2351                <exclude name="debian/**"/>
2352                <exclude name="debian-alt/**"/>
2353                <exclude name="**/*.sh"/>
2354                <exclude name="installer/resources/geoip.txt"/>
2355                <exclude name="installer/resources/geoipv6.dat.gz"/>
2356          <!--
2357                <exclude name="apps/jetty/jetty-distribution-*/**"/>
2358           -->
2359          <!--
2360                <exclude name="apps/susidns/src/lib/jstl.jar" />
2361           -->
2362                <exclude name="apps/susidns/src/lib/standard.jar" />
2363                <!-- anything added above, add in debian-release-tarball also -->
2364            </tarfileset>
2365            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${Extended.Version}" filemode="755">
2366                <exclude name="debian/**" />
2367                <include name="**/*.sh" />
2368            </tarfileset>
2369        </tar>
2370    </target>
2371
2372    <!-- same as debian-tarball but with a release tar.bz2 file name and tar prefix -->
2373    <target name="debian-release-tarball" depends="getExtendedVersion">
2374        <!-- this will use the monotonerc file in the current workspace -->
2375        <fail message="This target cannot be used without Monotone! Use &quot;fakeroot debian/rules get-orig-source&quot; instead.">
2376            <condition>
2377                <not>
2378                    <isset property="mtn.available" />
2379                </not>
2380            </condition>
2381        </fail>
2382        <property name="debian.tarball.name" value="i2p_${release.number}.orig.tar.bz2" />
2383        <echo message="Checking out fresh copy into ../i2p-${Extended.Version} for tarballing:" />
2384        <delete dir="../i2p-${Extended.Version}" />
2385        <exec executable="mtn" failonerror="true">
2386            <arg value="co" />
2387            <!-- w: is the revision of the current workspace -->
2388            <arg value="-r" />
2389            <arg value="w:" />
2390            <arg value="-b" />
2391            <arg value="i2p.i2p" />
2392            <arg value="../i2p-${Extended.Version}" />
2393        </exec>
2394        <delete includeemptydirs="true" quiet="false" failonerror="false">
2395            <fileset dir="../i2p-${Extended.Version}/debian-alt/" />
2396            <fileset dir="../i2p-${Extended.Version}/installer/lib/" />
2397            <fileset dir="../i2p-${Extended.Version}/Slackware" />
2398            <fileset dir="../i2p-${Extended.Version}/_MTN" />
2399            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/gettext" />
2400            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/getopt" />
2401          <!--
2402            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/apache/http" />
2403           -->
2404            <file name="../i2p-${Extended.Version}/installer/resources/geoip.txt" />
2405            <file name="../i2p-${Extended.Version}/installer/resources/geoipv6.dat.gz" />
2406            <fileset dir="../i2p-${Extended.Version}/apps/jetty/jetty-distribution-9.2.21.v20170120" />
2407          <!--
2408            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/jstl.jar" />
2409           -->
2410            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/standard.jar" />
2411            <!-- anything added above, add in debian-tarball also -->
2412        </delete>
2413        <tar longfile="gnu" destfile="../${debian.tarball.name}" compression="bzip2">
2414            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${release.number}">
2415                <include name="**/**" />
2416                <exclude name="debian/**"/>
2417                <exclude name="debian-alt/**"/>
2418                <exclude name="**/*.sh"/>
2419                <exclude name="installer/resources/geoip.txt"/>
2420                <exclude name="installer/resources/geoipv6.dat.gz"/>
2421                <exclude name="apps/jetty/jetty-distribution-*/**"/>
2422          <!--
2423                <exclude name="apps/susidns/src/lib/jstl.jar" />
2424           -->
2425                <exclude name="apps/susidns/src/lib/standard.jar" />
2426                <!-- anything added above, add in debian-tarball also -->
2427            </tarfileset>
2428            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${release.number}" filemode="755">
2429                <exclude name="debian/**" />
2430                <include name="**/*.sh" />
2431            </tarfileset>
2432        </tar>
2433    </target>
2434
2435    <target name="debian-patch" depends="getExtendedVersion" >
2436        <exec executable="quilt" failonerror="true">
2437            <arg value="-a" />
2438            <arg value="push" />
2439        </exec>
2440        <echo message="====================" />
2441    </target>
2442    <target name="debian-unpatch" depends="buildProperties">
2443        <exec executable="quilt" failonerror="false">
2444            <arg value="-a" />
2445            <arg value="pop" />
2446        </exec>
2447    </target>
2448
2449    <target name="debianrepo" depends="debian">
2450        <exec dir="debian" executable="./makerepo.sh" failonerror="true"/>
2451    </target>
2452
2453<!-- the following are appened to help build barebone portable version,
2454     none of the above is modified for this purpose -->
2455        <target name = "pkg-portable-clean">
2456                <delete dir="build/" />
2457                <delete dir="pkg-temp/" />
2458                <delete>
2459                        <fileset dir="." includes="portable-**.zip**" />
2460                </delete>
2461        </target>
2462<!-- build a portable archive -->
2463
2464<!-- *0* Since we simply pack all files in folder "build/" into our archieve,
2465                we need to make sure its small, with NO redundent jars or wars.
2466                thus cleaning is required before each build-->
2467        <target name="buildSmallOnly" depends="pkg-portable-clean,buildSmall"/>
2468
2469<!-- *1* preparing the jars by OS dependent de-bloating -->
2470        <target name="preppkg-portable-win32-jbigi" depends="buildSmallOnly, jbigi-windows-only" />
2471
2472        <target name="preppkg-portable-linux-jbigi"  depends="buildSmallOnly, jbigi-linux-only" />
2473
2474<!-- *2* os independent procedure  -->
2475        <target name="preppkg-portable-basic" >
2476                <mkdir dir="pkg-temp" />
2477                        <!-- non OS dependent configurations only, dont add *nux/win stuff here -->
2478                        <copy todir="pkg-temp">
2479                                <fileset dir="installer/resources/portable/configs/" />
2480                        </copy>
2481                        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
2482                        <copy file="installer/resources/hosts.txt" todir="pkg-temp/" />
2483                        <copy file="installer/resources/readme.license.txt" todir="pkg-temp/" />
2484                <mkdir dir="pkg-temp/addressbook" />
2485                        <copy file="apps/addressbook/subscriptions.txt" todir="pkg-temp/addressbook/" />
2486                        <copy file="apps/addressbook/myhosts.txt"  todir="pkg-temp/addressbook/" />
2487                        <!-- config.txt is in installer/resources/portable -->
2488                <mkdir dir="pkg-temp/docs" />
2489                        <copy file="installer/resources/initialNews/initialNews.xml" tofile="pkg-temp/docs/news.xml" overwrite="true" />
2490                        <copy file="installer/resources/readme/readme.html" tofile="pkg-temp/docs/readme.html" />
2491                        <copy file="installer/resources/startconsole.html" todir="pkg-temp/docs/" />
2492                        <copy file="installer/resources/start.ico" todir="pkg-temp/docs/" />
2493                        <copy file="installer/resources/console.ico" todir="pkg-temp/docs/" />
2494                        <!-- HTTP Header files, english only,
2495                                if you need a different lang do it in a seperate target -->
2496                        <copy todir="pkg-temp/docs/" >
2497                                <fileset dir="installer/resources/proxy/"  includes="**-header.ht" />
2498                        </copy>
2499                        <!-- Theme light only -->
2500                        <copy todir="pkg-temp/docs/themes/console/light/" overwrite="true" >
2501                                <fileset dir="installer/resources/themes/console/light/" includes="**.css" />
2502                        </copy>
2503                        <copy file="installer/resources/themes/console/light/console_big.css" todir="portable/docs/themes/console/light/" />
2504                        <copy todir="pkg-temp/docs/themes/console/images/" >
2505                                <fileset dir="installer/resources/themes/console/images/" />
2506                        </copy>
2507                        <!-- FLAGs for language icon (not for ip)-->
2508                        <copy todir="pkg-temp/docs/icons/flags" >
2509                                <fileset dir="installer/resources/icons/flags/" includes="cn.png,de.png,fr.png,nl.png,ru.png,se.png,us.png" />
2510                        </copy>
2511                <mkdir dir="pkg-temp/webapps" />
2512                        <copy todir="pkg-temp/webapps/">
2513                                <fileset dir="build/" includes="**.war" />
2514                        </copy>
2515                <mkdir dir="pkg-temp/lib" />
2516                        <copy todir ="pkg-temp/lib/" >
2517                                <fileset dir="build/" includes="**.jar" />
2518                        </copy>
2519                        <!-- 3rd party jars from apps/  -->
2520                                <!-- jrobin - without jobin , you lost graph and get a lot error entry in logs -->
2521                        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
2522        </target>
2523<!-- *3* os dependent procedure/commands -->
2524        <target name = "preppkg-portable-win32" depends="preppkg-portable-win32-jbigi,preppkg-portable-basic">
2525                        <!--wrapper - dont even think about it. i2p cosumes appreantly more mem without it on win32-->
2526                <copy file="installer/lib/wrapper/win32/wrapper.dll" todir="pkg-temp/lib" />
2527                <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
2528                <copy file="installer/lib/wrapper/win32/I2Psvc.exe" tofile="pkg-temp/i2psvc.ex_" />
2529                        <!--  copy the unpack/start batchfiles -->
2530                <copy todir="pkg-temp">
2531                        <fileset dir="installer/resources/portable/win32/" />
2532                </copy>
2533        </target>
2534<!-- *4* command for windows package -->
2535        <target name = "pkg-portable-win32"     depends="preppkg-portable-win32, pack200" >
2536                <!-- i need the portable\ folder in .zip so basedir is set to . -->
2537                <move file="pkg-temp" tofile="portable"/>
2538                <zip destfile="portable-win32.zip" basedir="." level="9" includes="portable\**" />
2539                <checksum file="portable-win32.zip" forceOverwrite="yes"/>
2540                <move file="portable" tofile="pkg-temp"/>
2541        </target>
2542</project>
Note: See TracBrowser for help on using the repository browser.