source: build.xml @ 6818907

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

Don't delete debian/copyright during "ant clean".

Instead of deleting debian/copyright with "ant clean", add it to .mtn-ignore.
With the current method, the copyright file doesn't end up in the debian source
package…

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