source: build.xml @ 9f7ec39

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

Build: Add buildSusiMailJar target for testing
More test targets

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