source: build.xml @ ff189e7

Last change on this file since ff189e7 was 1f8f3eb, checked in by kytv <kytv@…>, 6 years ago

Fix up the included SlackBuild? (ticket #1310)

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