source: build.xml @ 2e51577f

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

fix up findbugs target

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