source: build.xml @ ac1b51c

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

Fix installer-windows build target

Izpack tries to parse the 'unix-only' files in Windows. If we don't copy them,
the installation will fail in Windows. Therefore, moving the files that were in
the preppkg-unix target to the preppkg-base target. They're so small I don't
see how this will be a problem.

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