source: build.xml @ 7343e0f

Last change on this file since 7343e0f was 7343e0f, checked in by kytv <kytv@…>, 9 years ago

fix getBuildNumber target (sometimes the buildNumber would have a leading
space, such as " 19" instead of "19"), using "tr" to strip it.

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