source: build.xml @ 7e8de06

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

dont include i2prouter.mo files in updater or installer for now

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