source: build.xml @ 6dc3cd9

Last change on this file since 6dc3cd9 was 6dc3cd9, checked in by kytv <kytv@…>, 6 years ago

build.xml: signing

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