source: build.xml @ 2880d61

Last change on this file since 2880d61 was 2880d61, checked in by zzz <zzz@…>, 11 years ago
  • Pack200: Find and use either Oracle or Apache library at runtime;

neither required at compile time.

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