source: build.xml @ 2b81cee

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

propagate from branch 'i2p.i2p.zzz.jetty6' (head b2ad0d72311d5ec26270cfcbbc79d128b268869b)

to branch 'i2p.i2p' (head b05b73d4740740f306a665e4b354d412eab2f328)

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