source: build.xml @ dd9cae5

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

merge of '83079d347b764886d77d9d9de902011f09f5dcce'

and 'c76215859aa3b76a04c4a83a1ded20548a8773a6'

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