source: build.xml @ c9b6a3f0

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

Instead of deleting the empty directory placeholders, let's just not copy them to pkg-temp to begin with.

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