source: build.xml @ 54fdfd8

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