source: build.xml @ 5376858

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

Add WithJavadoc? targets that also include Jetty

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