source: build.xml @ 4389f27

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