source: build.xml @ e27af37

Last change on this file since e27af37 was e27af37, checked in by zzz <zzz@…>, 4 years ago

i2psnark standalone:

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