source: build.xml @ 08d1ea8

Last change on this file since 08d1ea8 was 3063e37, checked in by zzz <zzz@…>, 4 years ago

Systray: Remove old 32-bit Windows implementation, replaced by DTG

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