source: build.xml @ e7b9a23

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

add 'bump' as an alias for the 'bumpBuild' ant target

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