source: build.xml @ 79d8a0e

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

build: New poupdate-source target

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