source: build.xml @ bb46535e

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

propagate from branch 'i2p.i2p' (head 3d9f6d9555224cc3277ca10fd9409c83422758eb)

to branch 'i2p.i2p.zzz.jetty6' (head 0212d710e5a4eb30249201015f045d43f44650cb)

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