source: build.xml @ 58512b8

Last change on this file since 58512b8 was 58512b8, checked in by kytv <kytv@…>, 7 years ago

build.xml: add new macros for use in the release target

Also move away from using external binaries when an ant task can do the job.

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