source: build.xml @ 4dc1241d

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

Add lightweight getopt command line parsing lib
(ticket #1173)
This is Java getopt 1.0.14 (released 2012/02/08)
Source was retrieved from https://github.com/arenn/java-getopt
Previous version 1.0.13 (released 2006/08/29)
is available at http://www.urbanophile.com/arenn/hacking/getopt/
Copyright © 1998 by Aaron M. Renn (arenn@…),
LGPL v2.
Include the small translation files, add to build.xml and to .tx/config
Fixes:

Simplified Chinese

MessagesBundle_chs.properties renamed to MessagesBundle_zh.properties

Traditional Chinese

MessagesBundle_cht.properties renamed to MessagesBundle_zh_TW.properties

Norwegian Bokmaal

MessagesBundle_no.properties renamed to MessagesBundle_nb.properties

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