source: build.xml @ 7c00a51

Last change on this file since 7c00a51 was 7c00a51, checked in by zzz <zzz@…>, 6 years ago

Build: Honor require.gettext=false for i2prouter translations

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