source: build.xml @ 2c049878

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

Enable addressbook.jar building (for I2P-Android)

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