source: build.xml @ f191e50

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

Custom target so I2P-Bote can be built against source

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