source: build.xml @ c902d4c

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

remove SAM client classes from sam.jar

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