source: build.xml @ 6198739

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

propagate from branch 'i2p.i2p' (head 899a1923586f3d7d622bd02e03c87717566617c4)

to branch 'i2p.i2p.zzz.jetty6' (head cb3e33be282b6002f6790609f4a3eef7f42069d3)

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