source: build.xml @ 40c4a42

Last change on this file since 40c4a42 was 40c4a42, checked in by zzz <zzz@…>, 5 years ago

I2PSSLSocketFactory:

  • Add hostname verification using code from

Apache HttpClient? 4.4.1 (Apache 2.0 license)
and one small class from HttpCore? 4.4.1,
slightly modified to remove additional Apache dependencies
and unneeded code.

  • Includes support for public suffix list;

use basic list with standard TLDs,
and also support loading the big Mozilla list,
but don't bundle the 150KB Mozilla list for now.

  • For Android, use its default verifier, which

should actually work (unlike Oracle)

  • Java 7 not required, although servers requiring SNI will now

fail on Java 6, which does not support SNI
SSLEepGet:

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