source: build.xml @ df0aceb

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

add another bootclasspath check

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