source: build.xml @ 406bcbe

Last change on this file since 406bcbe was 406bcbe, checked in by kytv <kytv@…>, 8 years ago

remove dependencies on external tools for getReleaseNumber and getBuildNumber

getReleaseNumber and getBuildNumber were *NIX only targets that relied on the external tools grep, cut, awk, and tr. These targets have been rewritten to use ant features.

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