source: build.xml @ 724f4f9

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