source: build.xml @ 8bcbf24

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

propagate from branch 'i2p.i2p.zzz.test' (head 5474e1a513fc8144a3d855e9c85d8b235f7f9816)

to branch 'i2p.i2p' (head 5932d3923108572b22a8a7a600f0f9e62ecac347)

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