source: build.xml @ 9abf7d6

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

Don't try to build an EXE on arm systems.

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