source: build.xml @ 73256f6

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

Move BundleRouterInfos? out of router.jar

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