source: build.xml @ 0a1cd20

Last change on this file since 0a1cd20 was 0a1cd20, checked in by zzz <zzz@…>, 3 years ago

Debian: Updates

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