source: build.xml @ 92b9d0a

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

First cut at migrating to Jetty 6 and prep for using an external
Jetty 6 package.

  • Add several jars from the Jetty 6 distribution
  • Update jetty.xml
  • Add context XML files
  • Update WorkingDir? to migrate the content XML files
  • Update RouterConsoleRunner? and LocaleWebAppHandler?
  • Remove all old Jetty 5.1.15 local mods; this will break Seedless using a custom Server() constructor
  • Update I2PRequestLog to be a mod of NCSARequestLog from 6.1.26
  • Put I2PRequestLog in its own jar
  • Copy MultiPartRequest? and other required classes from Jetty 5.1.15 and add it to susimail, as the replacement MultiPartFilter? in Jetty 6 is difficult to migrate to, and does not support content-type
  • Update i2psnark for Jetty 6
  • Disable i2psnark RunStandalone?, unused and instantiated Jetty 5
  • Fix up all webapp build.xml to reference new jars

Not yet working: Plugin/webapp run detection and stopping, eepsite CGI
Not well tested: Plugins, classpaths, webapps

  • Property mode set to 100644
File size: 74.6 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 todir="build/" >
198            <fileset dir="apps/jetty/jettylib" excludes="ant.jar" />
199        </copy>
200    </target>
201
202    <target name="buildexe">
203        <condition property="noExe">
204            <os arch="x86_64" />
205        </condition>
206        <condition property="noExe">
207            <os arch="ppc" />
208        </condition>
209        <condition property="noExe">
210            <os arch="armv5tejl" />
211        </condition>
212        <condition property="noExe">
213            <os arch="amd64" />
214        </condition>
215        <condition property="noExe">
216           <not>
217            <or>
218             <os name="Linux" />
219             <os family="windows" />
220            </or>
221           </not>
222        </condition>
223        <ant target="doBuildEXE" />
224    </target>
225
226    <taskdef name="launch4j"
227             classname="net.sf.launch4j.ant.Launch4jTask"
228             classpath="${basedir}/installer/lib/launch4j/launch4j.jar:${basedir}/installer/lib/launch4j/lib/xstream.jar" />
229
230    <target name="doBuildEXE" depends="buildProperties" unless="noExe">
231        <jar destfile="./build/launchi2p.jar">
232            <manifest>
233             <attribute name="Main-Class" value="net.i2p.router.RouterLaunch" />
234             <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" />
235             <attribute name="Build-Date" value="${build.timestamp}" />
236             <attribute name="Base-Revision" value="${workspace.version}" />
237            </manifest>
238        </jar>
239        <!-- now the standalone launcher exe -->
240        <launch4j configFile="./installer/i2pstandalone.xml" />
241        <!-- thazzit -->
242    </target>
243
244    <target name="jar" depends="jarSmall" >
245        <copy file="apps/BOB/dist/BOB.jar" todir="build/" />
246        <copy file="apps/sam/java/build/sam.jar" todir="build/" />
247        <copy file="apps/susimail/susimail.war" todir="build/" />
248        <copy file="apps/susidns/src/susidns.war" todir="build/" />
249        <copy file="apps/i2psnark/i2psnark.war" todir="build/" />
250        <copy file="apps/i2psnark/java/build/i2psnark.jar" todir="build/" />
251
252    </target>
253    <target name="jarSmall" depends="builddepSmall, buildJrobin" >
254        <copy file="core/java/build/i2p.jar" todir="build/" />
255        <copy file="router/java/build/router.jar" todir="build/" />
256        <copy file="apps/ministreaming/java/build/mstreaming.jar" todir="build/" />
257        <copy file="apps/streaming/java/build/streaming.jar" todir="build/" />
258        <copy file="apps/i2ptunnel/java/build/i2ptunnel.jar" todir="build/" />
259        <copy file="apps/i2ptunnel/java/build/i2ptunnel.war" todir="build/" />
260        <copy file="apps/systray/java/build/systray.jar" todir="build/" />
261        <copy file="apps/desktopgui/dist/desktopgui.jar" todir="build/" />
262        <copy file="apps/addressbook/dist/addressbook.war" todir="build/" />
263    </target>
264
265    <target name="jbigi-list-changes" depends="checkForMtn" if="mtn.available" >
266        <exec executable="mtn" outputproperty="workspace.changes.jbigi" errorproperty="mtn.error.jbigi" failifexecutionfails="false" >
267            <arg value="list" />
268            <arg value="changed" />
269            <arg value="installer/lib/jbigi" />
270        </exec>
271        <!-- \n in an attribute value generates an invalid manifest -->
272        <exec executable="tr" inputstring="${workspace.changes.jbigi}" outputproperty="workspace.changes.jbigi.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
273            <arg value="-s" />
274            <arg value="&quot;[:space:]&quot;" />
275            <arg value="," />
276        </exec>
277    </target>
278
279    <target name="jbigi" depends="buildProperties, jbigi-list-changes" >
280        <!-- set if unset -->
281        <property name="workspace.changes.jbigi.tr" value="" />
282        <jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
283            <fileset dir="installer/lib/jbigi" includes="*.so *.dll *.jnilib" />
284            <manifest>
285                <attribute name="Build-Date" value="${build.timestamp}" />
286                <attribute name="Base-Revision" value="${workspace.version}" />
287                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
288            </manifest>
289        </jar>
290    </target>
291   
292    <!-- Now system-specific jbigis in alphabetical order -->
293    <target name="jbigi-freebsd-only"  depends="buildProperties, jbigi-list-changes" >
294        <!-- set if unset -->
295        <property name="workspace.changes.jbigi.tr" value="" />
296        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
297            <fileset dir="installer/lib/jbigi" includes="*freebsd*.so" />
298            <manifest>
299                <attribute name="Build-Date" value="${build.timestamp}" />
300                <attribute name="Base-Revision" value="${workspace.version}" />
301                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
302            </manifest>
303        </jar>
304    </target>
305
306    <target name="jbigi-linux-only"  depends="buildProperties, jbigi-list-changes" >
307        <!-- set if unset -->
308        <property name="workspace.changes.jbigi.tr" value="" />
309        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
310            <fileset dir="installer/lib/jbigi" includes="*linux*.so" />
311            <manifest>
312                <attribute name="Build-Date" value="${build.timestamp}" />
313                <attribute name="Base-Revision" value="${workspace.version}" />
314                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
315            </manifest>
316        </jar>
317    </target>
318
319    <target name="jbigi-linux-nonx86-only"  depends="buildProperties, jbigi-list-changes" >
320        <!-- set if unset -->
321        <property name="workspace.changes.jbigi.tr" value="" />
322        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
323            <fileset dir="installer/lib/jbigi" includes="*linux-arm*.so,*linux-ppc*.so" />
324            <manifest>
325                <attribute name="Build-Date" value="${build.timestamp}" />
326                <attribute name="Base-Revision" value="${workspace.version}" />
327                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
328            </manifest>
329        </jar>
330    </target>
331
332    <target name="jbigi-osx-only"  depends="buildProperties, jbigi-list-changes" >
333        <!-- set if unset -->
334        <property name="workspace.changes.jbigi.tr" value="" />
335        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
336            <fileset dir="installer/lib/jbigi" includes="*.jnilib" />
337            <manifest>
338                <attribute name="Build-Date" value="${build.timestamp}" />
339                <attribute name="Base-Revision" value="${workspace.version}" />
340                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
341            </manifest>
342        </jar>
343    </target>
344
345    <target name="jbigi-windows-only" depends="buildProperties, jbigi-list-changes" >
346        <!-- set if unset -->
347        <property name="workspace.changes.jbigi.tr" value="" />
348        <jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
349            <fileset dir="installer/lib/jbigi" includes="*windows*.dll" />
350            <manifest>
351                <attribute name="Build-Date" value="${build.timestamp}" />
352                <attribute name="Base-Revision" value="${workspace.version}" />
353                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
354            </manifest>
355        </jar>
356    </target>
357
358    <!-- the apps need to compile the jsps to poupdate -->
359    <target name="poupdate" depends="buildRouter, buildStreaming, buildSystray, buildJetty, buildDesktopGui" >
360        <echo message="Setting environment variable LG2 to a lang code (eg: de,zh,nl etc)" />
361        <echo message=" will restrict language update to the language you specified, leaving other language untact." />
362        <ant dir="apps/routerconsole/java/" target="poupdate" />
363        <ant dir="apps/i2psnark/java/" target="poupdate" />
364        <ant dir="apps/i2ptunnel/java/" target="poupdate" />
365        <ant dir="apps/susidns/src/" target="poupdate" />
366        <ant dir="apps/susimail/" target="poupdate" />
367        <ant dir="apps/desktopgui" target="poupdate" />
368    </target>
369
370    <target name="javadoc" depends="getReleaseNumber, getBuildNumber" >
371        <ant dir="apps/jetty" target="ensureJettylib" />
372        <mkdir dir="./build" />
373        <mkdir dir="./build/javadoc" />
374        <javadoc access="package"
375            destdir="./build/javadoc"
376            packagenames="*"
377            use="true"
378            splitindex="true"
379            doctitle="I2P Javadocs for Release ${release.number} Build ${build.number}"
380            windowtitle="I2P Anonymous Network - Java Documentation - Version ${release.number}">
381            <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.*" />
382            <group title="Streaming Library" packages="net.i2p.client.streaming" />
383            <group title="Router" packages="net.i2p.router:net.i2p.router.*:net.i2p.data.i2np:org.cybergarage.*:org.freenetproject" />
384            <group title="Router Console" packages="net.i2p.router.web" />
385            <!-- apps and bridges starting here, alphabetical please -->
386            <group title="Addressbook Application" packages="net.i2p.addressbook" />
387            <group title="BOB Bridge" packages="net.i2p.BOB" />
388            <group title="Desktopgui Application" packages="net.i2p.desktopgui.*" />
389            <group title="I2PSnark Application" packages="org.klomp.snark:org.klomp.snark.*" />
390            <group title="I2PTunnel Application" packages="net.i2p.i2ptunnel:net.i2p.i2ptunnel.*" />
391            <group title="Jetty Logging" packages="org.mortbay.http" />
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:org.mortbay.servlet:org.mortbay.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                <pathelement location="apps/jetty/java/src" />
414            </sourcepath>
415            <classpath>
416                <pathelement location="apps/jetty/jettylib/org.mortbay.jetty.jar" />
417                <pathelement location="apps/jetty/jettylib/javax.servlet.jar" />
418                <pathelement location="apps/jetty/jettylib/jetty-sslengine.jar" />
419                <pathelement location="apps/jetty/jettylib/jetty-start.jar" />
420                <pathelement location="apps/jetty/jettylib/jetty-threadpool.jar" />
421                <pathelement location="apps/jetty/jettylib/jetty-util.jar" />
422                <pathelement location="apps/jetty/jettylib/jsp-api.jar" />
423                <pathelement location="apps/systray/java/lib/systray4j.jar" />
424                <pathelement location="apps/jrobin/jrobin-1.5.9.1.jar" />
425                <pathelement location="installer/lib/wrapper/all/wrapper.jar" />
426                <pathelement location="core/lib/junit.jar" />
427            </classpath>
428            <!-- These variables are stored in build.properties.
429                 End-users can override by creating the file override.properties -->
430            <link offline="true" href="${javasedocs.url}" packagelistLoc="installer/resources/package-lists/java/" />
431            <link offline="true" href="${jettydocs.url}" packagelistLoc="installer/resources/package-lists/jetty/" />
432            <link offline="true" href="${jrobindocs.url}" packagelistLoc="installer/resources/package-lists/jrobin/" />
433            <link offline="true" href="${wrapperdocs.url}" packagelistLoc="installer/resources/package-lists/wrapper/" />
434        </javadoc>
435        <echo message="Warning, javadoc embeds timestamps in the output, run with 'TZ=UTC ant javadoc' if you plan to distribute" />
436    </target>
437
438    <target name="getReleaseNumber" >
439        <exec executable="grep" outputproperty="versionLine" failonerror="true" >
440            <arg value="public final static String VERSION" />
441            <arg value="core/java/src/net/i2p/CoreVersion.java" />
442        </exec>
443        <exec executable="cut" osfamily="unix" inputstring="${versionLine}" outputproperty="release.number" failonerror="true" >
444            <arg value="-f2" />
445            <arg value="-d&quot;" />
446        </exec>
447        <exec executable="cut" osfamily="mac" inputstring="${versionLine}" outputproperty="release.number" failonerror="true" >
448            <arg value="-f2" />
449            <arg value="-d&quot;"/>
450        </exec>
451        <exec executable="cut" osfamily="windows" inputstring="${versionLine}" outputproperty="release.number" failonerror="true" >
452            <arg value="-f2" />
453            <arg value="-d&quot;\&quot;&quot;"/>
454        </exec>
455        <echo message="Release number is ${release.number}" />
456    </target>
457
458    <target name="getBuildNumber" >
459        <exec executable="grep" outputproperty="buildLine" >
460            <arg value="public final static long BUILD" />
461            <arg value="router/java/src/net/i2p/router/RouterVersion.java" />
462        </exec>
463        <exec executable="cut" inputstring="${buildLine}" outputproperty="build.temp" failonerror="true" >
464            <arg value="-f2" />
465            <arg value="-d=" />
466        </exec>
467        <exec executable="tr" inputstring="${build.temp}" outputproperty="build.temp.tr" failonerror="true">
468            <arg value="-d" />
469            <arg value="&quot;[:space:]&quot;"/>
470        </exec>
471        <exec executable="cut" inputstring="${build.temp.tr}" outputproperty="build.number" failonerror="true" >
472            <arg value="-f1" />
473            <arg value="-d;" />
474        </exec>
475        <echo message="Build number is ${build.number}" />
476    </target>
477
478    <target name="clean" depends="pkgclean" >
479        <delete dir="./build" />
480        <delete file="installer/lib/izpack/patches.jar" failonerror="false" quiet="true" />     
481        <delete file="i2pinstall.exe" failonerror="false" quiet="true" />       
482        <delete file="i2p.exe" failonerror="false" quiet="true" />
483        <delete file="syndie-standalone.zip" failonerror="false" quiet="true" />
484        <delete file="i2psnark-standalone.zip" failonerror="false" quiet="true" />
485        <delete file="BOB-one.jar" failonerror="false" quiet="true" /> 
486        <delete dir="core/c/jbigi/bin" />
487        <delete dir="core/c/jbigi/lib" />
488        <delete dir="core/c/jcpuid/lib" />
489        <delete dir="debian/tmp" />
490        <delete dir="debian/db" />
491        <delete file="debian/files" />
492        <delete file="debian/build" />
493        <delete file="debian/substvars"/>
494    </target>
495
496    <target name="distclean" depends="clean">
497        <delete includeemptydirs="true" failonerror="false" >
498            <fileset dir="debian/packages" followSymlinks="false" />
499        </delete>
500        <delete dir="debian/repo" />
501        <ant dir="core/java/" target="distclean" />
502        <ant dir="router/java/" target="distclean" />
503        <ant dir="apps/ministreaming/java/" target="distclean" />
504        <ant dir="apps/streaming/java/" target="distclean" />
505        <ant dir="apps/i2ptunnel/java/" target="distclean" />
506        <ant dir="apps/sam/java/" target="distclean" />
507        <ant dir="apps/BOB" target="clean" />
508        <ant dir="apps/desktopgui" target="clean" />
509        <ant dir="apps/routerconsole/java/" target="distclean" />
510        <ant dir="apps/addressbook/" target="distclean" />
511        <ant dir="apps/susimail/" target="distclean" />
512        <ant dir="apps/susidns/src/" target="distclean" />
513        <ant dir="apps/systray/java/" target="distclean" />
514        <ant dir="apps/i2psnark/java/" target="distclean" />
515        <ant dir="apps/jetty/" target="distclean" />
516        <!--
517                NOTE! We need to turn off the default excludes for these
518                patterns to work.
519                These are the defaultexcludes in Ant as seen on
520                http://ant.apache.org/manual/CoreTasks/defaultexcludes.html
521                     **/*~
522                     **/#*#
523                     **/.#*
524                     **/%*%
525                     **/._*
526                     **/CVS
527                     **/CVS/**
528                     **/.cvsignore
529                     **/SCCS
530                     **/SCCS/**
531                     **/vssver.scc
532                     **/.svn
533                     **/.svn/**
534                     **/.DS_Store
535                The only recourse is to remove the offending ones.
536                We do this here, as we only need one change, and then put it
537                back after we are done with it.
538        -->
539        <defaultexcludes remove="**/*~"/>
540
541        <delete>
542            <fileset dir="." includes="**/*.class **/*.java~ **/*.txt~ **/*.xml~ **/*.sh~ **/*.SlackBuild~" />
543            <!--
544                Less common, but they pollute my workspace here, so we
545                might as well nuke these as well. Are there any others?
546               
547                !!??? Why don't we just nuke "**/*~" ???!!
548
549                ++Sponge
550            -->
551        </delete>
552        <!--
553                Now we put the defaults back
554        -->
555        <defaultexcludes default="true"/>
556    </target>
557
558    <target name="pkg" depends="distclean, updater, preppkg, installer" />
559
560    <target name="pkgclean" depends="deletepkg-temp">
561        <delete>
562            <fileset dir="." includes="i2p.tar.bz2 install.jar i2pupdate.zip i2pupdate200.zip" />
563        </delete>
564    </target>
565
566    <target name="preppkg" depends="preppkg-linux, preppkg-freebsd, preppkg-osx, preppkg-windows, jbigi">
567        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
568        <copy todir="pkg-temp/lib/wrapper/solaris/">
569            <fileset dir="installer/lib/wrapper/solaris/" />
570        </copy>
571    </target>
572
573    <target name="preppkg-freebsd" depends="preppkg-unix">
574        <copy todir="pkg-temp/lib/wrapper/freebsd/">
575            <fileset dir="installer/lib/wrapper/freebsd/" />
576        </copy>
577        <copy todir="pkg-temp/lib/wrapper/freebsd64/">
578            <fileset dir="installer/lib/wrapper/freebsd64" />
579        </copy>
580    </target>
581
582    <target name="preppkg-freebsd-only" depends="preppkg-freebsd, jbigi-freebsd-only" >
583        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
584        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
585    </target>
586
587    <!-- only what is needed for debian, etc. -->
588    <target name="preppkg-linux-only" depends="preppkg-linux, jbigi-linux-only" >
589        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
590        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
591    </target>
592
593    <target name="preppkg-unix" depends="preppkg-base">
594        <copy file="installer/resources/runplain.sh" todir="pkg-temp/" />
595        <!-- <copy file="apps/i2psnark/launch-i2psnark" todir="pkg-temp/" /> old feature that per zzz isn't used-->
596        <copy file="installer/resources/eepget" todir="pkg-temp/" />
597        <copy file="installer/resources/i2prouter" todir="pkg-temp/" />
598        <copy file="installer/resources/osid" todir="pkg-temp/" />
599        <copy file="installer/resources/postinstall.sh" todir="pkg-temp/" />
600        <copy todir="pkg-temp/man/">
601            <fileset dir="installer/resources/man/" />
602        </copy>
603    </target>
604
605    <target name="preppkg-linux" depends="preppkg-linux-x86,preppkg-linux-nonx86" />
606
607    <target name="preppkg-linux-x86" depends="preppkg-unix">
608        <copy todir="pkg-temp/lib/wrapper/linux/">
609            <fileset dir="installer/lib/wrapper/linux/" />
610        </copy>
611        <copy todir="pkg-temp/lib/wrapper/linux64/">
612            <fileset dir="installer/lib/wrapper/linux64/" />
613        </copy>
614    </target>
615
616    <target name="preppkg-linux-nonx86" depends="preppkg-unix">
617        <copy todir="pkg-temp/lib/wrapper/linux-armv7/">
618            <fileset dir="installer/lib/wrapper/linux-armv7/" />
619        </copy>
620        <copy todir="pkg-temp/lib/wrapper/linux-ppc/">
621            <fileset dir="installer/lib/wrapper/linux-ppc/" />
622        </copy>
623        <copy todir="pkg-temp/lib/wrapper/linux-armv5/">
624            <fileset dir="installer/lib/wrapper/linux-armv5/" />
625        </copy>
626    </target>
627
628    <target name="preppkg-osx" depends="preppkg-unix">
629        <!--<copy file="installer/resources/I2P Router Console.webloc" todir="pkg-temp/" />-->
630        <copy todir="pkg-temp/Start I2P Router.app">
631            <fileset dir="installer/resources/Start I2P Router.app" />
632        </copy>
633        <copy todir="pkg-temp/lib/wrapper/macosx/">
634            <fileset dir="installer/lib/wrapper/macosx/" />
635        </copy>
636    </target>
637
638    <target name="preppkg-osx-only" depends="preppkg-osx, jbigi-osx-only" >
639        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
640        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />     
641    </target>
642   
643    <target name="preppkg-windows" depends="preppkg-base, buildexe">
644        <copy file="i2p.exe" todir="pkg-temp/" failonerror="false" />
645        <copy file="apps/systray/java/lib/systray4j.dll" todir="pkg-temp/lib" />
646        <copy file="apps/systray/java/resources/iggy.ico" todir="pkg-temp/icons" />
647        <copy file="apps/systray/java/resources/iggy.xpm" todir="pkg-temp/icons" />
648        <copy file="installer/resources/eepget.bat" todir="pkg-temp/" />
649        <copy file="installer/resources/i2prouter.bat" todir="pkg-temp/" />
650        <copy file="installer/resources/fixperms.bat" todir="pkg-temp/" />
651        <copy file="installer/resources/fixpaths.cmd" todir="pkg-temp/" />
652        <copy file="installer/resources/install_i2p_service_winnt.bat" todir="pkg-temp/" />
653        <copy file="installer/resources/set_config_dir_for_nt_service.bat" todir="pkg-temp/" />
654        <copy file="installer/resources/uninstall_i2p_service_winnt.bat" todir="pkg-temp/" />
655        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
656        <copy todir="pkg-temp/lib/wrapper/win32/">
657            <fileset dir="installer/lib/wrapper/win32/" />
658        </copy>
659        <copy todir="pkg-temp/lib/wrapper/win64/">
660            <fileset dir="installer/lib/wrapper/win64/" />
661        </copy>
662    </target>
663
664    <target name="preppkg-windows-only" depends="preppkg-windows, jbigi-windows-only">
665        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
666        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
667    </target>
668   
669    <target name="preppkg-base" depends="build, preplicenses, prepConsoleDocs, prepthemeupdates, prepCertificates">
670        <!-- if updater200 was run previously, it left *.pack files in pkg-temp -->
671        <!-- Also remove deletelist.txt used for updater only -->
672        <delete>
673            <fileset dir="pkg-temp" includes="**/*.jar.pack **/*.war.pack deletelist.txt" />
674        </delete>
675        <copy file="build/i2p.jar" todir="pkg-temp/lib/" />
676        <copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
677        <!-- all jetty stuff -->
678        <copy todir="pkg-temp/lib" >
679            <fileset dir="build" includes="commons*.jar jasper*.jar javax*.jar jetty*.jar jsp*.jar org.mortbay.jetty.jar" />
680        </copy>
681        <copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
682        <copy file="build/streaming.jar" todir="pkg-temp/lib/" />
683        <copy file="build/router.jar" todir="pkg-temp/lib/" />
684        <copy file="build/desktopgui.jar" todir="pkg-temp/lib/" />
685        <copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
686        <!-- pulled out of routerconsole.jar in 0.7.12; name without version so we can overwrite if we upgrade  -->
687        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
688        <copy file="build/sam.jar" todir="pkg-temp/lib/" />
689        <copy file="build/BOB.jar" todir="pkg-temp/lib/" />
690        <copy file="build/systray.jar" todir="pkg-temp/lib" />
691        <copy file="build/i2psnark.jar" todir="pkg-temp/lib/" />
692        <copy file="apps/systray/java/lib/systray4j.jar" todir="pkg-temp/lib" />
693        <copy file="build/i2ptunnel.war" todir="pkg-temp/webapps/" />
694        <copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
695        <copy file="build/addressbook.war" todir="pkg-temp/webapps/" />
696        <copy file="build/susimail.war" todir="pkg-temp/webapps/" />
697        <copy file="build/susidns.war" todir="pkg-temp/webapps/" />
698        <copy file="apps/susidns/src/WEB-INF/lib/jstl.jar" todir="pkg-temp/lib/" />
699        <copy file="apps/susidns/src/WEB-INF/lib/standard.jar" todir="pkg-temp/lib/" />
700        <copy file="build/i2psnark.war" todir="pkg-temp/webapps/" />
701        <!--
702             Disabling per zzz's statement on IRC: jetty-i2psnark.xml is for an obscure feature that is broken anyway,
703                                                   you can remove the file, the link, and the patch from the package
704
705                     So I'm going one further: I'm disabling it in build.xml
706                     +++kytv
707                     -->
708        <!--
709        <copy file="apps/i2psnark/jetty-i2psnark.xml" todir="pkg-temp/" />
710        -->
711        <copy file="apps/i2psnark/i2psnark.config" todir="pkg-temp/" />
712        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
713        <copy file="installer/resources/clients.config" todir="pkg-temp/" />
714        <copy file="installer/resources/i2ptunnel.config" todir="pkg-temp/" />
715        <copy file="installer/resources/systray.config" todir="pkg-temp/" />
716        <copy file="installer/resources/wrapper.config" todir="pkg-temp/" />
717        <copy file="installer/resources/hosts.txt" todir="pkg-temp/" />
718        <copy file="INSTALL-headless.txt" todir="pkg-temp/" />
719        <!-- overwrite the truncated history put in by the updater -->
720        <copy file="history.txt" todir="pkg-temp/" overwrite="true" />
721        <mkdir dir="pkg-temp/scripts" />
722        <copy file="apps/proxyscript/i2pProxy.pac" todir="pkg-temp/scripts/" />
723        <copy file="installer/resources/startconsole.html" todir="pkg-temp/docs/" />
724        <copy file="installer/resources/start.ico" todir="pkg-temp/docs/" />
725        <copy file="installer/resources/console.ico" todir="pkg-temp/docs/" />
726        <copy file="installer/resources/uninstall.ico" todir="pkg-temp/docs/" />
727        <!-- Eepsite stuff here -->
728        <mkdir dir="pkg-temp/eepsite" />
729        <copy todir="pkg-temp/eepsite/" >
730            <fileset dir="installer/resources/eepsite/" />
731        </copy>
732        <copy todir="pkg-temp/eepsite/docroot/help/lib/" >
733            <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" />
734        </copy>
735        <copy file="installer/resources/themes/console/images/favicon.ico" tofile="pkg-temp/eepsite/docroot/favicon.ico" />
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; gg.png added in 0.8.10 -->
793          <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" />
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="&#10;&#10;----------------&#10;&#10;EARLIER HISTORY IS AVAILABLE IN THE SOURCE PACKAGE" />
887        </exec>
888        <copy file="installer/resources/deletelist.txt" todir="pkg-temp/" />
889      <!-- May be pointless now, people with split directories will never see this,
890           and for flat installs we don't want to overwrite news more recent than the update package.
891        <copy file="installer/resources/news.xml" todir="pkg-temp/docs/" />
892       -->
893    </target>
894
895    <target name="prepupdateSmall" depends="buildSmall, prepupdateRouter, prepthemeupdates">
896        <copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
897        <copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
898        <copy file="build/streaming.jar" todir="pkg-temp/lib/" />
899        <copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
900        <!-- pulled out of routerconsole.jar in 0.7.12, someday we can take out of updater -->
901        <!-- name without version so we can overwrite if we upgrade  -->
902        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
903        <copy file="build/i2ptunnel.war" todir="pkg-temp/webapps/" />
904        <copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
905        <copy file="build/addressbook.war" todir="pkg-temp/webapps/" />
906        <!-- decapitalized the file in 0.7.8 -->
907       <copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
908    </target>
909
910    <target name="prepupdateRouter" depends="buildrouter, deletepkg-temp">
911        <copy file="build/i2p.jar" todir="pkg-temp/lib/" />
912        <copy file="build/router.jar" todir="pkg-temp/lib/" />
913    </target>
914
915    <!-- jbigi.jar -->
916    <target name="prepjbigiupdate" depends="jbigi">
917        <copy file="build/jbigi.jar" todir="pkg-temp/lib/" />
918    </target>
919
920    <!-- GeoIP files and flag icons -->
921    <target name="prepgeoupdate">
922        <copy file="installer/resources/geoip.txt" todir="pkg-temp/geoip/" />
923        <copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
924        <copy todir="pkg-temp/docs/icons/flags" >
925          <fileset dir="installer/resources/icons/flags" />
926        </copy>
927    </target>
928
929    <!-- All jetty jars required for update.
930         We don't need commons-el or commons-logging, they haven't changed.
931         TODO do we need to bother updating jasper?
932         TODO where is JMX? We don't need it I hope.
933      -->
934    <target name="prepjupdate" depends="prepupdate, buildWEB">
935        <copy todir="pkg-temp" >
936            <fileset dir="build/lib" includes="jasper*.jar javax*.jar jetty*.jar jsp*.jar org.mortbay.jetty.jar" />
937        </copy>
938    </target>
939
940    <!-- just our jetty 5 fixes, not for jetty 6 -->
941    <target name="prepjupdatefixes" depends="prepupdate, buildWEB">
942        <copy file="build/org.mortbay.jetty.jar" todir="pkg-temp/lib/" />
943    </target>
944
945    <target name="util-list-changes" depends="checkForMtn" if="mtn.available" >
946        <exec executable="mtn" outputproperty="workspace.changes.util" errorproperty="mtn.error.util" failifexecutionfails="false" >
947            <arg value="list" />
948            <arg value="changed" />
949            <arg value="core/java/src/net/i2p/util" />
950        </exec>
951        <!-- \n in an attribute value generates an invalid manifest -->
952        <exec executable="tr" inputstring="${workspace.changes.util}" outputproperty="workspace.changes.util.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
953            <arg value="-s" />
954            <arg value="[:space:]" />
955            <arg value="," />
956        </exec>
957    </target>
958
959    <taskdef name="izpack"
960             classpath="${basedir}/installer/lib/izpack/patches.jar:${basedir}/installer/lib/izpack/standalone-compiler.jar"
961             classname="com.izforge.izpack.ant.IzPackTask" />
962
963    <target name="izpack-patches" >
964        <jar destfile="${basedir}/installer/lib/izpack/patches.jar"
965             basedir="${basedir}/installer/lib/izpack/patches" />
966    </target>
967
968    <target name="installer" depends="preppkg, buildProperties, util-list-changes, izpack-patches" >
969        <mkdir dir="pkg-temp/installer" />
970        <!-- set if unset -->
971        <property name="workspace.changes.util.tr" value="" />
972        <jar destfile="./pkg-temp/installer/copy.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Copy.class net/i2p/util/FileUtil.class">
973            <manifest>
974                <attribute name="Main-Class" value="net.i2p.util.Copy" />
975                <attribute name="Build-Date" value="${build.timestamp}" />
976                <attribute name="Base-Revision" value="${workspace.version}" />
977                <attribute name="Workspace-Changes" value="${workspace.changes.util.tr}" />
978            </manifest>
979        </jar>
980        <jar destfile="./pkg-temp/installer/delete.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Delete.class net/i2p/util/FileUtil.class">
981            <manifest>
982                <attribute name="Main-Class" value="net.i2p.util.Delete" />
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/exec.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Exec.class">
989            <manifest>
990                <attribute name="Main-Class" value="net.i2p.util.Exec" />
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        <!--
997          Force 1.5 pack200 output
998          Doesnt work!
999          http://jira.codehaus.org/browse/IZPACK-404
1000          http://forums.sun.com/thread.jspa?threadID=773439
1001          http://bfo.co.uk/blog/2010/05/13/combining_ant_jar_signatures_and_pack200.html
1002        <property name="com.sun.java.util.jar.pack.package.majver" value="150" />
1003        <property name="com.sun.java.util.jar.pack.package.minver" value="7" />
1004        -->
1005        <izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
1006
1007        <ant target="installerexe" />
1008    </target>
1009
1010    <target name="installerexe">
1011        <condition property="noExe">
1012            <os arch="x86_64" />
1013        </condition>
1014        <condition property="noExe">
1015            <os arch="amd64" />
1016        </condition>
1017        <condition property="noExe">
1018           <not>
1019            <or>
1020             <os name="Linux" />
1021             <os family="windows" />
1022            </or>
1023           </not>
1024        </condition>
1025        <ant target="doInstallerEXE" />
1026    </target>
1027
1028    <target name="doInstallerEXE" unless="noExe">
1029        <!-- now the installer exe -->
1030        <launch4j configFile="./installer/i2pinstaller.xml" />
1031        <launch4j configFile="./installer/i2pstandalone.xml" />
1032        <!-- thazzit -->
1033    </target>
1034
1035    <!-- Custom installers -->
1036
1037    <target name="installer-freebsd" depends="clean, preppkg-freebsd-only, getReleaseNumber, getBuildNumber, buildProperties, util-list-changes, izpack-patches" >
1038        <mkdir dir="pkg-temp/installer" />
1039        <!-- set if unset -->
1040        <property name="workspace.changes.util.tr" value="" />
1041        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${release.number}-freebsd-only.jar" installerType="standard" basedir="${basedir}" />
1042    </target>
1043
1044    <target name="installer-linux" depends="clean, preppkg-linux-only, getReleaseNumber, getBuildNumber, buildProperties, util-list-changes, izpack-patches" >
1045        <mkdir dir="pkg-temp/installer" />
1046        <!-- set if unset -->
1047        <property name="workspace.changes.util.tr" value="" />
1048        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${release.number}-linux-only.jar" installerType="standard" basedir="${basedir}" />
1049    </target>
1050
1051
1052    <target name="installer-osx" depends="clean, checkForIzpack2App, preppkg-osx-only, getReleaseNumber, getBuildNumber, buildProperties, util-list-changes, izpack-patches">
1053        <mkdir dir="pkg-temp/installer" />
1054        <mkdir dir="pkg-temp/osx" />
1055        <!-- set if unset -->
1056        <property name="workspace.changes.util.tr" value="" />
1057        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${release.number}-osx-only.jar" installerType="standard" basedir="${basedir}" />
1058        <ant target="installer2app" />
1059        <delete dir="pkg-temp/osx" />
1060    </target>
1061
1062    <target name="checkForIzpack2App">
1063        <available property="izpack2app.available" file="${user.home}/IzPack/utils/wrappers/izpack2app/izpack2app.py" />
1064    </target>
1065
1066    <target name="installer2app" if="izpack2app.available">
1067        <mkdir dir="pkg-temp/osx" />
1068        <exec executable="python" failonerror="true">
1069            <arg value="${user.home}/IzPack/utils/wrappers/izpack2app/izpack2app.py" />
1070            <arg value="${basedir}/i2pinstall_${release.number}-osx-only.jar" />
1071            <arg value="${basedir}/pkg-temp/osx/i2p-${release.number}-osx-install.app" />
1072        </exec>
1073        <exec executable="chmod" failonerror="true" osfamily="unix">
1074                <arg value="755" />
1075                <arg value="${basedir}/pkg-temp/osx/i2p-${release.number}-osx-install.app/Contents/MacOS/JavaApplicationStub" />
1076        </exec>
1077        <exec executable="tar" osfamily="unix" failonerror="true">
1078                <arg value="--owner=root" />
1079                <arg value="--group=root" />
1080                <arg value="-cjvf" />
1081                <arg value="${basedir}/i2pinstall_${release.number}-osx.tar.bz2" />
1082                <arg value="-C" />
1083                <arg value="${basedir}/pkg-temp/osx" />
1084                <arg value="i2p-${release.number}-osx-install.app" />
1085        </exec>
1086    </target>
1087
1088    <!-- 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
1089     and will fail if they don't exist. Thankfully these files are so very small there's not much harm in including them.
1090    -->
1091    <target name="installer-windows" depends="clean, doBuildEXE, preppkg-windows-only, preppkg-unix, getReleaseNumber, getBuildNumber, buildProperties, util-list-changes, izpack-patches" >
1092        <mkdir dir="pkg-temp/installer" />
1093        <!-- set if unset -->
1094        <property name="workspace.changes.util.tr" value="" />
1095        <jar destfile="./pkg-temp/installer/copy.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Copy.class net/i2p/util/FileUtil.class">
1096            <manifest>
1097                <attribute name="Main-Class" value="net.i2p.util.Copy" />
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/delete.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Delete.class net/i2p/util/FileUtil.class">
1104            <manifest>
1105                <attribute name="Main-Class" value="net.i2p.util.Delete" />
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/exec.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Exec.class">
1112            <manifest>
1113                <attribute name="Main-Class" value="net.i2p.util.Exec" />
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        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${release.number}-windows-only.jar" installerType="standard" basedir="${basedir}" />
1120        <delete dir="pkg-temp/win" />
1121    </target>
1122
1123    <target name="installer-all" depends="installer-freebsd, installer-linux, installer-osx, installer-windows, installer" >
1124    </target>
1125    <!-- end custom installers -->
1126
1127    <target name="test" depends="buildProperties, jbigi" >
1128        <mkdir dir="reports/core/junit/" />
1129        <ant dir="core/java/" target="test" />
1130    </target>
1131    <target name="junit.report" depends="buildProperties" >
1132        <ant dir="core/java/" target="junit.report" />
1133    </target>
1134    <target name="clover.report" depends="buildProperties" >
1135        <ant dir="core/java/" target="clover.report" />
1136    </target>
1137    <target name="test.report" depends="junit.report, clover.report"/>
1138    <target name="fulltest" depends="buildProperties" >
1139                <ant dir="core/java/" target="fulltest" />
1140                <ant dir="router/java/" target="fulltest" />
1141    </target>
1142    <target name="fullclovertest" depends="buildProperties" >
1143                <ant dir="core/java/" target="fullclovertest" />
1144                <ant dir="router/java/" target="fullclovertest" />
1145    </target>
1146
1147    <target name="testscripts" >
1148        <exec executable="tests/scripts/checkcerts.sh" failonerror="true" />
1149        <exec executable="tests/scripts/checkpo.sh" failonerror="true" />
1150        <exec executable="tests/scripts/checkutf8.sh" failonerror="true" />
1151        <exec executable="tests/scripts/checkxml.sh" failonerror="true" />
1152    </target>
1153
1154
1155    <!-- <target name="syndie" >
1156        <ant dir="apps/syndie/java/" target="standalone" />
1157        <copy file="apps/syndie/java/syndie-standalone.zip" todir="." />
1158    </target> -->
1159    <target name="i2psnark" depends="buildProperties" >
1160        <ant dir="apps/i2psnark/java" target="standalone" />
1161        <copy file="apps/i2psnark/java/i2psnark-standalone.zip" todir="." />
1162    </target>
1163    <target name="slackpkg">
1164        <echo message="Building Slackware package." />
1165        <ant dir="Slackware/i2p/" target="slackpkg" />
1166        <ant dir="Slackware/i2p-base/" target="slackpkg" />
1167    </target>
1168    <target name="justBOB" depends="builddepSmall">
1169        <ant dir="apps/BOB/" target="onejar" />
1170        <copy file="apps/BOB/dist/BOB-one.jar" todir="." />
1171    </target>
1172    <target name="findbugs" depends="build2">
1173        <echo message="Starting findbugs, this will take a while..." />
1174        <exec executable="nice" failonerror="true">
1175            <arg value="findbugs"/>
1176            <arg value="-textui"/>
1177            <arg value="-projectName"/>
1178            <arg value="i2p"/>
1179            <arg value="-sortByClass"/>
1180            <arg value="-xml"/>
1181            <arg value="-output"/>
1182            <arg value="i2p.fba"/>
1183            <arg value="-auxclasspath"/>
1184            <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"/>
1185            <arg value="-sourcepath"/>
1186            <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/"/>
1187            <!-- start of the files to be analyzed -->
1188            <arg value="build/BOB.jar"/>
1189            <arg value="build/addressbook.war"/>
1190            <arg value="build/i2p.jar"/>
1191            <arg value="build/i2psnark.jar"/>
1192            <arg value="build/i2psnark.war"/>
1193            <arg value="build/i2ptunnel.jar"/>
1194            <arg value="build/i2ptunnel.war"/>
1195            <arg value="build/mstreaming.jar"/>
1196            <arg value="build/router.jar/"/>
1197            <arg value="build/desktopgui.jar"/>
1198            <arg value="build/routerconsole.jar"/>
1199            <arg value="build/routerconsole.war"/>
1200            <arg value="build/sam.jar"/>
1201            <arg value="build/streaming.jar"/>
1202            <arg value="build/susidns.war"/>
1203            <arg value="build/susimail.war"/>
1204            <arg value="build/systray.jar"/>
1205        </exec>
1206        <echo message="Findbugs output stored in i2p.fba" />
1207        <echo message="Now run: findbugs i2p.fba" />
1208    </target>
1209
1210    <!-- this is the same dependency as pkg, but with updater200 in the middle,
1211         since preppkg puts too much stuff in pkg-temp -->
1212<!--
1213    <target name="release" depends="distclean, updaterWithJettyFixesAndJbigi , updater200WithJettyFixes, preppkg, installer, getReleaseNumber" >
1214-->
1215    <target name="release" depends="distclean, testscripts, updater, updater200, preppkg, installer, getReleaseNumber" >
1216        <echo message="================================================================" />
1217        <echo message="Did you update these files?" />
1218        <exec executable="ls" failonerror="true">
1219            <arg value="-l" />
1220            <arg value="history.txt" />
1221            <arg value="installer/install.xml" />
1222            <arg value="installer/resources/news.xml" />
1223            <arg value="core/java/src/net/i2p/CoreVersion.java" />
1224            <arg value="router/java/src/net/i2p/router/RouterVersion.java" />
1225        </exec>
1226        <echo message="Everything is checked in, right? Let's be sure:" />
1227        <exec executable="mtn" failonerror="true">
1228            <arg value="st" />
1229        </exec>
1230        <echo message="If there are any modified files above, stop now!" />
1231
1232        <echo message="New version number is ${release.number}" />
1233        <copy file="i2pupdate.zip" tofile="i2pupdate_${release.number}.zip" />
1234        <copy file="i2pinstall.exe" tofile="i2pinstall_${release.number}.exe" />
1235        <delete file="i2pupdate.sud" failonerror="false" />
1236        <delete file="i2pupdate.su2" failonerror="false" />
1237        <input message="Enter private signing key file:" addproperty="release.privkey" />
1238        <fail message="You must enter a path." >
1239            <condition>
1240                <equals arg1="${release.privkey}" arg2=""/>
1241            </condition>
1242        </fail>
1243        <echo message="Key file is ${release.privkey}" />
1244        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
1245            <classpath>
1246                <pathelement location="build/i2p.jar" />
1247            </classpath>
1248            <arg value="sign" />
1249            <arg value="i2pupdate.zip" />
1250            <arg value="i2pupdate.sud" />
1251            <arg value="${release.privkey}" />
1252            <arg value="${release.number}" />
1253        </java>
1254        <echo message="Verify version and VALID signature:" />
1255        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
1256            <classpath>
1257                <pathelement location="build/i2p.jar" />
1258            </classpath>
1259            <arg value="verifysig" />
1260            <arg value="i2pupdate.sud" />
1261        </java>
1262        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
1263            <classpath>
1264                <pathelement location="build/i2p.jar" />
1265            </classpath>
1266            <arg value="verifyversion" />
1267            <arg value="i2pupdate.sud" />
1268        </java>
1269        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
1270            <classpath>
1271                <pathelement location="build/i2p.jar" />
1272            </classpath>
1273            <arg value="showversion" />
1274            <arg value="i2pupdate.sud" />
1275        </java>
1276        <!-- now build and verify the packed sud from the packed zip -->
1277        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
1278            <classpath>
1279                <pathelement location="build/i2p.jar" />
1280            </classpath>
1281            <arg value="sign" />
1282            <arg value="i2pupdate200.zip" />
1283            <arg value="i2pupdate.su2" />
1284            <arg value="${release.privkey}" />
1285            <arg value="${release.number}" />
1286        </java>
1287        <echo message="Verify version and VALID signature:" />
1288        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
1289            <classpath>
1290                <pathelement location="build/i2p.jar" />
1291            </classpath>
1292            <arg value="verifysig" />
1293            <arg value="i2pupdate.su2" />
1294        </java>
1295        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
1296            <classpath>
1297                <pathelement location="build/i2p.jar" />
1298            </classpath>
1299            <arg value="verifyversion" />
1300            <arg value="i2pupdate.su2" />
1301        </java>
1302        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
1303            <classpath>
1304                <pathelement location="build/i2p.jar" />
1305            </classpath>
1306            <arg value="showversion" />
1307            <arg value="i2pupdate.su2" />
1308        </java>
1309        <!-- will this use the monotonerc file in the current workspace? -->
1310        <echo message="Checking out fresh copy into ../i2p-${release.number} for tarballing:" />
1311        <delete dir="../i2p-${release.number}" />
1312        <exec executable="mtn" failonerror="true">
1313            <arg value="co" />
1314            <arg value="-b" />
1315            <arg value="i2p.i2p" />
1316            <!-- w: is the revision of the current workspace -->
1317            <arg value="-r" />
1318            <arg value="w:" />
1319            <arg value="../i2p-${release.number}/" />
1320        </exec>
1321        <exec executable="tar" failonerror="true">
1322            <arg value="cjf" />
1323            <arg value="i2psource_${release.number}.tar.bz2" />
1324            <arg value="-C" />
1325            <arg value=".." />
1326            <arg value="--exclude" />
1327            <arg value="i2p-${release.number}/_MTN*" />
1328            <arg value="i2p-${release.number}/" />
1329        </exec>
1330        <echo message="Sign the files:" />
1331        <delete file="i2pinstall_${release.number}.exe.sig" />
1332        <delete file="i2psource_${release.number}.tar.bz2.sig" />
1333        <delete file="i2pupdate_${release.number}.zip.sig" />
1334        <exec executable="gpg" failonerror="true">
1335            <arg value="-b" />
1336            <arg value="i2pinstall_${release.number}.exe" />
1337        </exec>
1338        <exec executable="gpg" failonerror="true">
1339            <arg value="-b" />
1340            <arg value="i2psource_${release.number}.tar.bz2" />
1341        </exec>
1342        <exec executable="gpg" failonerror="true">
1343            <arg value="-b" />
1344            <arg value="i2pupdate_${release.number}.zip" />
1345        </exec>
1346        <echo message="File sizes:" />
1347        <exec executable="ls" failonerror="true">
1348            <arg value="-l" />
1349            <arg value="i2pinstall_${release.number}.exe" />
1350            <arg value="i2psource_${release.number}.tar.bz2" />
1351            <arg value="i2pupdate_${release.number}.zip" />
1352            <arg value="i2pupdate.su2" />
1353            <arg value="i2pupdate.sud" />
1354            <arg value="i2pinstall_${release.number}.exe.sig" />
1355            <arg value="i2psource_${release.number}.tar.bz2.sig" />
1356            <arg value="i2pupdate_${release.number}.zip.sig" />
1357        </exec>
1358        <echo message="SHA256 sums:" />
1359        <exec executable="sha256sum" failonerror="true">
1360            <arg value="i2pinstall_${release.number}.exe" />
1361            <arg value="i2psource_${release.number}.tar.bz2" />
1362            <arg value="i2pupdate_${release.number}.zip" />
1363            <arg value="i2pupdate.su2" />
1364            <arg value="i2pupdate.sud" />
1365        </exec>
1366        <echo message="Don't forget to mtn tag w: i2p-${release.number}" />
1367        <echo message="... and mtn cert t:i2p-${release.number} branch i2p.i2p.release" />
1368    </target>
1369
1370    <target name="debian" depends="debian-clean, debian-binary" />
1371
1372    <target name="debian-binary" >
1373        <echo message="Did you update the version using dch -i?" />
1374        <echo message=" " />
1375        <echo message="If the changelog was not updated with dch -i, press" />
1376        <echo message="press CTRL+C to abort building this Debian package." />
1377        <echo message="" />
1378        <echo message="Pausing build for ten seconds to give enough time to read this notice." />
1379        <exec executable="sleep" failonerror="true">
1380                <arg value="10" />
1381        </exec>
1382        <echo message="====================" />
1383        <!-- bundle the jetty 5 lib since there isn't a deb for it -->
1384        <ant dir="apps/jetty" target="ensureJettylib" />
1385       
1386        <exec executable="fakeroot" failonerror="true">
1387            <arg value="debian/rules" />
1388            <arg value="patch" />
1389            <arg value="binary" />
1390            <arg value="clean" />
1391        </exec>
1392        <delete dir=".pc" />
1393    </target>
1394    <target name="debian-clean" depends="buildProperties" >
1395        <exec executable="fakeroot" failonerror="true">
1396            <arg value="debian/rules" />
1397            <arg value="clean" />
1398        </exec>
1399        <delete dir="./.pc" />
1400    </target>
1401    <target name="debian-patch" depends="buildProperties" >
1402        <exec executable="quilt" failonerror="true">
1403            <arg value="-a" />
1404            <arg value="push" />
1405        </exec>
1406        <echo message="====================" />
1407    </target>
1408    <target name="debian-unpatch" depends="buildProperties">
1409        <exec executable="quilt" failonerror="false">
1410            <arg value="-a" />
1411            <arg value="pop" />
1412        </exec>
1413    </target>
1414
1415    <target name="debianrepo" depends="debian">
1416        <exec dir="debian" executable="./makerepo.sh" failonerror="true"/>
1417    </target>
1418
1419<!-- the following are appened to help build barebone portable version,
1420     none of the above is modified for this purpose -->
1421        <target name = "pkg-portable-clean">
1422                <delete dir="build/" />
1423                <delete dir="pkg-temp/" />
1424                <delete>
1425                        <fileset dir="." includes="portable-**.zip**" />
1426                </delete>
1427        </target>
1428<!-- build a portable archive -->
1429
1430<!-- *0* Since we simply pack all files in folder "build/" into our archieve,
1431                we need to make sure its small, with NO redundent jars or wars.
1432                thus cleaning is required before each build-->
1433        <target name="buildSmallOnly" depends="pkg-portable-clean,buildSmall"/>
1434
1435<!-- *1* preparing the jars by OS dependent de-bloating -->
1436        <target name="preppkg-portable-win32-jbigi" depends="buildSmallOnly, jbigi-windows-only" />
1437
1438        <target name="preppkg-portable-linux-jbigi"  depends="buildSmallOnly, jbigi-linux-only" />
1439
1440<!-- *2* os independent procedure  -->
1441        <target name="preppkg-portable-basic" >
1442                <mkdir dir="pkg-temp" />
1443                        <!-- non OS dependent configurations only, dont add *nux/win stuff here -->
1444                        <copy todir="pkg-temp">
1445                                <fileset dir="installer/resources/portable/configs/" />
1446                        </copy>
1447                        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
1448                        <copy file="installer/resources/hosts.txt" todir="pkg-temp/" />
1449                        <copy file="installer/resources/readme.license.txt" todir="pkg-temp/" />
1450                <mkdir dir="pkg-temp/addressbook" />
1451                        <copy file="apps/addressbook/subscriptions.txt" todir="pkg-temp/addressbook/" />
1452                        <copy file="apps/addressbook/myhosts.txt"  todir="pkg-temp/addressbook/" />
1453                        <!-- config.txt is in installer/resources/portable -->
1454                <mkdir dir="pkg-temp/docs" />
1455                        <copy file="installer/resources/initialNews/initialNews.xml" tofile="pkg-temp/docs/news.xml" overwrite="true" />
1456                        <copy file="installer/resources/readme/readme.html" tofile="pkg-temp/docs/readme.html" />
1457                        <copy file="installer/resources/startconsole.html" todir="pkg-temp/docs/" />
1458                        <copy file="installer/resources/start.ico" todir="pkg-temp/docs/" />
1459                        <copy file="installer/resources/console.ico" todir="pkg-temp/docs/" />
1460                        <!-- HTTP Header files, english only,
1461                                if you need a different lang do it in a seperate target -->
1462                        <copy todir="pkg-temp/docs/" >
1463                                <fileset dir="installer/resources/proxy/"  includes="**-header.ht" />
1464                        </copy>
1465                        <!-- Theme light only -->
1466                        <copy todir="pkg-temp/docs/themes/console/light/" overwrite="true" >
1467                                <fileset dir="installer/resources/themes/console/light/" includes="**.css" />
1468                        </copy>
1469                        <copy file="installer/resources/themes/console/light/console_big.css" todir="portable/docs/themes/console/light/" />
1470                        <copy todir="pkg-temp/docs/themes/console/images/" >
1471                                <fileset dir="installer/resources/themes/console/images/" />
1472                        </copy>
1473                        <!-- FLAGs for language icon (not for ip)-->
1474                        <copy todir="pkg-temp/docs/icons/flags" >
1475                                <fileset dir="installer/resources/icons/flags/" includes="cn.png,de.png,fr.png,nl.png,ru.png,se.png,us.png" />
1476                        </copy>
1477                <mkdir dir="pkg-temp/webapps" />
1478                        <copy todir="pkg-temp/webapps/">
1479                                <fileset dir="build/" includes="**.war" />
1480                        </copy>
1481                <mkdir dir="pkg-temp/lib" />
1482                        <copy todir ="pkg-temp/lib/" >
1483                                <fileset dir="build/" includes="**.jar" />
1484                        </copy>
1485                        <!-- 3rd party jars from apps/  -->
1486                                <!-- jrobin - without jobin , you lost graph and get a lot error entry in logs -->
1487                        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
1488        </target>
1489<!-- *3* os dependent procedure/commands -->
1490        <target name = "preppkg-portable-win32" depends="preppkg-portable-win32-jbigi,preppkg-portable-basic">
1491                        <!-- systray4.j  - why do we need trayicons for portable version ? dependency hardcoded in console -->
1492                <copy file="apps/systray/java/lib/systray4j.dll" todir="pkg-temp/lib" />
1493                <copy file="apps/systray/java/lib/systray4j.jar" todir="pkg-temp/lib" />
1494                        <!--wrapper - dont even think about it. i2p cosumes appreantly more mem without it on win32-->
1495                <copy file="installer/lib/wrapper/win32/wrapper.dll" todir="pkg-temp/lib" />
1496                <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
1497                <copy file="installer/lib/wrapper/win32/I2Psvc.exe" tofile="pkg-temp/i2psvc.ex_" />
1498                        <!--  copy the unpack/start batchfiles -->
1499                <copy todir="pkg-temp">
1500                        <fileset dir="installer/resources/portable/win32/" />
1501                </copy>
1502        </target>
1503<!-- *4* command for windows package -->
1504        <target name = "pkg-portable-win32"     depends="preppkg-portable-win32, pack200" >
1505                <!-- i need the portable\ folder in .zip so basedir is set to . -->
1506                <move file="pkg-temp" tofile="portable"/>
1507                <zip destfile="portable-win32.zip" basedir="." level="9" includes="portable\**" />
1508                <checksum file="portable-win32.zip" forceOverwrite="yes"/>
1509                <move file="portable" tofile="pkg-temp"/>
1510        </target>
1511</project>
Note: See TracBrowser for help on using the repository browser.