source: build.xml @ f02a0d9

i2p-0.8.2
Last change on this file since f02a0d9 was f02a0d9, checked in by zzz <zzz@…>, 9 years ago

fix initialNews files in wrong place in installer

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