source: build.xml @ 557cb30

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

echo tweak

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