source: build.xml @ cf41068

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

SDK message

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