source: build.xml @ 8a32aad

Last change on this file since 8a32aad was 8a32aad, checked in by str4d <str4d@…>, 8 years ago

Shuffled build targets around to group together ones related to unit tests

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