source: build.xml @ 33b25b57

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