source: build.xml @ 221499c

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

propagate from branch 'i2p.i2p' (head 156f8e6137be3c25aa70176fe0a78218b898a684)

to branch 'i2p.i2p.zzz.jetty6' (head 960f416b20e26662b1b5b30468a85dbb25f09ffd)

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