source: build.xml @ c655d23

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