source: build.xml @ 86a2e16

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

Fix pkg build for Jetty 9.2.22
Set next release to include GeoIP

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