source: build.xml @ 65504e8

Last change on this file since 65504e8 was 65504e8, checked in by zzz <zzz@…>, 9 years ago
  • Build: Repack release jars with pack200 -r, saves about 1% and

might save a little memory at runtime too

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