source: build.xml @ e978bb8

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

checked in correct file

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