source: build.xml @ 8340549

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

Black flags
created by me, public domain

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