source: build.xml @ baa11d8

Last change on this file since baa11d8 was baa11d8, checked in by zzz <zzz@…>, 22 months ago

Console: Move modified flags to new directory,
in prep for symlinking original flags dir to package
for package installs (ticket #2270)

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