source: build.xml @ e2c98ac

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

propagate from branch 'i2p.i2p.zzz.jrobin159' (head 08df645290d8e156d88930ddaf71b3f3d8af419d)

to branch 'i2p.i2p' (head 69c9e6bd0c6894c335f7d9892aa28ac7d6389907)

  • Property mode set to 100644
File size: 57.9 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    <!-- You probably don't want to change anything from here down -->
17    <target name="help" depends="all" />
18    <target name="all" >
19        <echo message="Useful targets: " />
20        <echo message="  pkg:       distclean then package everything up (installer, clean tarball, update tarball)" />
21        <echo message="  dist:      pkg and javadoc" />
22        <echo message="  installer: build the GUI installer" />
23        <echo message="  tarball:   tar the full install into i2p.tar.bz2 (extracts to build a new clean install)" />
24        <echo message="  updater:   Package the built files in i2pupdate.zip (extracts safely over existing installs)" />
25        <echo message="  updater200: Updater compressed with pack200 (creates i2pupdate200.zip, 60% smaller)" />
26        <echo message="  updaterWithJavadoc: updater including the javadocs, for display in the console" />
27        <echo message="  updaterWithJetty: Updater including Jetty" />
28        <echo message="  updaterWithJettyFixes: updater including local jetty patches" />
29        <echo message="  updaterWithGeoIP: updater including GeoIP Files" />
30        <echo message="  updaterWithJettyFixesAndGeoIP" />
31        <echo message="  updaterSmall:   updater with the essentials only - no SAM, i2psnark, SusiMail, SusiDNS, news.xml, or history.txt" />
32        <echo message="  updaterRouter:  updater with the i2p.jar and router.jar only" />
33        <echo message="  distclean: clean up all derived files" />
34        <echo message="  syndie:    generate a standalone syndie install" />
35        <echo message="  desktopgui: generate a standalone desktopgui install" />
36        <echo message="  i2psnark:  generate a standalone i2psnark install" />
37        <echo message="  justBOB:  generate a standalone BOB-one.jar" />
38        <echo message="  javadoc:   generate javadoc for the entire project into ./build/javadoc" />
39        <echo message="  slackpkg:  generate Slackware packages in ./Slackware/i2p and ./Slackware/i2p-base" />
40        <echo message="  debianhowto: instructions on building Debian packages" />
41        <echo message="  debian: generate Debian packages in ./debian/packages" />
42        <echo message="          (libc6-i686 and libc6-amd64 required, ant>=1.8 required)" />
43        <echo message="  debianrepo: build a Debian repository (reprepro required)" />
44        <echo message="  poupdate: update the .po files for translators" />
45        <echo message="  pkg-portable-win32:  build a minimum portable version for win32" />
46   </target>
47    <target name="debianhowto">
48        <echo message="To build debian packages, you must run dpkg-buildpackage as root in the source directory. It will then run ant for you. dpkg-buildpackage is found in the 'dpkg-dev' package. Also it should work fine to use the 'fakeroot' package with dpkg-buildpackage, if you don't want to run as root. Please read 'man dpkg-buildpackage' before building any packages yourself." />
49    </target>
50    <target name="dist" depends="pkg, javadoc">
51    </target>
52    <target name="build" depends="build2">
53        <!-- so we don't build standalone for the updater -->
54        <!-- This builds apps/i2psnark/java/i2psnark-standalone.zip,
55          -   which we don't distribute anywhere...
56        <ant dir="apps/i2psnark/java/" target="standalone" />
57        -->
58    </target>
59    <target name="build2" depends="builddep, jar, buildWEB" />
60    <target name="buildSmall" depends="builddepSmall, jarSmall, buildWEB" />
61    <target name="buildclean" depends="distclean, build" />
62
63    <target name="builddep" depends="builddepSmall, buildBOB, buildSAM, buildSusiMail, buildSusiDNS, buildI2PSnark" />
64
65    <target name="builddepSmall" depends="buildrouter, buildSystray, buildDesktopGui, buildRouterConsole, buildStreaming, buildI2PTunnel, buildAddressbook" />
66
67    <!-- start of buildX, one for each sub-build.xml.
68         Do not put ant tasks in the sub-build.xmls anymore,
69         so the build will go faster.
70      -->
71
72    <target name="buildBOB" depends="buildStreaming" >
73        <ant dir="apps/BOB/" target="jar" />
74    </target>
75
76    <target name="buildSAM" depends="buildStreaming" >
77        <ant dir="apps/sam/java/" target="jar" />
78    </target>
79
80    <target name="buildSusiMail" depends="buildCore, buildJetty" >
81        <ant dir="apps/susimail/" target="war" />
82    </target>
83
84    <target name="buildSusiDNS" depends="buildCore, buildJetty" >
85        <ant dir="apps/susidns/src" target="all" />
86    </target>
87
88    <target name="buildI2PSnark" depends="buildStreaming, buildJetty" >
89        <ant dir="apps/i2psnark/java/" target="war" />
90    </target>
91
92    <target name="buildAddressbook" depends="buildCore, buildJetty" >
93        <ant dir="apps/addressbook/" target="war" />
94    </target>
95
96    <target name="buildI2PTunnel" depends="buildStreaming, buildJetty" >
97        <ant dir="apps/i2ptunnel/java/" target="build" />
98    </target>
99
100    <target name="buildDesktopGui" depends="buildCore, buildrouter" >
101<!--
102        <ant dir="apps/desktopgui" target="clean" />
103-->
104        <ant dir="apps/desktopgui" target="jar" />
105    </target>
106
107    <target name="buildRouterConsole" depends="buildrouter, buildSystray, buildDesktopGui, buildJetty" >
108        <ant dir="apps/routerconsole/java/" target="jar" />
109    </target>
110
111    <target name="buildJetty" depends="buildProperties" >
112        <ant dir="apps/jetty" target="build" />
113    </target>
114
115    <target name="buildSystray" depends="buildCore" >
116        <ant dir="apps/systray/java/" target="jar" />
117    </target>
118
119    <target name="buildStreaming" depends="buildMinistreaming" >
120        <ant dir="apps/streaming/java/" target="jar" />
121    </target>
122
123    <target name="buildMinistreaming" depends="buildCore" >
124        <ant dir="apps/ministreaming/java/" target="jar" />
125    </target>
126
127    <target name="buildRouter" depends="buildrouter" />
128    <target name="buildrouter" depends="buildCore" >
129        <ant dir="router/java/" target="jar" />
130        <copy file="router/java/build/router.jar" todir="build/" />
131    </target>
132
133    <target name="buildCore" depends="buildProperties" >
134        <ant dir="core/java/" target="jar" />
135        <copy file="core/java/build/i2p.jar" todir="build/" />
136    </target>
137
138    <target name="buildJrobin" depends="buildProperties" >
139        <!-- take only what we need from the jrobin jar -->
140        <jar destfile="build/jrobin.jar" >
141            <zipfileset src="apps/jrobin/jrobin-1.5.9.1.jar"
142                        excludes="org/jrobin/cmd/ org/jrobin/convertor/ org/jrobin/inspector/" />
143            <manifest>
144                <attribute name="Build-Date" value="${build.timestamp}" />
145                <attribute name="Base-Revision" value="${workspace.version}" />
146            </manifest>
147        </jar>
148    </target>
149
150    <target name="buildProperties" >
151        <exec executable="mtn" outputproperty="workspace.version" errorproperty="mtn.error1" failifexecutionfails="false" >
152            <arg value="automate" />
153            <arg value="get_base_revision_id" />
154        </exec>
155        <tstamp>
156            <format property="build.timestamp" pattern="yyyy-MM-dd HH:mm:ss z" timezone="UTC" locale="en" />
157        </tstamp>
158    </target>
159
160    <!-- end of sub-build.xml targets -->
161
162    <target name="buildWEB" depends="buildRouterConsole" >
163        <copy file="apps/routerconsole/java/build/routerconsole.jar" todir="build/" />
164        <copy file="apps/routerconsole/java/build/routerconsole.war" todir="build/" />
165        <copy file="apps/jetty/jettylib/org.mortbay.jetty.jar" todir="build/" />
166        <copy file="apps/jetty/jettylib/jasper-compiler.jar" todir="build/" />
167        <copy file="apps/jetty/jettylib/jasper-runtime.jar" todir="build/" />
168        <copy file="apps/jetty/jettylib/commons-logging.jar" todir="build/" />
169        <copy file="apps/jetty/jettylib/commons-el.jar" todir="build/" />
170        <copy file="apps/jetty/jettylib/javax.servlet.jar" todir="build/" />
171    </target>
172
173    <target name="buildexe">
174        <condition property="noExe">
175            <os arch="x86_64" />
176        </condition>
177        <condition property="noExe">
178            <os arch="ppc" />
179        </condition>
180        <condition property="noExe">
181            <os arch="amd64" />
182        </condition>
183        <condition property="noExe">
184           <not>
185            <or>
186             <os name="Linux" />
187             <os family="windows" />
188            </or>
189           </not>
190        </condition>
191        <ant target="doBuildEXE" />
192    </target>
193    <target name="doBuildEXE" depends="buildProperties" unless="noExe">
194        <jar destfile="./build/launchi2p.jar">
195            <manifest>
196             <attribute name="Main-Class" value="net.i2p.router.RouterLaunch" />
197             <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" />
198             <attribute name="Build-Date" value="${build.timestamp}" />
199             <attribute name="Base-Revision" value="${workspace.version}" />
200            </manifest>
201        </jar>
202        <!-- now the standalone launcher exe -->
203        <taskdef name="launch4j"
204                 classname="net.sf.launch4j.ant.Launch4jTask"
205                 classpath="${basedir}/installer/lib/launch4j/launch4j.jar:${basedir}/installer/lib/launch4j/lib/xstream.jar" />
206        <launch4j configFile="./installer/i2pstandalone.xml" />
207        <!-- thazzit -->
208    </target>
209
210    <target name="jar" depends="jarSmall" >
211        <copy file="apps/BOB/dist/BOB.jar" todir="build/" />
212        <copy file="apps/sam/java/build/sam.jar" todir="build/" />
213        <copy file="apps/susimail/susimail.war" todir="build/" />
214        <copy file="apps/susidns/src/susidns.war" todir="build/" />
215        <copy file="apps/i2psnark/i2psnark.war" todir="build/" />
216        <copy file="apps/i2psnark/java/build/i2psnark.jar" todir="build/" />
217
218    </target>
219    <target name="jarSmall" depends="builddepSmall" >
220        <copy file="core/java/build/i2p.jar" todir="build/" />
221        <copy file="router/java/build/router.jar" todir="build/" />
222        <copy file="apps/ministreaming/java/build/mstreaming.jar" todir="build/" />
223        <copy file="apps/streaming/java/build/streaming.jar" todir="build/" />
224        <copy file="apps/i2ptunnel/java/build/i2ptunnel.jar" todir="build/" />
225        <copy file="apps/i2ptunnel/java/build/i2ptunnel.war" todir="build/" />
226        <copy file="apps/systray/java/build/systray.jar" todir="build/" />
227        <copy file="apps/desktopgui/dist/desktopgui.jar" todir="build/" />
228        <copy file="apps/addressbook/dist/addressbook.war" todir="build/" />
229    </target>
230
231    <target name="jbigi">
232        <jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
233            <fileset dir="installer/lib/jbigi" includes="*.so *.dll *.jnilib" />
234        </jar>
235    </target>
236
237    <target name="jbigi-windows-only" >
238        <jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
239            <fileset dir="installer/lib/jbigi" includes="*windows*.dll" />
240        </jar>
241    </target>
242
243    <target name="jbigi-linux-only">
244        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
245            <fileset dir="installer/lib/jbigi" includes="*linux*.so" />
246        </jar>
247    </target>
248
249    <!-- the apps need to compile the jsps to poupdate -->
250    <target name="poupdate" depends="buildRouter, buildStreaming, buildSystray, buildJetty, buildDesktopGui" >
251        <echo message="Setting environment variable LG2 to a lang code (eg: de,zh,nl etc)" />
252        <echo message=" will restrict language update to the language you specified, leaving other language untact." />
253        <ant dir="apps/routerconsole/java/" target="poupdate" />
254        <ant dir="apps/i2psnark/java/" target="poupdate" />
255        <ant dir="apps/i2ptunnel/java/" target="poupdate" />
256        <ant dir="apps/susidns/src/" target="poupdate" />
257        <ant dir="apps/susimail/" target="poupdate" />
258        <ant dir="apps/desktopgui" target="poupdate" />
259    </target>
260    <target name="javadoc">
261        <ant dir="apps/jetty" target="ensureJettylib" />
262        <mkdir dir="./build" />
263        <mkdir dir="./build/javadoc" />
264        <!-- get release and build version numbers -->
265        <exec executable="grep" outputproperty="versionLine" >
266            <arg value="public final static String VERSION" />
267            <arg value="core/java/src/net/i2p/CoreVersion.java" />
268        </exec>
269        <exec executable="cut" inputstring="${versionLine}" outputproperty="release.number" >
270            <arg value="-f2" />
271            <arg value="-d&quot;" />
272        </exec>
273        <exec executable="grep" outputproperty="buildLine" >
274            <arg value="public final static long BUILD" />
275            <arg value="router/java/src/net/i2p/router/RouterVersion.java" />
276        </exec>
277        <exec executable="cut" inputstring="${buildLine}" outputproperty="build.temp" >
278            <arg value="-f2" />
279            <arg value="-d=" />
280        </exec>
281        <exec executable="cut" inputstring="${build.temp}" outputproperty="build.number" >
282            <arg value="-f1" />
283            <arg value="-d;" />
284        </exec>
285        <javadoc access="package" 
286            destdir="./build/javadoc" 
287            packagenames="*" 
288            use="true" 
289            splitindex="true" 
290            doctitle="I2P Javadocs for Release ${release.number} Build ${build.number}"
291            windowtitle="I2P Anonymous Network - Java Documentation - Version ${release.number}">
292            <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" />
293            <group title="Streaming Library" packages="net.i2p.client.streaming" />
294            <group title="Router" packages="net.i2p.router:net.i2p.router.*:net.i2p.data.i2np:org.cybergarage.*:org.freenetproject" />
295            <group title="Router Console" packages="net.i2p.router.web" />
296            <group title="Addressbook Application" packages="net.i2p.addressbook" />
297            <group title="BOB Bridge" packages="net.i2p.BOB" />
298            <group title="I2PSnark Application" packages="org.klomp.snark:org.klomp.snark.*" />
299            <group title="I2PTunnel Application" packages="net.i2p.i2ptunnel:net.i2p.i2ptunnel.*" />
300            <group title="SAM Bridge" packages="net.i2p.sam:net.i2p.sam.client" />
301            <group title="SusiDNS Application" packages="i2p.susi.dns" />
302            <group title="SusiMail Application" packages="i2p.susi.webmail:i2p.susi.webmail.*:i2p.susi.debug:i2p.susi.util" />
303            <group title="Systray Application" packages="net.i2p.apps.systray" />
304            <group title="Desktopgui Application" packages="net.i2p.desktopgui.*" />
305            <sourcepath>
306                <pathelement location="core/java/src" />
307                <!--<pathelement location="core/java/test" />-->
308                <pathelement location="router/java/src" />
309                <!--<pathelement location="router/java/test" />-->
310                <pathelement location="apps/ministreaming/java/src" />
311                <pathelement location="apps/streaming/java/src" />
312                <pathelement location="apps/i2ptunnel/java/src" />
313                <pathelement location="apps/systray/java/src" />
314                <pathelement location="apps/desktopgui/src" />
315                <pathelement location="apps/routerconsole/java/src" />
316                <pathelement location="apps/addressbook/java/src" />
317                <pathelement location="apps/i2psnark/java/src" />
318                <pathelement location="apps/sam/java/src" />
319                <pathelement location="apps/BOB/src" />
320                <pathelement location="apps/susidns/src/java/src" />
321                <pathelement location="apps/susimail/src/src" />
322            </sourcepath>
323            <classpath>
324                <pathelement location="apps/jetty/jettylib/org.mortbay.jetty.jar" />
325                <pathelement location="apps/jetty/jettylib/javax.servlet.jar" />
326                <pathelement location="apps/systray/java/lib/systray4j.jar" />
327                <pathelement location="apps/jrobin/jrobin-1.5.9.1.jar" />
328                <pathelement location="installer/lib/wrapper/win32/wrapper.jar" />
329                <pathelement location="core/lib/junit.jar" />               
330            </classpath>
331            <link offline="true" href="http://download.oracle.com/javase/6/docs/api/" packagelistLoc="installer/resources/package-lists/java/" />
332            <link offline="true" href="http://docs.i2p2.de/jetty/javadoc/" packagelistLoc="installer/resources/package-lists/jetty/" />
333            <link offline="true" href="http://docs.i2p2.de/jrobin/javadoc/" packagelistLoc="installer/resources/package-lists/jrobin/" />
334        </javadoc>
335    </target>
336    <target name="clean" depends="pkgclean" >
337        <delete dir="./build" />
338        <delete file="i2pinstall.exe" failonerror="false" quiet="true" />       
339        <delete file="i2p.exe" failonerror="false" quiet="true" />
340        <delete file="syndie-standalone.zip" failonerror="false" quiet="true" />
341        <delete file="i2psnark-standalone.zip" failonerror="false" quiet="true" />
342        <delete file="BOB-one.jar" failonerror="false" quiet="true" /> 
343        <delete dir="debian/tmp" />
344        <delete dir="debian/db" />
345        <delete file="debian/files" />
346        <delete file="debian/build" />
347        <delete file="debian/substvars"/>
348    </target>
349    <target name="distclean" depends="clean">
350        <delete includeemptydirs="true" failonerror="false" >
351            <fileset dir="debian/packages" followSymlinks="false" />
352        </delete>
353        <delete dir="debian/repo" />
354        <ant dir="core/java/" target="distclean" />
355        <ant dir="router/java/" target="distclean" />
356        <ant dir="apps/ministreaming/java/" target="distclean" />
357        <ant dir="apps/streaming/java/" target="distclean" />
358        <ant dir="apps/i2ptunnel/java/" target="distclean" />
359        <ant dir="apps/sam/java/" target="distclean" />
360        <ant dir="apps/BOB" target="clean" />
361        <ant dir="apps/desktopgui" target="clean" />
362        <ant dir="apps/routerconsole/java/" target="distclean" />
363        <ant dir="apps/addressbook/" target="distclean" />
364        <ant dir="apps/susimail/" target="distclean" />
365        <ant dir="apps/susidns/src/" target="distclean" />
366        <ant dir="apps/systray/java/" target="distclean" />
367        <ant dir="apps/i2psnark/java/" target="distclean" />
368        <ant dir="apps/jetty/" target="distclean" />
369        <!--
370                NOTE! We need to turn off the default excludes for these
371                patterns to work.
372                These are the defaultexcludes in Ant as seen on
373                http://ant.apache.org/manual/CoreTasks/defaultexcludes.html
374                     **/*~
375                     **/#*#
376                     **/.#*
377                     **/%*%
378                     **/._*
379                     **/CVS
380                     **/CVS/**
381                     **/.cvsignore
382                     **/SCCS
383                     **/SCCS/**
384                     **/vssver.scc
385                     **/.svn
386                     **/.svn/**
387                     **/.DS_Store
388                The only recourse is to remove the offending ones.
389                We do this here, as we only need one change, and then put it
390                back after we are done with it.
391        -->
392        <defaultexcludes remove="**/*~"/>
393
394        <delete>
395            <fileset dir="." includes="**/*.class **/*.java~ **/*.txt~ **/*.xml~ **/*.sh~ **/*.SlackBuild~" />
396            <!--
397                Less common, but they pollute my workspace here, so we
398                might as well nuke these as well. Are there any others?
399               
400                !!??? Why don't we just nuke "**/*~" ???!!
401
402                ++Sponge
403            -->
404        </delete>
405        <!--
406                Now we put the defaults back
407        -->
408        <defaultexcludes default="true"/>
409    </target>
410
411    <target name="pkg" depends="distclean, updater, preppkg, installer" />
412
413    <target name="pkgclean" depends="deletepkg-temp">
414        <delete>
415            <fileset dir="." includes="i2p.tar.bz2 install.jar i2pupdate.zip i2pupdate200.zip" />
416        </delete>
417    </target>
418
419    <target name="preppkg" depends="preppkg-linux, preppkg-windows, jbigi">
420        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
421        <copy todir="pkg-temp/lib/wrapper/freebsd/">
422            <fileset dir="installer/lib/wrapper/freebsd/" />
423        </copy>
424        <copy todir="pkg-temp/lib/wrapper/macosx/">
425            <fileset dir="installer/lib/wrapper/macosx/" />
426        </copy>
427        <copy todir="pkg-temp/lib/wrapper/solaris/">
428            <fileset dir="installer/lib/wrapper/solaris/" />
429        </copy>
430    </target>
431
432    <target name="preppkg-windows" depends="preppkg-base, buildexe">
433        <copy file="i2p.exe" todir="pkg-temp/" failonerror="false" />
434        <copy file="apps/systray/java/lib/systray4j.dll" todir="pkg-temp/lib" />
435        <copy file="apps/systray/java/resources/iggy.ico" todir="pkg-temp/icons" />
436        <copy file="apps/systray/java/resources/iggy.xpm" todir="pkg-temp/icons" />
437        <copy file="installer/resources/eepget.bat" todir="pkg-temp/" />
438        <copy file="installer/resources/i2prouter.bat" todir="pkg-temp/" />
439        <copy file="installer/resources/fixperms.bat" todir="pkg-temp/" />
440        <copy file="installer/resources/install_i2p_service_winnt.bat" todir="pkg-temp/" />
441        <copy file="installer/resources/postinstall.bat" todir="pkg-temp/" />
442        <copy file="installer/resources/set_config_dir_for_nt_service.bat" todir="pkg-temp/" />
443        <copy file="installer/resources/uninstall_i2p_service_winnt.bat" todir="pkg-temp/" />
444        <copy todir="pkg-temp/lib/wrapper/win32/">
445            <fileset dir="installer/lib/wrapper/win32/" />
446        </copy>
447    </target>
448
449    <!-- only what is needed for debian, etc. -->
450    <target name="preppkg-linux-only" depends="preppkg-linux, jbigi-linux-only" >
451        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
452    </target>
453
454    <target name="preppkg-linux" depends="preppkg-base">
455        <copy file="installer/resources/runplain.sh" todir="pkg-temp/" />
456        <copy file="apps/i2psnark/launch-i2psnark" todir="pkg-temp/" />
457        <copy file="installer/resources/eepget" todir="pkg-temp/" />
458        <copy file="installer/resources/i2prouter" todir="pkg-temp/" />
459        <copy file="installer/resources/osid" todir="pkg-temp/" />
460        <copy file="installer/resources/postinstall.sh" todir="pkg-temp/" />
461        <copy todir="pkg-temp/man/">
462            <fileset dir="installer/resources/man/" />
463        </copy>
464        <copy todir="pkg-temp/lib/wrapper/linux/">
465            <fileset dir="installer/lib/wrapper/linux/" />
466        </copy>
467        <copy todir="pkg-temp/lib/wrapper/linux64/">
468            <fileset dir="installer/lib/wrapper/linux64/" />
469        </copy>
470    </target>
471
472    <target name="preppkg-base" depends="build, preplicenses, prepConsoleDocs, prepthemeupdates, prepCertificates">
473        <!-- if updater200 was run previously, it left *.pack files in pkg-temp -->
474        <delete>
475            <fileset dir="pkg-temp" includes="**/*.jar.pack **/*.war.pack" />
476        </delete>
477        <copy file="build/i2p.jar" todir="pkg-temp/lib/" />
478        <copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
479        <copy file="build/jasper-compiler.jar" todir="pkg-temp/lib/" />
480        <copy file="build/jasper-runtime.jar" todir="pkg-temp/lib/" />
481        <copy file="build/commons-logging.jar" todir="pkg-temp/lib/" />
482        <copy file="build/commons-el.jar" todir="pkg-temp/lib/" />
483        <copy file="build/javax.servlet.jar" todir="pkg-temp/lib/" />
484        <copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
485        <copy file="build/streaming.jar" todir="pkg-temp/lib/" />
486        <copy file="build/org.mortbay.jetty.jar" todir="pkg-temp/lib/" />
487        <copy file="build/router.jar" todir="pkg-temp/lib/" />
488        <copy file="build/desktopgui.jar" todir="pkg-temp/lib/" />
489        <copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
490        <!-- pulled out of routerconsole.jar in 0.7.12; name without version so we can overwrite if we upgrade  -->
491        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
492        <copy file="build/sam.jar" todir="pkg-temp/lib/" />
493        <copy file="build/BOB.jar" todir="pkg-temp/lib/" />
494        <copy file="build/systray.jar" todir="pkg-temp/lib" />
495        <copy file="build/i2psnark.jar" todir="pkg-temp/lib/" />
496        <copy file="apps/systray/java/lib/systray4j.jar" todir="pkg-temp/lib" />
497        <copy file="build/i2ptunnel.war" todir="pkg-temp/webapps/" />
498        <copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
499        <copy file="build/addressbook.war" todir="pkg-temp/webapps/" />
500        <copy file="build/susimail.war" todir="pkg-temp/webapps/" />
501        <copy file="build/susidns.war" todir="pkg-temp/webapps/" />
502        <copy file="apps/susidns/src/WEB-INF/lib/jstl.jar" todir="pkg-temp/lib/" />
503        <copy file="apps/susidns/src/WEB-INF/lib/standard.jar" todir="pkg-temp/lib/" />
504        <copy file="build/i2psnark.war" todir="pkg-temp/webapps/" />
505        <copy file="apps/i2psnark/jetty-i2psnark.xml" todir="pkg-temp/" />
506        <copy file="apps/i2psnark/i2psnark.config" todir="pkg-temp/" />
507        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
508        <copy file="installer/resources/clients.config" todir="pkg-temp/" />
509        <copy file="installer/resources/i2ptunnel.config" todir="pkg-temp/" />
510        <copy file="installer/resources/systray.config" todir="pkg-temp/" />
511        <copy file="installer/resources/wrapper.config" todir="pkg-temp/" />
512        <copy file="installer/resources/hosts.txt" todir="pkg-temp/" />
513        <copy file="INSTALL-headless.txt" todir="pkg-temp/" />
514        <!-- overwrite the truncated history put in by the updater -->
515        <copy file="history.txt" todir="pkg-temp/" overwrite="true" />
516        <mkdir dir="pkg-temp/scripts" />
517        <copy file="apps/proxyscript/i2pProxy.pac" todir="pkg-temp/scripts/" />
518        <copy file="installer/resources/startconsole.html" todir="pkg-temp/docs/" />
519        <copy file="installer/resources/start.ico" todir="pkg-temp/docs/" />
520        <copy file="installer/resources/console.ico" todir="pkg-temp/docs/" />
521        <copy file="installer/resources/uninstall.ico" todir="pkg-temp/docs/" />
522        <!-- Eepsite stuff here -->
523        <mkdir dir="pkg-temp/eepsite" />
524        <mkdir dir="pkg-temp/eepsite/webapps" />
525        <mkdir dir="pkg-temp/eepsite/logs" />
526        <mkdir dir="pkg-temp/eepsite/cgi-bin" />
527        <mkdir dir="pkg-temp/eepsite/docroot" />
528        <mkdir dir="pkg-temp/eepsite/docroot/help" />
529        <mkdir dir="pkg-temp/eepsite/docroot/help/lib" />
530        <copy todir="pkg-temp/eepsite/docroot/" >
531            <fileset dir="installer/resources/eepsite.help/" />
532        </copy>
533        <copy todir="pkg-temp/eepsite/docroot/help/lib/" >
534            <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" />
535        </copy>
536        <copy file="installer/resources/themes/console/images/favicon.ico" tofile="pkg-temp/eepsite/docroot/favicon.ico" />
537        <copy file="installer/resources/jetty.xml" tofile="pkg-temp/eepsite/jetty.xml" />
538    </target>
539
540    <target name="preplicenses">
541        <copy file="LICENSE.txt" todir="pkg-temp/" />
542        <copy todir="pkg-temp/licenses/" >
543          <fileset dir="licenses/" />
544        </copy>
545        <!--
546              The license in launch4j/ is a BSD license for launch4j
547              The license in launch4j/head is a MIT license for the code that is actually wrapped around the jars
548              So we include the MIT one in our binary package
549         -->
550        <copy file="installer/lib/launch4j/head/LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-Launch4j.txt" />
551        <!--  Not sure if these are used or should be included -->
552        <copy file="installer/lib/launch4j/lib/foxtrot.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-Foxtrot.txt" />
553        <copy file="installer/lib/launch4j/lib/JGoodies.Forms.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-JGoodies-Forms.txt" />
554        <copy file="installer/lib/launch4j/lib/JGoodies.Looks.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-JGoodies-Looks.txt" />
555        <copy file="installer/lib/launch4j/lib/XStream.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-XStream.txt" />
556    </target>
557
558    <target name="prepthemeupdates">
559        <copy todir="pkg-temp/docs/themes/" >
560            <fileset dir="installer/resources/themes/" />
561        </copy>
562    </target>
563
564    <!-- SSL Certs -->
565    <target name="prepCertificates">
566        <copy todir="pkg-temp/certificates/" >
567          <fileset dir="installer/resources/certificates/" />
568        </copy>
569    </target>
570
571    <!-- this is no longer required, izpack 4.3.0 supports headless installs with java -jar i2pinstall.exe -console -->
572    <target name="tarball" depends="preppkg">
573        <tar compression="bzip2" destfile="i2p.tar.bz2">
574            <tarfileset dir="pkg-temp" includes="**/*" prefix="i2p" />
575        </tar>
576    </target>
577
578    <target name="deletepkg-temp">
579        <delete dir="pkg-temp" />
580    </target>
581
582    <!-- readme and proxy error page files, initialNews.xml files, GeoIP files, and flag icons -->
583    <target name="prepConsoleDocs" depends="prepConsoleDocUpdates, prepgeoupdate" >
584        <copy todir="pkg-temp/docs/initialNews/">
585          <fileset dir="installer/resources/initialNews/" />
586        </copy>
587    </target>
588
589    <!-- readme and proxy error page files -->
590    <target name="prepConsoleDocUpdates">
591        <copy todir="pkg-temp/docs/" >
592          <fileset dir="installer/resources/readme/" includes="readme*.html" />
593          <fileset dir="installer/resources/proxy/" includes="*.ht" />
594          <!-- lang_ar.png added in 0.8.4 -->
595          <fileset dir="installer/resources/" includes="icons/flags/lang_ar.png" />
596        </copy>
597    </target>
598
599    <target name="consoleDocs" depends="deletepkg-temp, prepConsoleDocs">
600        <zip destfile="docs.zip" basedir="pkg-temp" whenempty="fail" />
601    </target>
602
603    <target name="copyJavadoc" depends="javadoc">
604        <copy todir="pkg-temp/docs/javadoc" >
605          <fileset dir="build/javadoc/" />
606        </copy>
607    </target>
608
609    <target name="updater200" depends="prepupdate, preplicenses, pack200, zipit200" />
610    <target name="updater200WithJettyFixes" depends="prepjupdatefixes, preplicenses, pack200, zipit200" />
611    <target name="updater" depends="prepupdate, preplicenses, zipit" />
612    <target name="updaterWithJavadoc" depends="prepupdate, preplicenses, copyJavadoc, zipit" />
613    <target name="updaterWithGeoIP" depends="prepupdate, prepgeoupdate, preplicenses, zipit" />
614    <target name="updaterWithJetty" depends="prepjupdate, preplicenses, zipit" />
615    <target name="updaterWithJettyFixes" depends="prepjupdatefixes, preplicenses, zipit" />
616    <target name="updaterWithJettyFixesAndGeoIP" depends="prepjupdatefixes, prepgeoupdate, preplicenses, zipit" />
617    <target name="updaterSmall" depends="prepupdateSmall, zipit" />
618    <target name="updaterRouter" depends="prepupdateRouter, zipit" />
619    <target name="zipit">
620        <zip destfile="i2pupdate.zip" basedir="pkg-temp" whenempty="fail" />
621       <!-- just a test, makes almost no difference
622        <tar destfile="i2pupdate.tgz" basedir="pkg-temp" compression="gzip" />
623        <tar destfile="i2pupdate.tbz" basedir="pkg-temp" compression="bzip2" />
624       -->
625    </target>
626    <target name="zipit200">
627        <zip destfile="i2pupdate200.zip" basedir="pkg-temp" whenempty="fail" />
628    </target>
629
630    <target name="pack200">
631<!-- *nix here -->
632        <exec executable="sh" osfamily="unix" failonerror="true">
633            <arg value="-c" />
634            <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" />
635        </exec>
636        <exec executable="sh" osfamily="mac" failonerror="true">
637            <arg value="-c" />
638            <!-- pack200 will only pack to a .pack file, and only from a .jar file, so we put another .jar on the end -->
639            <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" />
640        </exec>
641<!-- windoz here : i admit, i hate escaped symbols in xml, indeed = =! -->
642                <exec executable="cmd" osfamily="windows" failonerror="true">
643                        <arg value="/c" />
644                        <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" />
645        </exec>
646                <exec executable="cmd" osfamily="windows" failonerror="true">
647                        <arg value="/c" />
648                        <arg value="for %i in (pkg-temp\lib\*.jar) do move %i %i.jar &amp;&amp; pack200 -g pkg-temp\lib\%~ni.jar.pack %i.jar &amp;&amp; del %i.jar" />
649        </exec>
650    </target>
651
652    <target name="updateTest" depends="prepupdate">
653        <ant dir="core/java/" target="jarTest" />   
654        <copy file="core/java/build/i2ptest.jar" todir="pkg-temp/lib" />
655        <zip destfile="i2pupdate.zip" basedir="pkg-temp" />
656    </target>
657
658    <target name="prepupdate" depends="build2, prepupdateSmall, prepConsoleDocUpdates, prepCertificates">
659        <copy file="build/BOB.jar" todir="pkg-temp/lib/" />
660        <copy file="build/sam.jar" todir="pkg-temp/lib/" />
661        <copy file="build/i2psnark.jar" todir="pkg-temp/lib" />
662        <!-- include systray changes in 0.7.5 -->
663        <copy file="build/systray.jar" todir="pkg-temp/lib/" />
664        <copy file="build/desktopgui.jar" todir="pkg-temp/lib/" />
665        <copy file="build/susimail.war" todir="pkg-temp/webapps/" />
666        <copy file="build/susidns.war" todir="pkg-temp/webapps/" />
667        <!-- as of 0.7.12; someday, we can remove these from the updater -->
668        <copy file="apps/susidns/src/WEB-INF/lib/jstl.jar" todir="pkg-temp/lib/" />
669        <copy file="apps/susidns/src/WEB-INF/lib/standard.jar" todir="pkg-temp/lib/" />
670        <copy file="build/i2psnark.war" todir="pkg-temp/webapps/" />
671        <copy file="history.txt" todir="pkg-temp/" />
672        <!-- the following overwrites history.txt on unix to shrink the update file -->
673        <exec executable="head" osfamily="unix" failifexecutionfails="true" output="pkg-temp/history.txt">
674            <arg value="-n" />
675            <arg value="1500" />
676            <arg value="history.txt" />
677        </exec>
678        <exec executable="echo" osfamily="unix" failifexecutionfails="true" output="pkg-temp/history.txt" append="true">
679            <arg value="EARLIER HISTORY IS AVAILABLE IN THE SOURCE PACKAGE" />
680        </exec>
681      <!-- May be pointless now, people with split directories will never see this,
682           and for flat installs we don't want to overwrite news more recent than the update package.
683        <copy file="installer/resources/news.xml" todir="pkg-temp/docs/" />
684       -->
685    </target>
686
687    <target name="prepupdateSmall" depends="buildSmall, prepupdateRouter, prepthemeupdates">
688        <copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
689        <copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
690        <copy file="build/streaming.jar" todir="pkg-temp/lib/" />
691        <copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
692        <!-- pulled out of routerconsole.jar in 0.7.12, someday we can take out of updater -->
693        <!-- name without version so we can overwrite if we upgrade  -->
694        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
695        <copy file="build/i2ptunnel.war" todir="pkg-temp/webapps/" />
696        <copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
697        <copy file="build/addressbook.war" todir="pkg-temp/webapps/" />
698        <!-- decapitalized the file in 0.7.8 -->
699       <copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
700    </target>
701
702    <target name="prepupdateRouter" depends="buildrouter, deletepkg-temp">
703        <copy file="build/i2p.jar" todir="pkg-temp/lib/" />
704        <copy file="build/router.jar" todir="pkg-temp/lib/" />
705    </target>
706
707    <!-- GeoIP files and flag icons -->
708    <target name="prepgeoupdate">
709        <copy file="installer/resources/geoip.txt" todir="pkg-temp/geoip/" />
710        <copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
711        <copy todir="pkg-temp/docs/icons/flags" >
712          <fileset dir="installer/resources/icons/flags" />
713        </copy>
714    </target>
715
716    <target name="prepjupdate" depends="prepupdate, buildWEB">
717        <copy file="build/jasper-compiler.jar" todir="pkg-temp/lib/" />
718        <copy file="build/jasper-runtime.jar" todir="pkg-temp/lib/" />
719        <copy file="build/commons-logging.jar" todir="pkg-temp/lib/" />
720        <copy file="build/commons-el.jar" todir="pkg-temp/lib/" />
721        <copy file="build/javax.servlet.jar" todir="pkg-temp/lib/" />
722        <copy file="build/org.mortbay.jetty.jar" todir="pkg-temp/lib/" />
723    </target>
724    <target name="prepjupdatefixes" depends="prepupdate, buildWEB">
725        <copy file="build/org.mortbay.jetty.jar" todir="pkg-temp/lib/" />
726    </target>
727    <target name="installer" depends="preppkg, buildProperties">
728        <taskdef name="izpack" classpath="${basedir}/installer/lib/izpack/standalone-compiler.jar" classname="com.izforge.izpack.ant.IzPackTask" />
729        <mkdir dir="pkg-temp/installer" />
730        <exec executable="mtn" outputproperty="workspace.changes.util" errorproperty="mtn.error.util" failifexecutionfails="false" >
731            <arg value="list" />
732            <arg value="changed" />
733            <arg value="core/java/src/net/i2p/util" />
734        </exec>
735        <!-- \n in an attribute value generates an invalid manifest -->
736        <exec executable="tr" inputstring="${workspace.changes.util}" outputproperty="workspace.changes.util.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
737            <arg value="-s" />
738            <arg value="[:space:]" />
739            <arg value="," />
740        </exec>
741        <jar destfile="./pkg-temp/installer/copy.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Copy.class net/i2p/util/FileUtil.class">
742            <manifest>
743                <attribute name="Main-Class" value="net.i2p.util.Copy" />
744                <attribute name="Build-Date" value="${build.timestamp}" />
745                <attribute name="Base-Revision" value="${workspace.version}" />
746                <attribute name="Workspace-Changes" value="${workspace.changes.util.tr}" />
747            </manifest>
748        </jar>
749        <jar destfile="./pkg-temp/installer/delete.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Delete.class net/i2p/util/FileUtil.class">
750            <manifest>
751                <attribute name="Main-Class" value="net.i2p.util.Delete" />
752                <attribute name="Build-Date" value="${build.timestamp}" />
753                <attribute name="Base-Revision" value="${workspace.version}" />
754                <attribute name="Workspace-Changes" value="${workspace.changes.util.tr}" />
755            </manifest>
756        </jar>
757        <jar destfile="./pkg-temp/installer/exec.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Exec.class">
758            <manifest>
759                <attribute name="Main-Class" value="net.i2p.util.Exec" />
760                <attribute name="Build-Date" value="${build.timestamp}" />
761                <attribute name="Base-Revision" value="${workspace.version}" />
762                <attribute name="Workspace-Changes" value="${workspace.changes.util.tr}" />
763            </manifest>
764        </jar>
765        <!--
766          Force 1.5 pack200 output
767          Doesnt work!
768          http://jira.codehaus.org/browse/IZPACK-404
769          http://forums.sun.com/thread.jspa?threadID=773439
770          http://bfo.co.uk/blog/2010/05/13/combining_ant_jar_signatures_and_pack200.html
771        <property name="com.sun.java.util.jar.pack.package.majver" value="150" />
772        <property name="com.sun.java.util.jar.pack.package.minver" value="7" />
773        -->
774        <izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
775
776        <ant target="installerexe" />
777    </target>
778    <target name="installerexe">
779        <condition property="noExe">
780            <os arch="x86_64" />
781        </condition>
782        <condition property="noExe">
783            <os arch="amd64" />
784        </condition>
785        <condition property="noExe">
786           <not>
787            <or>
788             <os name="Linux" />
789             <os family="windows" />
790            </or>
791           </not>
792        </condition>
793        <ant target="doInstallerEXE" />
794    </target>
795    <target name="doInstallerEXE" unless="noExe">
796        <!-- now the installer exe -->
797        <taskdef name="launch4j"
798                 classname="net.sf.launch4j.ant.Launch4jTask"
799                 classpath="${basedir}/installer/lib/launch4j/launch4j.jar:${basedir}/installer/lib/launch4j/lib/xstream.jar" />
800        <launch4j configFile="./installer/i2pinstaller.xml" />
801        <launch4j configFile="./installer/i2pstandalone.xml" />
802        <!-- thazzit -->
803    </target>
804
805    <target name="test" depends="buildProperties" >
806        <ant dir="core/java/" target="test" />
807    </target>
808    <target name="junit.report" depends="buildProperties" >
809        <ant dir="core/java/" target="junit.report" />
810    </target>
811    <target name="clover.report" depends="buildProperties" >
812        <ant dir="core/java/" target="clover.report" />
813    </target>
814    <target name="test.report" depends="junit.report, clover.report"/>
815    <target name="fulltest" depends="buildProperties" >
816                <ant dir="core/java/" target="fulltest" />
817                <ant dir="router/java/" target="fulltest" />
818    </target>
819    <target name="fullclovertest" depends="buildProperties" >
820                <ant dir="core/java/" target="fullclovertest" />
821                <ant dir="router/java/" target="fullclovertest" />
822    </target>
823
824    <target name="syndie" >
825        <ant dir="apps/syndie/java/" target="standalone" />
826        <copy file="apps/syndie/java/syndie-standalone.zip" todir="." />
827    </target>
828    <target name="i2psnark" depends="buildProperties" >
829        <ant dir="apps/i2psnark/java" target="standalone" />
830        <copy file="apps/i2psnark/java/i2psnark-standalone.zip" todir="." />
831    </target>
832    <target name="slackpkg">
833        <echo message="Building Slackware package." />
834        <ant dir="Slackware/i2p/" target="slackpkg" />
835        <ant dir="Slackware/i2p-base/" target="slackpkg" />
836    </target>
837    <target name="justBOB" depends="builddepSmall">
838        <ant dir="apps/BOB/" target="onejar" />
839        <copy file="apps/BOB/dist/BOB-one.jar" todir="." />
840    </target>
841    <target name="findbugs" depends="build2">
842        <echo message="Starting findbugs, this will take a while..." />
843        <exec executable="nice" failonerror="true">
844            <arg value="findbugs"/>
845            <arg value="-textui"/>
846            <arg value="-projectName"/>
847            <arg value="i2p"/>
848            <arg value="-sortByClass"/>
849            <arg value="-xml"/>
850            <arg value="-output"/>
851            <arg value="i2p.fba"/>
852            <arg value="-auxclasspath"/>
853            <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/linux/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"/>
854            <arg value="-sourcepath"/>
855            <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/"/>
856            <!-- start of the files to be analyzed -->
857            <arg value="build/BOB.jar"/>
858            <arg value="build/addressbook.war"/>
859            <arg value="build/i2p.jar"/>
860            <arg value="build/i2psnark.jar"/>
861            <arg value="build/i2psnark.war"/>
862            <arg value="build/i2ptunnel.jar"/>
863            <arg value="build/i2ptunnel.war"/>
864            <arg value="build/mstreaming.jar"/>
865            <arg value="build/router.jar/"/>
866            <arg value="build/desktopgui.jar"/>
867            <arg value="build/routerconsole.jar"/>
868            <arg value="build/routerconsole.war"/>
869            <arg value="build/sam.jar"/>
870            <arg value="build/streaming.jar"/>
871            <arg value="build/susidns.war"/>
872            <arg value="build/susimail.war"/>
873            <arg value="build/systray.jar"/>
874        </exec>
875        <echo message="Findbugs output stored in i2p.fba" />
876        <echo message="Now run: findbugs i2p.fba" />
877    </target>
878
879    <!-- this is the same dependency as pkg, but with updater200 in the middle,
880         since preppkg puts too much stuff in pkg-temp -->
881    <target name="release" depends="distclean, updater, updater200, preppkg, installer" >
882        <echo message="================================================================" />
883        <echo message="Did you update these files?" />
884        <exec executable="ls" failonerror="true">
885            <arg value="-l" />
886            <arg value="history.txt" />
887            <arg value="installer/install.xml" />
888            <arg value="installer/resources/news.xml" />
889            <arg value="core/java/src/net/i2p/CoreVersion.java" />
890            <arg value="router/java/src/net/i2p/router/RouterVersion.java" />
891        </exec>
892        <echo message="Everything is checked in, right? Let's be sure:" />
893        <exec executable="mtn" failonerror="true">
894            <arg value="st" />
895        </exec>
896        <echo message="If there are any modified files above, stop now!" />
897        <!-- get release version number -->
898        <exec executable="grep" outputproperty="versionLine" failonerror="true" >
899            <arg value="public final static String VERSION" />
900            <arg value="core/java/src/net/i2p/CoreVersion.java" />
901        </exec>
902        <exec executable="cut" inputstring="${versionLine}" outputproperty="release.number" failonerror="true" >
903            <arg value="-f2" />
904            <arg value="-d&quot;" />
905        </exec>
906        <echo message="New version number is ${release.number}" />
907        <copy file="i2pupdate.zip" tofile="i2pupdate_${release.number}.zip" />
908        <copy file="i2pinstall.exe" tofile="i2pinstall_${release.number}.exe" />
909        <delete file="i2pupdate.sud" failonerror="false" />
910        <delete file="i2pupdate.su2" failonerror="false" />
911        <input message="Enter private signing key file:" addproperty="release.privkey" />
912        <fail message="You must enter a path." >
913            <condition>
914                <equals arg1="${release.privkey}" arg2=""/>
915            </condition>
916        </fail>
917        <echo message="Key file is ${release.privkey}" />
918        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
919            <classpath>
920                <pathelement location="build/i2p.jar" />
921            </classpath>
922            <arg value="sign" />
923            <arg value="i2pupdate.zip" />
924            <arg value="i2pupdate.sud" />
925            <arg value="${release.privkey}" />
926            <arg value="${release.number}" />
927        </java>
928        <echo message="Verify version and VALID signature:" />
929        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
930            <classpath>
931                <pathelement location="build/i2p.jar" />
932            </classpath>
933            <arg value="verifysig" />
934            <arg value="i2pupdate.sud" />
935        </java>
936        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
937            <classpath>
938                <pathelement location="build/i2p.jar" />
939            </classpath>
940            <arg value="showversion" />
941            <arg value="i2pupdate.sud" />
942        </java>
943        <!-- now build and verify the packed sud from the packed zip -->
944        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
945            <classpath>
946                <pathelement location="build/i2p.jar" />
947            </classpath>
948            <arg value="sign" />
949            <arg value="i2pupdate200.zip" />
950            <arg value="i2pupdate.su2" />
951            <arg value="${release.privkey}" />
952            <arg value="${release.number}" />
953        </java>
954        <echo message="Verify version and VALID signature:" />
955        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
956            <classpath>
957                <pathelement location="build/i2p.jar" />
958            </classpath>
959            <arg value="verifysig" />
960            <arg value="i2pupdate.su2" />
961        </java>
962        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
963            <classpath>
964                <pathelement location="build/i2p.jar" />
965            </classpath>
966            <arg value="showversion" />
967            <arg value="i2pupdate.su2" />
968        </java>
969        <!-- will this use the monotonerc file in the current workspace? -->
970        <echo message="Checking out fresh copy into ../i2p-${release.number} for tarballing:" />
971        <delete dir="../i2p-${release.number}" />
972        <exec executable="mtn" failonerror="true">
973            <arg value="co" />
974            <arg value="-b" />
975            <arg value="i2p.i2p" />
976            <!-- w: is the revision of the current workspace -->
977            <arg value="-r" />
978            <arg value="w:" />
979            <arg value="../i2p-${release.number}/" />
980        </exec>
981        <exec executable="tar" failonerror="true">
982            <arg value="cjf" />
983            <arg value="i2psource_${release.number}.tar.bz2" />
984            <arg value="-C" />
985            <arg value=".." />
986            <arg value="--exclude" />
987            <arg value="i2p-${release.number}/_MTN*" />
988            <arg value="i2p-${release.number}/" />
989        </exec>
990        <echo message="Sign the files:" />
991        <delete file="i2pinstall_${release.number}.exe.sig" />
992        <delete file="i2psource_${release.number}.tar.bz2.sig" />
993        <delete file="i2pupdate_${release.number}.zip.sig" />
994        <exec executable="gpg" failonerror="true">
995            <arg value="-b" />
996            <arg value="i2pinstall_${release.number}.exe" />
997        </exec>
998        <exec executable="gpg" failonerror="true">
999            <arg value="-b" />
1000            <arg value="i2psource_${release.number}.tar.bz2" />
1001        </exec>
1002        <exec executable="gpg" failonerror="true">
1003            <arg value="-b" />
1004            <arg value="i2pupdate_${release.number}.zip" />
1005        </exec>
1006        <echo message="File sizes:" />
1007        <exec executable="ls" failonerror="true">
1008            <arg value="-l" />
1009            <arg value="i2pinstall_${release.number}.exe" />
1010            <arg value="i2psource_${release.number}.tar.bz2" />
1011            <arg value="i2pupdate_${release.number}.zip" />
1012            <arg value="i2pupdate.su2" />
1013            <arg value="i2pupdate.sud" />
1014            <arg value="i2pinstall_${release.number}.exe.sig" />
1015            <arg value="i2psource_${release.number}.tar.bz2.sig" />
1016            <arg value="i2pupdate_${release.number}.zip.sig" />
1017        </exec>
1018        <echo message="SHA256 sums:" />
1019        <exec executable="sha256sum" failonerror="true">
1020            <arg value="i2pinstall_${release.number}.exe" />
1021            <arg value="i2psource_${release.number}.tar.bz2" />
1022            <arg value="i2pupdate_${release.number}.zip" />
1023            <arg value="i2pupdate.su2" />
1024            <arg value="i2pupdate.sud" />
1025        </exec>
1026        <echo message="Don't forget to mtn tag w: i2p-${release.number}" />
1027        <echo message="... and mtn cert t:i2p-${release.number} branch i2p.i2p.release" />
1028    </target>
1029
1030    <target name="debian" depends="distclean, debian-source, debian-binary" />
1031
1032    <target name="debian-binary" depends="buildProperties" >
1033        <echo message="Did you update the version in these files?" />
1034        <exec executable="ls" failonerror="true">
1035            <arg value="-l" />
1036            <arg value="debian/changelog" />
1037        </exec>
1038        <echo message="====================" />
1039        <!-- bundle the 20MB jetty 5 lib since there probably isn't a deb for it -->
1040        <ant dir="apps/jetty" target="ensureJettylib" />
1041       
1042        <exec dir="debian" executable="./buildpackage.sh" failonerror="true">
1043            <arg value="i386" />
1044        </exec>
1045        <exec dir="debian" executable="./buildpackage.sh" failonerror="true">
1046            <arg value="amd64" />
1047        </exec>
1048    </target>
1049    <target name="debian-source" depends="buildProperties" >
1050        <!-- bundle the 20MB jetty 5 lib since there probably isn't a deb for it -->
1051        <ant dir="apps/jetty" target="ensureJettylib" />
1052        <echo message="Did you update the version in these files?" />
1053        <exec executable="ls" failonerror="true">
1054            <arg value="-l" />
1055            <arg value="debian/changelog" />
1056        </exec>
1057        <echo message="====================" />
1058        <exec dir="debian" executable="./buildpackage.sh" failonerror="true">
1059            <arg value="source" />
1060        </exec>
1061    </target>
1062    <target name="debianrepo" depends="debian">
1063        <exec dir="debian" executable="./makerepo.sh" failonerror="true"/>
1064    </target>
1065
1066<!-- the following are appened to help build barebone portable version,
1067     none of the above is modified for this purpose -->
1068        <target name = "pkg-portable-clean">
1069                <delete dir="build/" />
1070                <delete dir="pkg-temp/" />
1071                <delete>
1072                        <fileset dir="." includes="portable-**.zip**" />
1073                </delete>
1074        </target>
1075<!-- build a portable archive -->
1076
1077<!-- *0* Since we simply pack all files in folder "build/" into our archieve,
1078                we need to make sure its small, with NO redundent jars or wars.
1079                thus cleaning is required before each build-->
1080        <target name="buildSmallOnly" depends="pkg-portable-clean,buildSmall"/>
1081
1082<!-- *1* preparing the jars by OS dependent de-bloating -->
1083        <target name="preppkg-portable-win32-jbigi" depends="buildSmallOnly, jbigi-windows-only" />
1084
1085        <target name="preppkg-portable-linux-jbigi"  depends="buildSmallOnly, jbigi-linux-only" />
1086
1087<!-- *2* os independent procedure  -->
1088        <target name="preppkg-portable-basic" >
1089                <mkdir dir="pkg-temp" />
1090                        <!-- non OS dependent configurations only, dont add *nux/win stuff here -->
1091                        <copy todir="pkg-temp">
1092                                <fileset dir="installer/resources/portable/configs/" />
1093                        </copy>
1094                        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
1095                        <copy file="installer/resources/hosts.txt" todir="pkg-temp/" />
1096                        <copy file="installer/resources/readme.license.txt" todir="pkg-temp/" />
1097                <mkdir dir="pkg-temp/addressbook" />
1098                        <copy file="apps/addressbook/subscriptions.txt" todir="pkg-temp/addressbook/" />
1099                        <copy file="apps/addressbook/myhosts.txt"  todir="pkg-temp/addressbook/" />
1100                        <!-- config.txt is in installer/resources/portable -->
1101                <mkdir dir="pkg-temp/docs" />
1102                        <copy file="installer/resources/initialNews.xml" tofile="pkg-temp/docs/news.xml" overwrite="true" />
1103                        <copy file="installer/resources/readme/readme.html" tofile="pkg-temp/docs/readme.html" />
1104                        <copy file="installer/resources/startconsole.html" todir="pkg-temp/docs/" />
1105                        <copy file="installer/resources/start.ico" todir="pkg-temp/docs/" />
1106                        <copy file="installer/resources/console.ico" todir="pkg-temp/docs/" />
1107                        <!-- HTTP Header files, english only,
1108                                if you need a different lang do it in a seperate target -->
1109                        <copy todir="pkg-temp/docs/" >
1110                                <fileset dir="installer/resources/proxy/"  includes="**-header.ht" />
1111                        </copy>
1112                        <!-- Theme light only -->
1113                        <copy todir="pkg-temp/docs/themes/console/light/" overwrite="true" >
1114                                <fileset dir="installer/resources/themes/console/light/" includes="**.css" />
1115                        </copy>
1116                        <copy file="installer/resources/themes/console/light/console_big.css" todir="portable/docs/themes/console/light/" />
1117                        <copy todir="pkg-temp/docs/themes/console/images/" >
1118                                <fileset dir="installer/resources/themes/console/images/" />
1119                        </copy>
1120                        <!-- FLAGs for language icon (not for ip)-->
1121                        <copy todir="pkg-temp/docs/icons/flags" >
1122                                <fileset dir="installer/resources/icons/flags/" includes="cn.png,de.png,fr.png,nl.png,ru.png,se.png,us.png" />
1123                        </copy>
1124                <mkdir dir="pkg-temp/webapps" />
1125                        <copy todir="pkg-temp/webapps/">
1126                                <fileset dir="build/" includes="**.war" />
1127                        </copy>
1128                <mkdir dir="pkg-temp/lib" />
1129                        <copy todir ="pkg-temp/lib/" >
1130                                <fileset dir="build/" includes="**.jar" />
1131                        </copy>
1132                        <!-- 3rd party jars from apps/  -->
1133                                <!-- jrobin - without jobin , you lost graph and get a lot error entry in logs -->
1134                        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
1135        </target>
1136<!-- *3* os dependent procedure/commands -->
1137        <target name = "preppkg-portable-win32" depends="preppkg-portable-win32-jbigi,preppkg-portable-basic">
1138                        <!-- systray4.j  - why do we need trayicons for portable version ? dependency hardcoded in console -->
1139                <copy file="apps/systray/java/lib/systray4j.dll" todir="pkg-temp/lib" />
1140                <copy file="apps/systray/java/lib/systray4j.jar" todir="pkg-temp/lib" />
1141                        <!--wrapper - dont even think about it. i2p cosumes appreantly more mem without it on win32-->
1142                <copy file="installer/lib/wrapper/win32/wrapper.dll" todir="pkg-temp/lib" />
1143                <copy file="installer/lib/wrapper/win32/wrapper.jar" todir="pkg-temp/lib" />
1144                <copy file="installer/lib/wrapper/win32/I2Psvc.exe" tofile="pkg-temp/i2psvc.ex_" />
1145                        <!--  copy the unpack/start batchfiles -->
1146                <copy todir="pkg-temp">
1147                        <fileset dir="installer/resources/portable/win32/" />
1148                </copy>
1149        </target>
1150<!-- *4* command for windows package -->
1151        <target name = "pkg-portable-win32"     depends="preppkg-portable-win32, pack200" >
1152                <!-- i need the portable\ folder in .zip so basedir is set to . -->
1153                <move file="pkg-temp" tofile="portable"/>
1154                <zip destfile="portable-win32.zip" basedir="." level="9" includes="portable\**" />
1155                <checksum file="portable-win32.zip" forceOverwrite="yes"/>
1156                <move file="portable" tofile="pkg-temp"/>
1157        </target>
1158</project>
Note: See TracBrowser for help on using the repository browser.