source: build.xml @ 6ebd1f1

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

installer build fixups

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