source: build.xml @ 311bb7a

Last change on this file since 311bb7a was 311bb7a, checked in by zzz <zzz@…>, 10 years ago

propagate from branch 'i2p.i2p' (head 6467dc867b03e6be51ac21be14d7f8cbdadc2bd2)

to branch 'i2p.i2p.zzz.naming' (head ed37752523387104764b68a1deaaedb5e707e827)

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