source: build.xml @ a15e4c6

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

Revert the last check-in and correct my earlier addition of Czech.

The Czech language is CZ but the Czech country is CZ.

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