source: build.xml @ 8c10ec9

Last change on this file since 8c10ec9 was 8c10ec9, checked in by meeh <meeh@…>, 2 years ago

Realised a better way to handle the build process of both the
Browser Bundle i2p launcher, as well as the upcoming Mac OS X
i2p launcher. They share some few properties and how code has
to be managed for both system's update managers and so on.
More details will be documentated in README.md files as well as
in those commit messages I now write :)

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