source: build.xml @ 6107e38

Last change on this file since 6107e38 was 6107e38, checked in by zzz <zzz@…>, 9 years ago

propagate from branch 'i2p.i2p' (head 0f4af64e64536c467b623286bce659dd2dfe9342)

to branch 'i2p.i2p.zzz.jetty6' (head d525108d8e9ecb842a99bb81c1138c43b5e39653)

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