source: build.xml @ 01da323

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

Streaming: Bundle I2PSocketException messages for translation

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