source: build.xml @ e390e67

Last change on this file since e390e67 was e390e67, checked in by str4d <str4d@…>, 4 years ago

Package I2P servlet classes for Maven Central

RequestWrapper? and its dependencies are excluded to avoid classpath issues.

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