source: build.xml @ d7c1e97

Last change on this file since d7c1e97 was d7c1e97, checked in by zzz <zzz@…>, 8 years ago

merge of 'c09b40fe67ffc403c484ac4b14d896de48d37d9c'

and 'c269d35a60d164027bb1d1fbb6d30c06ffd2292d'

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