source: build.xml @ 9a241af

Last change on this file since 9a241af was 9a241af, checked in by kytv <kytv@…>, 8 years ago

enable translations for 'i2prouter'

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