source: build.xml @ 5c8eab9

Last change on this file since 5c8eab9 was 5c8eab9, checked in by zzz <zzz@…>, 4 years ago

Debian: Add dependency on glassfish-javaee for jstl.jar and standard.jar version 1.2
don't echo comments in debian/rules

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