source: build.xml @ 6908616

Last change on this file since 6908616 was 841bb755, checked in by zzz <zzz@…>, 2 years ago

Build: Add target to show revs since last release

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