source: build.xml @ b963e2a

Last change on this file since b963e2a was b963e2a, checked in by mathiasdm <mathiasdm@…>, 11 years ago

propagate from branch 'i2p.i2p' (head 1b82a3bfd792b71321bcbd8f3b8344664db2dc45)

to branch 'i2p.i2p.mathiasdm.desktopgui' (head 4e485a19a83a3e30425e1b1a03836f35fa4ebb50)

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