source: build.xml @ a0a9c23

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

fixups after prop

  • Property mode set to 100644
File size: 85.2 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<project basedir="." default="all" name="i2p">
3
4    <!-- Things you might want to change -->
5    <!-- This keeps gcj a lot quieter -->
6    <!--
7        <property name="javac.compilerargs" value="-warn:-unchecked,raw,unused,serial" />
8    -->
9    <!-- Additional classpath. No longer required; we find pack200 classes at runtime.
10         See core/java/src/net/i2p/util/FileUtil.java for more info.
11    -->
12    <!--
13        <property name="javac.classpath" value="/PATH/TO/pack200.jar" />
14    -->
15
16    <!-- change this to false if you don't have gettext -->
17    <property name="require.gettext" value="true" />
18    <!-- Include property files so that values can be easily overridden. Currently just useful for javadoc hosters -->
19    <property file="override.properties"/>
20    <property file="build.properties"/>
21
22    <!-- You probably don't want to change anything from here down -->
23    <target name="help" depends="all" />
24    <target name="all" >
25        <echo message="Useful targets: " />
26        <echo message="  pkg:       distclean then package everything up (installer, clean tarball, update tarball)" />
27        <echo message="  dist:      pkg and javadoc" />
28        <echo message="  installer: build the GUI installer" />
29        <echo message="  installer-freebsd: build the GUI installer (FreeBSD only)" />
30        <echo message="  installer-linux: build the GUI installer (Linux only)" />
31        <echo message="  installer-osx: build the GUI installer (OSX only)" />
32        <echo message="  installer-windows: build the GUI installer (Windows only)" />
33        <echo message="  tarball:   tar the full install into i2p.tar.bz2 (extracts to build a new clean install)" />
34        <echo message="  updater:   Package the built files in i2pupdate.zip (extracts safely over existing installs)" />
35        <echo message="  updater200: Updater compressed with pack200 (creates i2pupdate200.zip, 60% smaller)" />
36        <echo message="  updaterWithJavadoc: updater including the javadocs, for display in the console" />
37        <echo message="  updater200WithJavadoc: updater including the javadocs, for display in the console (creates i2pupdate200.zip)" />
38        <echo message="  updaterWithJetty: Updater including Jetty" />
39        <echo message="  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="updaterWithJettyFixes" depends="prepjupdatefixes, preplicenses, zipit" />
960    <target name="updaterWithJettyFixesAndJbigi" depends="prepjupdatefixes, prepjbigiupdate, preplicenses, zipit" />
961    <target name="updaterWithJettyFixesAndGeoIP" depends="prepjupdatefixes, prepgeoupdate, preplicenses, zipit" />
962    <target name="updaterSmall" depends="prepupdateSmall, zipit" />
963    <target name="updaterRouter" depends="prepupdateRouter, zipit" />
964
965    <target name="zipit" depends="getReleaseNumber" >
966        <!--
967             As of release 0.8.8, the router will enforce a zipfile comment equal to the
968             version number in the sud/su2 header, since the version in the header is NOT
969             covered by the signature.
970         -->
971        <zip destfile="i2pupdate.zip" basedir="pkg-temp" whenempty="fail" comment="${release.number}" />
972       <!-- just a test, makes almost no difference
973        <tar destfile="i2pupdate.tgz" basedir="pkg-temp" compression="gzip" />
974        <tar destfile="i2pupdate.tbz" basedir="pkg-temp" compression="bzip2" />
975       -->
976    </target>
977
978    <target name="zipit200" depends="getReleaseNumber" >
979        <zip destfile="i2pupdate200.zip" basedir="pkg-temp" whenempty="fail" comment="${release.number}" />
980    </target>
981
982    <target name="pack200">
983        <!-- pack200 will only pack to a .pack file, and only from a .jar file, so we put another .jar on the end -->
984        <!-- *nix here -->
985        <exec executable="sh" osfamily="unix" failonerror="true">
986            <arg value="-c" />
987            <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" />
988        </exec>
989        <exec executable="sh" osfamily="mac" failonerror="true">
990            <arg value="-c" />
991            <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" />
992        </exec>
993        <!-- windoz here : i admit, i hate escaped symbols in xml, indeed = =! -->
994        <exec executable="cmd" osfamily="windows" failonerror="true">
995            <arg value="/c" />
996            <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" />
997        </exec>
998        <exec executable="cmd" osfamily="windows" failonerror="true">
999                <arg value="/c" />
1000                <arg value="for %i in (pkg-temp\lib\*.jar) do pack200 -g %i.pack %i &amp;&amp; del %i" />
1001        </exec>
1002    </target>
1003
1004    <!-- saves about 1% on average (more on jars with multiple compiled po files since they have lots of common strings) -->
1005    <target name="repack200">
1006        <!-- pack200 will only repack a .jar file, so we put another .jar on the end -->
1007        <!-- *nix here -->
1008        <exec executable="sh" osfamily="unix" failonerror="true">
1009            <arg value="-c" />
1010            <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" />
1011        </exec>
1012        <exec executable="sh" osfamily="mac" failonerror="true">
1013            <arg value="-c" />
1014            <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" />
1015        </exec>
1016        <!-- windoz here : i admit, i hate escaped symbols in xml, indeed = =! -->
1017        <exec executable="cmd" osfamily="windows" failonerror="true">
1018            <arg value="/c" />
1019            <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" />
1020        </exec>
1021        <exec executable="cmd" osfamily="windows" failonerror="true">
1022                <arg value="/c" />
1023                <arg value="for %i in (pkg-temp\lib\*.jar) do pack200 -r %i" />
1024        </exec>
1025    </target>
1026
1027    <target name="updateTest" depends="prepupdate">
1028        <ant dir="core/java/" target="jarTest" />
1029        <copy file="core/java/build/i2ptest.jar" todir="pkg-temp/lib" />
1030        <zip destfile="i2pupdate.zip" basedir="pkg-temp" />
1031    </target>
1032
1033    <target name="prepupdate" depends="build2, prepupdateSmall, prepConsoleDocUpdates, prepCertificates, prep-script-translation">
1034        <copy file="build/BOB.jar" todir="pkg-temp/lib/" />
1035        <copy file="build/sam.jar" todir="pkg-temp/lib/" />
1036        <copy file="build/i2psnark.jar" todir="pkg-temp/lib" />
1037        <!-- include systray changes in 0.7.5 -->
1038        <copy file="build/systray.jar" todir="pkg-temp/lib/" />
1039       <!-- removed from updater in 0.9
1040        <copy file="build/desktopgui.jar" todir="pkg-temp/lib/" />
1041       -->
1042        <copy file="build/susimail.war" todir="pkg-temp/webapps/" />
1043        <copy file="build/susidns.war" todir="pkg-temp/webapps/" />
1044        <!-- as of 0.7.12; someday, we can remove these from the updater -->
1045        <copy file="apps/susidns/src/WEB-INF/lib/jstl.jar" todir="pkg-temp/lib/" />
1046        <copy file="apps/susidns/src/WEB-INF/lib/standard.jar" todir="pkg-temp/lib/" />
1047        <copy file="build/i2psnark.war" todir="pkg-temp/webapps/" />
1048        <copy file="history.txt" todir="pkg-temp/" />
1049        <!-- the following overwrites history.txt on unix to shrink the update file -->
1050        <exec executable="head" osfamily="unix" failifexecutionfails="true" output="pkg-temp/history.txt">
1051            <arg value="-n" />
1052            <arg value="1500" />
1053            <arg value="history.txt" />
1054        </exec>
1055        <exec executable="echo" osfamily="unix" failifexecutionfails="true" output="pkg-temp/history.txt" append="true">
1056            <arg value="&#10;&#10;----------------&#10;&#10;EARLIER HISTORY IS AVAILABLE IN THE SOURCE PACKAGE" />
1057        </exec>
1058        <copy file="installer/resources/deletelist.txt" todir="pkg-temp/" />
1059      <!-- May be pointless now, people with split directories will never see this,
1060           and for flat installs we don't want to overwrite news more recent than the update package.
1061        <copy file="installer/resources/news.xml" todir="pkg-temp/docs/" />
1062       -->
1063    </target>
1064
1065    <target name="prepupdateSmall" depends="buildSmall, prepupdateRouter, prepthemeupdates">
1066        <copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
1067        <copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
1068        <copy file="build/streaming.jar" todir="pkg-temp/lib/" />
1069        <copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
1070        <!-- pulled out of routerconsole.jar in 0.7.12, someday we can take out of updater -->
1071        <!-- name without version so we can overwrite if we upgrade  -->
1072        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
1073        <copy file="build/i2ptunnel.war" todir="pkg-temp/webapps/" />
1074        <copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
1075        <copy file="build/addressbook.war" todir="pkg-temp/webapps/" />
1076        <!-- decapitalized the file in 0.7.8 -->
1077       <copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
1078    </target>
1079
1080    <target name="prepupdateRouter" depends="buildrouter, deletepkg-temp">
1081        <copy file="build/i2p.jar" todir="pkg-temp/lib/" />
1082        <copy file="build/router.jar" todir="pkg-temp/lib/" />
1083    </target>
1084
1085    <!-- jbigi.jar -->
1086    <target name="prepjbigiupdate" depends="jbigi">
1087        <copy file="build/jbigi.jar" todir="pkg-temp/lib/" />
1088    </target>
1089
1090    <!-- GeoIP files and flag icons -->
1091    <target name="prepgeoupdate">
1092        <copy file="installer/resources/geoip.txt" todir="pkg-temp/geoip/" />
1093        <copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
1094        <copy todir="pkg-temp/docs/icons/flags" >
1095          <fileset dir="installer/resources/icons/flags" />
1096        </copy>
1097    </target>
1098
1099    <!-- All jetty jars required for update.
1100         We don't need commons-el or commons-logging, they haven't changed.
1101         TODO do we need to bother updating jasper?
1102         TODO where is JMX? We don't need it I hope.
1103      -->
1104    <target name="prepjupdate" depends="prepupdate, buildWEB">
1105        <copy todir="pkg-temp/lib" >
1106            <fileset dir="build" includes="commons*.jar jasper*.jar javax*.jar jetty*.jar jsp*.jar org.mortbay.*.jar" />
1107        </copy>
1108        <!--  We have to package the new eepsite files for MigrateJetty.java, but we
1109              can't overwrite an existing eepsite dir in a non-split configuration.
1110          -->
1111        <copy todir="pkg-temp/eepsite-jetty6" >
1112            <fileset dir="installer/resources/eepsite" includes="*.xml contexts/* etc/*" />
1113        </copy>
1114    </target>
1115
1116    <!-- Jetty 6 I2P logging addons, not really fixes -->
1117    <target name="prepjupdatefixes" depends="prepupdate, buildWEB">
1118        <copy file="build/jetty-i2p.jar" todir="pkg-temp/lib/" />
1119    </target>
1120
1121    <target name="util-list-changes" depends="checkForMtn" if="mtn.available" >
1122        <exec executable="mtn" outputproperty="workspace.changes.util" errorproperty="mtn.error.util" failifexecutionfails="false" >
1123            <arg value="list" />
1124            <arg value="changed" />
1125            <arg value="core/java/src/net/i2p/util" />
1126        </exec>
1127        <!-- \n in an attribute value generates an invalid manifest -->
1128        <exec executable="tr" inputstring="${workspace.changes.util}" outputproperty="workspace.changes.util.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
1129            <arg value="-s" />
1130            <arg value="[:space:]" />
1131            <arg value="," />
1132        </exec>
1133    </target>
1134
1135    <taskdef name="izpack"
1136             classpath="${basedir}/installer/lib/izpack/patches.jar:${basedir}/installer/lib/izpack/standalone-compiler.jar"
1137             classname="com.izforge.izpack.ant.IzPackTask" />
1138
1139    <target name="izpack-patches" >
1140        <jar destfile="${basedir}/installer/lib/izpack/patches.jar"
1141             basedir="${basedir}/installer/lib/izpack/patches" />
1142    </target>
1143
1144    <target name="installer" depends="preppkg, buildProperties, util-list-changes, izpack-patches" >
1145        <mkdir dir="pkg-temp/installer" />
1146        <!-- set if unset -->
1147        <property name="workspace.changes.util.tr" value="" />
1148        <jar destfile="./pkg-temp/installer/copy.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Copy.class net/i2p/util/FileUtil.class">
1149            <manifest>
1150                <attribute name="Main-Class" value="net.i2p.util.Copy" />
1151                <attribute name="Built-By" value="${build.built-by}" />
1152                <attribute name="Build-Date" value="${build.timestamp}" />
1153                <attribute name="Base-Revision" value="${workspace.version}" />
1154                <attribute name="Workspace-Changes" value="${workspace.changes.util.tr}" />
1155            </manifest>
1156        </jar>
1157        <jar destfile="./pkg-temp/installer/delete.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Delete.class net/i2p/util/FileUtil.class">
1158            <manifest>
1159                <attribute name="Main-Class" value="net.i2p.util.Delete" />
1160                <attribute name="Built-By" value="${build.built-by}" />
1161                <attribute name="Build-Date" value="${build.timestamp}" />
1162                <attribute name="Base-Revision" value="${workspace.version}" />
1163                <attribute name="Workspace-Changes" value="${workspace.changes.util.tr}" />
1164            </manifest>
1165        </jar>
1166        <jar destfile="./pkg-temp/installer/exec.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Exec.class">
1167            <manifest>
1168                <attribute name="Main-Class" value="net.i2p.util.Exec" />
1169                <attribute name="Built-By" value="${build.built-by}" />
1170                <attribute name="Build-Date" value="${build.timestamp}" />
1171                <attribute name="Base-Revision" value="${workspace.version}" />
1172                <attribute name="Workspace-Changes" value="${workspace.changes.util.tr}" />
1173            </manifest>
1174        </jar>
1175        <!--
1176          Force 1.5 pack200 output
1177          Doesnt work!
1178          http://jira.codehaus.org/browse/IZPACK-404
1179          http://forums.sun.com/thread.jspa?threadID=773439
1180          http://bfo.co.uk/blog/2010/05/13/combining_ant_jar_signatures_and_pack200.html
1181        <property name="com.sun.java.util.jar.pack.package.majver" value="150" />
1182        <property name="com.sun.java.util.jar.pack.package.minver" value="7" />
1183        -->
1184        <izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
1185
1186        <ant target="installerexe" />
1187    </target>
1188
1189    <target name="installerexe">
1190        <condition property="noExe">
1191            <os arch="x86_64" />
1192        </condition>
1193        <condition property="noExe">
1194            <os arch="amd64" />
1195        </condition>
1196        <condition property="noExe">
1197           <not>
1198            <or>
1199             <os name="Linux" />
1200             <os family="windows" />
1201            </or>
1202           </not>
1203        </condition>
1204        <ant target="doInstallerEXE" />
1205    </target>
1206
1207    <!-- this makes i2pinstall.exe from install.jar -->
1208    <target name="doInstallerEXE" unless="noExe">
1209        <!-- now the installer exe -->
1210        <launch4j configFile="./installer/i2pinstaller.xml" />
1211        <!-- thazzit -->
1212    </target>
1213
1214    <!-- Custom installers -->
1215    <target name="installer-nowindows" depends="clean, preppkg-nowindows, izpack-patches" >
1216        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}.jar" installerType="standard" basedir="${basedir}" />
1217    </target>
1218
1219
1220    <target name="installer-freebsd" depends="clean, preppkg-freebsd-only, izpack-patches" >
1221        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_freebsd-only.jar" installerType="standard" basedir="${basedir}" />
1222    </target>
1223
1224    <target name="installer-linux" depends="clean, preppkg-linux-only, izpack-patches" >
1225        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_linux-only.jar" installerType="standard" basedir="${basedir}" />
1226    </target>
1227
1228
1229    <target name="installer-osx" depends="clean, checkForIzpack2App, preppkg-osx-only, izpack-patches">
1230        <mkdir dir="pkg-temp/osx" />
1231        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_osx-only.jar" installerType="standard" basedir="${basedir}" />
1232        <ant target="installer2app" />
1233        <delete dir="pkg-temp/osx" />
1234    </target>
1235
1236    <target name="checkForIzpack2App">
1237        <available property="izpack2app.available" file="${user.home}/IzPack/utils/wrappers/izpack2app/izpack2app.py" />
1238    </target>
1239
1240    <target name="installer2app" if="izpack2app.available">
1241        <mkdir dir="pkg-temp/osx" />
1242        <exec executable="python" failonerror="true">
1243            <arg value="${user.home}/IzPack/utils/wrappers/izpack2app/izpack2app.py" />
1244            <arg value="${basedir}/i2pinstall_${full.version}_osx-only.jar" />
1245            <arg value="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" />
1246        </exec>
1247        <exec executable="chmod" failonerror="true" osfamily="unix">
1248                <arg value="755" />
1249                <arg value="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app/Contents/MacOS/JavaApplicationStub" />
1250        </exec>
1251        <exec executable="tar" osfamily="unix" failonerror="true">
1252                <arg value="--owner=root" />
1253                <arg value="--group=root" />
1254                <arg value="-cjvf" />
1255                <arg value="${basedir}/i2pinstall_${full.version}_osx.tar.bz2" />
1256                <arg value="-C" />
1257                <arg value="${basedir}/pkg-temp/osx" />
1258                <arg value="i2p-${full.version}_osx-install.app" />
1259        </exec>
1260    </target>
1261
1262    <target name="installer-windows" depends="clean, preppkg-windows-only, util-list-changes, izpack-patches" >
1263        <mkdir dir="pkg-temp/installer" />
1264        <!-- set if unset -->
1265        <property name="workspace.changes.util.tr" value="" />
1266        <jar destfile="./pkg-temp/installer/copy.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Copy.class net/i2p/util/FileUtil.class">
1267            <manifest>
1268                <attribute name="Main-Class" value="net.i2p.util.Copy" />
1269                <attribute name="Built-By" value="${build.built-by}" />
1270                <attribute name="Build-Date" value="${build.timestamp}" />
1271                <attribute name="Base-Revision" value="${workspace.version}" />
1272                <attribute name="Workspace-Changes" value="${workspace.changes.util.tr}" />
1273            </manifest>
1274        </jar>
1275        <jar destfile="./pkg-temp/installer/delete.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Delete.class net/i2p/util/FileUtil.class">
1276            <manifest>
1277                <attribute name="Main-Class" value="net.i2p.util.Delete" />
1278                <attribute name="Built-By" value="${build.built-by}" />
1279                <attribute name="Build-Date" value="${build.timestamp}" />
1280                <attribute name="Base-Revision" value="${workspace.version}" />
1281                <attribute name="Workspace-Changes" value="${workspace.changes.util.tr}" />
1282            </manifest>
1283        </jar>
1284        <jar destfile="./pkg-temp/installer/exec.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Exec.class">
1285            <manifest>
1286                <attribute name="Main-Class" value="net.i2p.util.Exec" />
1287                <attribute name="Built-By" value="${build.built-by}" />
1288                <attribute name="Build-Date" value="${build.timestamp}" />
1289                <attribute name="Base-Revision" value="${workspace.version}" />
1290                <attribute name="Workspace-Changes" value="${workspace.changes.util.tr}" />
1291            </manifest>
1292        </jar>
1293        <izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
1294        <ant target="installerexe" />
1295        <delete file="${basedir}/install.jar" />
1296        <move file="${basedir}/i2pinstall.exe" tofile="${basedir}/i2pinstall_${full.version}_windows-only.exe" />
1297    </target>
1298
1299    <target name="installer-all" depends="installer-freebsd, installer-linux, installer-osx, installer-windows, installer" >
1300    </target>
1301    <!-- end custom installers -->
1302
1303    <target name="test" depends="buildProperties, jbigi" >
1304        <mkdir dir="reports/core/junit/" />
1305        <ant dir="core/java/" target="test" />
1306    </target>
1307    <target name="junit.report" depends="buildProperties" >
1308        <ant dir="core/java/" target="junit.report" />
1309    </target>
1310    <target name="clover.report" depends="buildProperties" >
1311        <ant dir="core/java/" target="clover.report" />
1312    </target>
1313    <target name="test.report" depends="junit.report, clover.report"/>
1314    <target name="fulltest" depends="buildProperties" >
1315                <ant dir="core/java/" target="fulltest" />
1316                <ant dir="router/java/" target="fulltest" />
1317    </target>
1318    <target name="fullclovertest" depends="buildProperties" >
1319                <ant dir="core/java/" target="fullclovertest" />
1320                <ant dir="router/java/" target="fullclovertest" />
1321    </target>
1322
1323    <target name="testscripts" >
1324        <exec executable="tests/scripts/checkcerts.sh" failonerror="true" />
1325        <exec executable="tests/scripts/checkpo.sh" failonerror="true" />
1326        <exec executable="tests/scripts/checkutf8.sh" failonerror="true" />
1327        <exec executable="tests/scripts/checkxml.sh" failonerror="true" />
1328    </target>
1329
1330
1331    <!-- <target name="syndie" >
1332        <ant dir="apps/syndie/java/" target="standalone" />
1333        <copy file="apps/syndie/java/syndie-standalone.zip" todir="." />
1334    </target> -->
1335    <target name="i2psnark" depends="buildProperties" >
1336        <ant dir="apps/i2psnark/java" target="standalone" />
1337        <copy file="apps/i2psnark/java/i2psnark-standalone.zip" todir="." />
1338    </target>
1339    <target name="slackpkg">
1340        <echo message="Building Slackware package." />
1341        <ant dir="Slackware/i2p/" target="slackpkg" />
1342        <ant dir="Slackware/i2p-base/" target="slackpkg" />
1343    </target>
1344    <target name="justBOB" depends="builddepSmall">
1345        <ant dir="apps/BOB/" target="onejar" />
1346        <copy file="apps/BOB/dist/BOB-one.jar" todir="." />
1347    </target>
1348    <target name="findbugs" depends="build2">
1349        <echo message="Starting findbugs, this will take a while..." />
1350        <exec executable="nice" failonerror="true">
1351            <arg value="findbugs"/>
1352            <arg value="-textui"/>
1353            <arg value="-projectName"/>
1354            <arg value="i2p"/>
1355            <arg value="-sortByClass"/>
1356            <arg value="-xml"/>
1357            <arg value="-output"/>
1358            <arg value="i2p.fba"/>
1359            <arg value="-auxclasspath"/>
1360            <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"/>
1361            <arg value="-sourcepath"/>
1362            <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/"/>
1363            <!-- start of the files to be analyzed -->
1364            <arg value="build/BOB.jar"/>
1365            <arg value="build/addressbook.war"/>
1366            <arg value="build/i2p.jar"/>
1367            <arg value="build/i2psnark.jar"/>
1368            <arg value="build/i2psnark.war"/>
1369            <arg value="build/i2ptunnel.jar"/>
1370            <arg value="build/i2ptunnel.war"/>
1371            <arg value="build/mstreaming.jar"/>
1372            <arg value="build/router.jar/"/>
1373            <arg value="build/desktopgui.jar"/>
1374            <arg value="build/routerconsole.jar"/>
1375            <arg value="build/routerconsole.war"/>
1376            <arg value="build/sam.jar"/>
1377            <arg value="build/streaming.jar"/>
1378            <arg value="build/susidns.war"/>
1379            <arg value="build/susimail.war"/>
1380            <arg value="build/systray.jar"/>
1381        </exec>
1382        <echo message="Findbugs output stored in i2p.fba" />
1383        <echo message="Now run: findbugs i2p.fba" />
1384    </target>
1385
1386    <!-- this is the same dependency as pkg, but with updater200 in the middle,
1387         since preppkg puts too much stuff in pkg-temp -->
1388<!--
1389    <target name="release" depends="distclean, updaterWithJettyFixesAndJbigi , updater200WithJettyFixes, preppkg, installer, getReleaseNumber" >
1390-->
1391    <target name="release" depends="verifyReleaseBuildNumbers, distclean, testscripts, updaterRepack, updater200, preppkgRepack, installer" >
1392        <echo message="================================================================" />
1393        <echo message="Did you update these files?" />
1394        <exec executable="ls" failonerror="true">
1395            <arg value="-l" />
1396            <arg value="history.txt" />
1397            <arg value="installer/install.xml" />
1398            <arg value="installer/resources/news.xml" />
1399            <arg value="core/java/src/net/i2p/CoreVersion.java" />
1400            <arg value="router/java/src/net/i2p/router/RouterVersion.java" />
1401        </exec>
1402        <echo message="Everything is checked in, right? Let's be sure:" />
1403        <exec executable="mtn" failonerror="true">
1404            <arg value="st" />
1405        </exec>
1406        <echo message="If there are any modified files above, stop now!" />
1407
1408        <echo message="New version number is ${release.number}" />
1409        <copy file="i2pupdate.zip" tofile="i2pupdate_${release.number}.zip" />
1410        <copy file="i2pinstall.exe" tofile="i2pinstall_${release.number}.exe" />
1411        <delete file="i2pupdate.sud" />
1412        <delete file="i2pupdate.su2" />
1413        <!-- make this a lot easier by putting release.privkey=/path/to/privkey in override.properties -->
1414        <input message="Enter private signing key file:" addproperty="release.privkey" />
1415        <fail message="You must enter a path." >
1416            <condition>
1417                <equals arg1="${release.privkey}" arg2=""/>
1418            </condition>
1419        </fail>
1420        <echo message="Key file is ${release.privkey}" />
1421        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
1422            <classpath>
1423                <pathelement location="build/i2p.jar" />
1424            </classpath>
1425            <arg value="sign" />
1426            <arg value="i2pupdate.zip" />
1427            <arg value="i2pupdate.sud" />
1428            <arg value="${release.privkey}" />
1429            <arg value="${release.number}" />
1430        </java>
1431        <echo message="Verify version and VALID signature:" />
1432        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
1433            <classpath>
1434                <pathelement location="build/i2p.jar" />
1435            </classpath>
1436            <arg value="verifysig" />
1437            <arg value="i2pupdate.sud" />
1438        </java>
1439        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
1440            <classpath>
1441                <pathelement location="build/i2p.jar" />
1442            </classpath>
1443            <arg value="verifyversion" />
1444            <arg value="i2pupdate.sud" />
1445        </java>
1446        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
1447            <classpath>
1448                <pathelement location="build/i2p.jar" />
1449            </classpath>
1450            <arg value="showversion" />
1451            <arg value="i2pupdate.sud" />
1452        </java>
1453        <!-- now build and verify the packed sud from the packed zip -->
1454        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
1455            <classpath>
1456                <pathelement location="build/i2p.jar" />
1457            </classpath>
1458            <arg value="sign" />
1459            <arg value="i2pupdate200.zip" />
1460            <arg value="i2pupdate.su2" />
1461            <arg value="${release.privkey}" />
1462            <arg value="${release.number}" />
1463        </java>
1464        <echo message="Verify version and VALID signature:" />
1465        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
1466            <classpath>
1467                <pathelement location="build/i2p.jar" />
1468            </classpath>
1469            <arg value="verifysig" />
1470            <arg value="i2pupdate.su2" />
1471        </java>
1472        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
1473            <classpath>
1474                <pathelement location="build/i2p.jar" />
1475            </classpath>
1476            <arg value="verifyversion" />
1477            <arg value="i2pupdate.su2" />
1478        </java>
1479        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
1480            <classpath>
1481                <pathelement location="build/i2p.jar" />
1482            </classpath>
1483            <arg value="showversion" />
1484            <arg value="i2pupdate.su2" />
1485        </java>
1486        <!-- will this use the monotonerc file in the current workspace? -->
1487        <echo message="Checking out fresh copy into ../i2p-${release.number} for tarballing:" />
1488        <delete dir="../i2p-${release.number}" />
1489        <exec executable="mtn" failonerror="true">
1490            <arg value="co" />
1491            <arg value="-b" />
1492            <arg value="i2p.i2p" />
1493            <!-- w: is the revision of the current workspace -->
1494            <arg value="-r" />
1495            <arg value="w:" />
1496            <arg value="../i2p-${release.number}/" />
1497        </exec>
1498        <exec executable="tar" failonerror="true">
1499            <arg value="cjf" />
1500            <arg value="i2psource_${release.number}.tar.bz2" />
1501            <arg value="-C" />
1502            <arg value=".." />
1503            <arg value="--exclude" />
1504            <arg value="i2p-${release.number}/_MTN*" />
1505            <arg value="i2p-${release.number}/" />
1506        </exec>
1507        <echo message="Sign the files:" />
1508        <delete file="i2pinstall_${release.number}.exe.sig" />
1509        <delete file="i2psource_${release.number}.tar.bz2.sig" />
1510        <delete file="i2pupdate_${release.number}.zip.sig" />
1511        <exec executable="gpg" failonerror="true">
1512            <arg value="-b" />
1513            <arg value="i2pinstall_${release.number}.exe" />
1514        </exec>
1515        <exec executable="gpg" failonerror="true">
1516            <arg value="-b" />
1517            <arg value="i2psource_${release.number}.tar.bz2" />
1518        </exec>
1519        <exec executable="gpg" failonerror="true">
1520            <arg value="-b" />
1521            <arg value="i2pupdate_${release.number}.zip" />
1522        </exec>
1523        <exec executable="chmod" failonerror="true">
1524            <arg value="444" />
1525            <arg value="i2pinstall_${release.number}.exe" />
1526            <arg value="i2psource_${release.number}.tar.bz2" />
1527            <arg value="i2pupdate_${release.number}.zip" />
1528            <arg value="i2pupdate.su2" />
1529            <arg value="i2pupdate.sud" />
1530            <arg value="i2pinstall_${release.number}.exe.sig" />
1531            <arg value="i2psource_${release.number}.tar.bz2.sig" />
1532            <arg value="i2pupdate_${release.number}.zip.sig" />
1533        </exec>
1534        <echo message="File sizes:" />
1535        <exec executable="ls" failonerror="true">
1536            <arg value="-l" />
1537            <arg value="i2pinstall_${release.number}.exe" />
1538            <arg value="i2psource_${release.number}.tar.bz2" />
1539            <arg value="i2pupdate_${release.number}.zip" />
1540            <arg value="i2pupdate.su2" />
1541            <arg value="i2pupdate.sud" />
1542            <arg value="i2pinstall_${release.number}.exe.sig" />
1543            <arg value="i2psource_${release.number}.tar.bz2.sig" />
1544            <arg value="i2pupdate_${release.number}.zip.sig" />
1545        </exec>
1546        <echo message="SHA256 sums:" />
1547        <exec executable="sha256sum" failonerror="true">
1548            <arg value="i2pinstall_${release.number}.exe" />
1549            <arg value="i2psource_${release.number}.tar.bz2" />
1550            <arg value="i2pupdate_${release.number}.zip" />
1551            <arg value="i2pupdate.su2" />
1552            <arg value="i2pupdate.sud" />
1553        </exec>
1554        <echo message="Don't forget to mtn tag w: i2p-${release.number}" />
1555        <echo message="... and mtn cert t:i2p-${release.number} branch i2p.i2p.release" />
1556    </target>
1557
1558    <target name="debian" depends="debian-clean, debian-binary" />
1559
1560    <target name="debian-binary" >
1561        <echo message="Did you update the version using dch -i?" />
1562        <echo message=" " />
1563        <echo message="If the changelog was not updated with dch -i, press" />
1564        <echo message="press CTRL+C to abort building this Debian package." />
1565        <echo message="" />
1566        <echo message="Pausing build for ten seconds to give enough time to read this notice." />
1567        <exec executable="sleep" failonerror="true">
1568                <arg value="10" />
1569        </exec>
1570        <echo message="====================" />
1571
1572        <exec executable="fakeroot" failonerror="true">
1573            <arg value="debian/rules" />
1574            <arg value="patch" />
1575            <arg value="binary" />
1576            <arg value="clean" />
1577        </exec>
1578        <delete dir=".pc" />
1579    </target>
1580
1581    <target name="debian-clean" depends="buildProperties" >
1582        <exec executable="fakeroot" failonerror="true">
1583            <arg value="debian/rules" />
1584            <arg value="clean" />
1585        </exec>
1586        <delete dir="./.pc" />
1587    </target>
1588
1589    <target name="debian-patch" depends="buildProperties" >
1590        <exec executable="quilt" failonerror="true">
1591            <arg value="-a" />
1592            <arg value="push" />
1593        </exec>
1594        <echo message="====================" />
1595    </target>
1596    <target name="debian-unpatch" depends="buildProperties">
1597        <exec executable="quilt" failonerror="false">
1598            <arg value="-a" />
1599            <arg value="pop" />
1600        </exec>
1601    </target>
1602
1603    <target name="debianrepo" depends="debian">
1604        <exec dir="debian" executable="./makerepo.sh" failonerror="true"/>
1605    </target>
1606
1607<!-- the following are appened to help build barebone portable version,
1608     none of the above is modified for this purpose -->
1609        <target name = "pkg-portable-clean">
1610                <delete dir="build/" />
1611                <delete dir="pkg-temp/" />
1612                <delete>
1613                        <fileset dir="." includes="portable-**.zip**" />
1614                </delete>
1615        </target>
1616<!-- build a portable archive -->
1617
1618<!-- *0* Since we simply pack all files in folder "build/" into our archieve,
1619                we need to make sure its small, with NO redundent jars or wars.
1620                thus cleaning is required before each build-->
1621        <target name="buildSmallOnly" depends="pkg-portable-clean,buildSmall"/>
1622
1623<!-- *1* preparing the jars by OS dependent de-bloating -->
1624        <target name="preppkg-portable-win32-jbigi" depends="buildSmallOnly, jbigi-windows-only" />
1625
1626        <target name="preppkg-portable-linux-jbigi"  depends="buildSmallOnly, jbigi-linux-only" />
1627
1628<!-- *2* os independent procedure  -->
1629        <target name="preppkg-portable-basic" >
1630                <mkdir dir="pkg-temp" />
1631                        <!-- non OS dependent configurations only, dont add *nux/win stuff here -->
1632                        <copy todir="pkg-temp">
1633                                <fileset dir="installer/resources/portable/configs/" />
1634                        </copy>
1635                        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
1636                        <copy file="installer/resources/hosts.txt" todir="pkg-temp/" />
1637                        <copy file="installer/resources/readme.license.txt" todir="pkg-temp/" />
1638                <mkdir dir="pkg-temp/addressbook" />
1639                        <copy file="apps/addressbook/subscriptions.txt" todir="pkg-temp/addressbook/" />
1640                        <copy file="apps/addressbook/myhosts.txt"  todir="pkg-temp/addressbook/" />
1641                        <!-- config.txt is in installer/resources/portable -->
1642                <mkdir dir="pkg-temp/docs" />
1643                        <copy file="installer/resources/initialNews/initialNews.xml" tofile="pkg-temp/docs/news.xml" overwrite="true" />
1644                        <copy file="installer/resources/readme/readme.html" tofile="pkg-temp/docs/readme.html" />
1645                        <copy file="installer/resources/startconsole.html" todir="pkg-temp/docs/" />
1646                        <copy file="installer/resources/start.ico" todir="pkg-temp/docs/" />
1647                        <copy file="installer/resources/console.ico" todir="pkg-temp/docs/" />
1648                        <!-- HTTP Header files, english only,
1649                                if you need a different lang do it in a seperate target -->
1650                        <copy todir="pkg-temp/docs/" >
1651                                <fileset dir="installer/resources/proxy/"  includes="**-header.ht" />
1652                        </copy>
1653                        <!-- Theme light only -->
1654                        <copy todir="pkg-temp/docs/themes/console/light/" overwrite="true" >
1655                                <fileset dir="installer/resources/themes/console/light/" includes="**.css" />
1656                        </copy>
1657                        <copy file="installer/resources/themes/console/light/console_big.css" todir="portable/docs/themes/console/light/" />
1658                        <copy todir="pkg-temp/docs/themes/console/images/" >
1659                                <fileset dir="installer/resources/themes/console/images/" />
1660                        </copy>
1661                        <!-- FLAGs for language icon (not for ip)-->
1662                        <copy todir="pkg-temp/docs/icons/flags" >
1663                                <fileset dir="installer/resources/icons/flags/" includes="cn.png,de.png,fr.png,nl.png,ru.png,se.png,us.png" />
1664                        </copy>
1665                <mkdir dir="pkg-temp/webapps" />
1666                        <copy todir="pkg-temp/webapps/">
1667                                <fileset dir="build/" includes="**.war" />
1668                        </copy>
1669                <mkdir dir="pkg-temp/lib" />
1670                        <copy todir ="pkg-temp/lib/" >
1671                                <fileset dir="build/" includes="**.jar" />
1672                        </copy>
1673                        <!-- 3rd party jars from apps/  -->
1674                                <!-- jrobin - without jobin , you lost graph and get a lot error entry in logs -->
1675                        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
1676        </target>
1677<!-- *3* os dependent procedure/commands -->
1678        <target name = "preppkg-portable-win32" depends="preppkg-portable-win32-jbigi,preppkg-portable-basic">
1679                        <!-- systray4.j  - why do we need trayicons for portable version ? dependency hardcoded in console -->
1680                <copy file="apps/systray/java/lib/systray4j.dll" todir="pkg-temp/lib" />
1681                <copy file="apps/systray/java/lib/systray4j.jar" todir="pkg-temp/lib" />
1682                        <!--wrapper - dont even think about it. i2p cosumes appreantly more mem without it on win32-->
1683                <copy file="installer/lib/wrapper/win32/wrapper.dll" todir="pkg-temp/lib" />
1684                <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
1685                <copy file="installer/lib/wrapper/win32/I2Psvc.exe" tofile="pkg-temp/i2psvc.ex_" />
1686                        <!--  copy the unpack/start batchfiles -->
1687                <copy todir="pkg-temp">
1688                        <fileset dir="installer/resources/portable/win32/" />
1689                </copy>
1690        </target>
1691<!-- *4* command for windows package -->
1692        <target name = "pkg-portable-win32"     depends="preppkg-portable-win32, pack200" >
1693                <!-- i need the portable\ folder in .zip so basedir is set to . -->
1694                <move file="pkg-temp" tofile="portable"/>
1695                <zip destfile="portable-win32.zip" basedir="." level="9" includes="portable\**" />
1696                <checksum file="portable-win32.zip" forceOverwrite="yes"/>
1697                <move file="portable" tofile="pkg-temp"/>
1698        </target>
1699</project>
Note: See TracBrowser for help on using the repository browser.