source: build.xml @ d510aad

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

fix class

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