source: build.xml @ 778ce71

Last change on this file since 778ce71 was 1af23a4, checked in by zzz <zzz@…>, 4 years ago

Debian: Don't use glassfish-javaee.jar for jstl.jar (ticket #1793)

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