source: build.xml @ 5d93ca1

Last change on this file since 5d93ca1 was 70f9cb1, checked in by zzz <zzz@…>, 4 years ago

Build:

  • Add DTG to updater
  • Fix and bundle DTG license info
  • Remove jstl.jar and standard.jar from updater, last changed in 0.9
  • Fix bundling of Tomcat license info

Console:

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