source: build.xml @ 612d06b

Last change on this file since 612d06b was 612d06b, checked in by zzz <zzz@…>, 10 years ago
  • Build: Move all dependencies to top-level build.xml,

so each sub-build.xml is only executed once (true DAG)

  • Property mode set to 100644
File size: 55.9 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<project basedir="." default="all" name="i2p">
3   
4    <!-- Things you might want to change -->
5    <!-- This keeps gcj a lot quieter -->
6    <!--
7        <property name="javac.compilerargs" value="-warn:-unchecked,raw,unused,serial" />
8    -->
9    <!-- Add Apache Harmony's Pack200 library if you don't have java.util.jar.Pack200
10         See core/java/src/net/i2p/util/FileUtil.java for code changes required
11         to use this library instead of Sun's version.
12         Or to comment it all out if you don't have either.
13    -->
14    <!--
15        <property name="javac.classpath" value="/PATH/TO/pack200.jar" />
16    -->
17
18    <!-- You probably don't want to change anything from here down -->
19    <target name="help" depends="all" />
20    <target name="all" >
21        <echo message="Useful targets: " />
22        <echo message="  pkg:       distclean then package everything up (installer, clean tarball, update tarball)" />
23        <echo message="  dist:      pkg and javadoc" />
24        <echo message="  installer: build the GUI installer" />
25        <echo message="  tarball:   tar the full install into i2p.tar.bz2 (extracts to build a new clean install)" />
26        <echo message="  updater:   tar the built i2p specific files into an i2pupdate.zip (extracts safely over existing installs)" />
27        <echo message="  updaterWithJavadoc: updater including the javadocs, for display in the console" />
28        <echo message="  updaterWithJetty:   tar the built i2p specific files and jetty into an i2pupdate.zip (extracts safely over existing installs)" />
29        <echo message="  updaterWithJettyFixes: updater including local jetty patches" />
30        <echo message="  updaterWithGeoIP: updater including GeoIP Files" />
31        <echo message="  updaterWithJettyFixesAndGeoIP" />
32        <echo message="  updaterSmall:   updater with the essentials only - no SAM, i2psnark, SusiMail, SusiDNS, news.xml, or history.txt" />
33        <echo message="  updaterRouter:  updater with the i2p.jar and router.jar only" />
34        <echo message="  distclean: clean up all derived files" />
35        <echo message="  syndie:    generate a standalone syndie install" />
36        <echo message="  i2psnark:  generate a standalone i2psnark install" />
37        <echo message="  justBOB:  generate a standalone BOB-one.jar" />
38        <echo message="  javadoc:   generate javadoc for the entire project into ./build/javadoc" />
39        <echo message="  slackpkg:  generate Slackware packages in ./Slackware/i2p and ./Slackware/i2p-base" />
40        <echo message="  debianhowto: instructions on building Debian packages" />
41        <echo message="  debian: generate Debian packages in ./debian/packages" />
42        <echo message="          (libc6-i686 and libc6-amd64 required, ant>=1.8 required)" />
43        <echo message="  debianrepo: build a Debian repository (reprepro required)" />
44        <echo message="  updaterWithDesktopgui: tar the built files and desktopgui in an i2pupdate.zip" />
45        <echo message="  pkgWithDesktopgui: distclean then package everything up with the desktopgui" />
46        <echo message="  distWithDesktopgui: pkgWithDesktopgui and javadoc" />
47        <echo message="  distcleanWithDesktopgui: clean up all derived files (including desktopgui files)" />
48        <echo message="  poupdate: update the .po files for translators" />
49    </target>
50    <target name="debianhowto">
51        <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." />
52    </target>
53    <target name="dist" depends="pkg, javadoc">
54    </target>
55    <target name="build" depends="build2">
56        <!-- so we don't build standalone for the updater -->
57        <!-- This builds apps/i2psnark/java/i2psnark-standalone.zip,
58          -   which we don't distribute anywhere...
59        <ant dir="apps/i2psnark/java/" target="standalone" />
60        -->
61    </target>
62    <target name="build2" depends="builddep, jar, buildWEB" />
63    <target name="buildSmall" depends="builddepSmall, jarSmall, buildWEB" />
64    <target name="buildclean" depends="distclean, build" />
65
66    <target name="builddep" depends="builddepSmall, buildBOB, buildSAM, buildSusiMail, buildSusiDNS, buildI2PSnark" />
67
68    <target name="builddepSmall" depends="buildrouter, buildSystray, buildRouterConsole, buildStreaming, buildI2PTunnel, buildAddressbook" />
69
70    <!-- start of buildX, one for each sub-build.xml.
71         Do not put ant tasks in the sub-build.xmls anymore,
72         so the build will go faster.
73      -->
74
75    <!-- TODO remove I2PTunnel dependency in BOB -->
76    <target name="buildBOB" depends="buildStreaming, buildI2PTunnel" >
77        <ant dir="apps/BOB/" target="jar" />
78    </target>
79
80    <target name="buildSAM" depends="buildStreaming" >
81        <ant dir="apps/sam/java/" target="jar" />
82    </target>
83
84    <target name="buildSusiMail" depends="buildCore, buildJetty" >
85        <ant dir="apps/susimail/" target="war" />
86    </target>
87
88    <target name="buildSusiDNS" depends="buildCore, buildJetty" >
89        <ant dir="apps/susidns/src" target="all" />
90    </target>
91
92    <target name="buildI2PSnark" depends="buildStreaming, buildJetty" >
93        <ant dir="apps/i2psnark/java/" target="war" />
94    </target>
95
96    <target name="buildAddressbook" depends="buildCore, buildJetty" >
97        <ant dir="apps/addressbook/" target="war" />
98    </target>
99
100    <target name="buildI2PTunnel" depends="buildStreaming, buildJetty" >
101        <ant dir="apps/i2ptunnel/java/" target="build" />
102    </target>
103
104    <target name="buildRouterConsole" depends="buildrouter, buildSystray, buildJetty" >
105        <ant dir="apps/routerconsole/java/" target="jar" />
106    </target>
107
108    <target name="buildJetty" >
109        <ant dir="apps/jetty" target="build" />
110    </target>
111
112    <target name="buildSystray" depends="buildCore" >
113        <ant dir="apps/systray/java/" target="jar" />
114    </target>
115
116    <target name="buildStreaming" depends="buildMinistreaming" >
117        <ant dir="apps/streaming/java/" target="jar" />
118    </target>
119
120    <target name="buildMinistreaming" depends="buildCore" >
121        <ant dir="apps/ministreaming/java/" target="jar" />
122    </target>
123
124    <target name="buildRouter" depends="buildrouter" />
125    <target name="buildrouter" depends="buildCore" >
126        <ant dir="router/java/" target="jar" />
127        <copy file="router/java/build/router.jar" todir="build/" />
128    </target>
129
130    <target name="buildCore" >
131        <ant dir="core/java/" target="jar" />
132        <copy file="core/java/build/i2p.jar" todir="build/" />
133    </target>
134
135    <!-- end of sub-build.xml targets -->
136
137    <target name="buildWEB" depends="buildRouterConsole" >
138        <copy file="apps/routerconsole/java/build/routerconsole.jar" todir="build/" />
139        <copy file="apps/routerconsole/java/build/routerconsole.war" todir="build/" />
140        <copy file="apps/jetty/jettylib/org.mortbay.jetty.jar" todir="build/" />
141        <copy file="apps/jetty/jettylib/jasper-compiler.jar" todir="build/" />
142        <copy file="apps/jetty/jettylib/jasper-runtime.jar" todir="build/" />
143        <copy file="apps/jetty/jettylib/commons-logging.jar" todir="build/" />
144        <copy file="apps/jetty/jettylib/commons-el.jar" todir="build/" />
145        <copy file="apps/jetty/jettylib/javax.servlet.jar" todir="build/" />
146    </target>
147
148    <target name="buildexe">
149        <condition property="noExe">
150            <os arch="x86_64" />
151        </condition>
152        <condition property="noExe">
153            <os arch="ppc" />
154        </condition>
155        <condition property="noExe">
156            <os arch="amd64" />
157        </condition>
158        <condition property="noExe">
159           <not>
160            <or>
161             <os name="Linux" />
162             <os family="windows" />
163            </or>
164           </not>
165        </condition>
166        <ant target="doBuildEXE" />
167    </target>
168    <target name="doBuildEXE" unless="noExe">
169        <jar destfile="./build/launchi2p.jar">
170            <manifest>
171             <attribute name="Main-Class" value="net.i2p.router.RouterLaunch" />
172             <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" />
173            </manifest>
174        </jar>
175        <!-- now the standalone launcher exe -->
176        <taskdef name="launch4j"
177                 classname="net.sf.launch4j.ant.Launch4jTask"
178                 classpath="${basedir}/installer/lib/launch4j/launch4j.jar:${basedir}/installer/lib/launch4j/lib/xstream.jar" />
179        <launch4j configFile="./installer/i2pstandalone.xml" />
180        <!-- thazzit -->
181    </target>
182    <target name="compile" />
183    <target name="jar" depends="jarSmall" >
184        <copy file="apps/BOB/dist/BOB.jar" todir="build/" />
185        <copy file="apps/sam/java/build/sam.jar" todir="build/" />
186        <copy file="apps/susimail/susimail.war" todir="build/" />
187        <copy file="apps/susidns/src/susidns.war" todir="build/" />
188        <copy file="apps/i2psnark/i2psnark.war" todir="build/" />
189        <copy file="apps/i2psnark/java/build/i2psnark.jar" todir="build/" />
190    </target>
191    <target name="jarSmall" depends="compile" >
192        <copy file="core/java/build/i2p.jar" todir="build/" />
193        <copy file="router/java/build/router.jar" todir="build/" />
194        <copy file="apps/ministreaming/java/build/mstreaming.jar" todir="build/" />
195        <copy file="apps/streaming/java/build/streaming.jar" todir="build/" />
196        <copy file="apps/i2ptunnel/java/build/i2ptunnel.jar" todir="build/" />
197        <copy file="apps/i2ptunnel/java/build/i2ptunnel.war" todir="build/" />
198        <copy file="apps/systray/java/build/systray.jar" todir="build/" />
199        <copy file="installer/lib/jbigi/jbigi.jar" todir="build" />
200        <copy file="apps/addressbook/dist/addressbook.war" todir="build/" />
201    </target>
202    <target name="poupdate">
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.*: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/" >
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="findbugs.xml"/>
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"/>
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            <!-- use the class files rather than the jar for routerconsole so we don't analyze jrobin -->
783            <arg value="apps/routerconsole/java/build/obj/"/>
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 findbugs.xml" />
791    </target>
792    <target name="buildWithDesktopgui" depends="buildrouter,builddepSmall">
793        <ant dir="apps/desktopgui" target="build_jar" />
794    </target>
795    <target name="preppkgWithDesktopgui" depends="buildWithDesktopgui,preppkg">
796        <copy file="apps/desktopgui/dist/desktopgui.jar" todir="pkg-temp/lib/" />
797        <copy file="apps/desktopgui/lib/swing-worker.jar" todir="pkg-temp/lib/" />
798        <copy file="apps/desktopgui/lib/appframework.jar" todir="pkg-temp/lib/" />
799        <mkdir dir="pkg-temp/desktopgui/resources/" />
800        <copy todir="pkg-temp/desktopgui/resources/">
801            <fileset dir="apps/desktopgui/desktopgui/resources/" />
802        </copy>
803    </target>
804    <target name="installerWithDesktopgui" depends="preppkgWithDesktopgui,installer" />
805    <target name="prepupdateWithDesktopgui" depends="buildWithDesktopgui,prepupdate">
806        <copy file="apps/desktopgui/dist/desktopgui.jar" todir="pkg-temp/lib/" />
807        <copy file="apps/desktopgui/lib/swing-worker.jar" todir="pkg-temp/lib/" />
808        <copy file="apps/desktopgui/lib/appframework.jar" todir="pkg-temp/lib/" />
809        <mkdir dir="pkg-temp/desktopgui/resources/" />
810        <copy todir="pkg-temp/desktopgui/resources/">
811            <fileset dir="apps/desktopgui/desktopgui/resources/" />
812        </copy>
813    </target>
814    <target name="updaterWithDesktopgui" depends="prepupdateWithDesktopgui,updater" />
815    <target name="pkgWithDesktopgui" depends="distclean, updaterWithDesktopgui, installerWithDesktopgui, preppkg" />
816    <target name="distWithDesktopgui" depends="pkgWithDesktopgui, javadoc" />
817    <target name="distcleanWithDesktopgui" depends="distclean">
818        <ant dir="apps/desktopgui" target="build_clean" />
819    </target>
820
821    <!-- this is the same dependency as pkg, but with updater200 in the middle,
822         since preppkg puts too much stuff in pkg-temp -->
823    <target name="release" depends="distclean, updater, updater200, preppkg, installer" >
824        <echo message="================================================================" />
825        <echo message="Did you update these files?" />
826        <exec executable="ls" failonerror="true">
827            <arg value="-l" />
828            <arg value="history.txt" />
829            <arg value="installer/install.xml" />
830            <arg value="installer/resources/news.xml" />
831            <arg value="core/java/src/net/i2p/CoreVersion.java" />
832            <arg value="router/java/src/net/i2p/router/RouterVersion.java" />
833        </exec>
834        <echo message="Everything is checked in, right? Let's be sure:" />
835        <exec executable="mtn" failonerror="true">
836            <arg value="st" />
837        </exec>
838        <echo message="If there are any modified files above, stop now!" />
839        <!-- get release version number -->
840        <exec executable="grep" outputproperty="versionLine" failonerror="true" >
841            <arg value="public final static String VERSION" />
842            <arg value="core/java/src/net/i2p/CoreVersion.java" />
843        </exec>
844        <exec executable="cut" inputstring="${versionLine}" outputproperty="release.number" failonerror="true" >
845            <arg value="-f2" />
846            <arg value="-d&quot;" />
847        </exec>
848        <echo message="New version number is ${release.number}" />
849        <copy file="i2pupdate.zip" tofile="i2pupdate_${release.number}.zip" />
850        <copy file="i2pinstall.exe" tofile="i2pinstall_${release.number}.exe" />
851        <delete file="i2pupdate.sud" failonerror="false" />
852        <delete file="i2pupdate.su2" failonerror="false" />
853        <input message="Enter private signing key file:" addproperty="release.privkey" />
854        <fail message="You must enter a path." >
855            <condition>
856                <equals arg1="${release.privkey}" arg2=""/>
857            </condition>
858        </fail>
859        <echo message="Key file is ${release.privkey}" />
860        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
861            <classpath>
862                <pathelement location="build/i2p.jar" />
863            </classpath>
864            <arg value="sign" />
865            <arg value="i2pupdate.zip" />
866            <arg value="i2pupdate.sud" />
867            <arg value="${release.privkey}" />
868            <arg value="${release.number}" />
869        </java>
870        <echo message="Verify version and VALID signature:" />
871        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
872            <classpath>
873                <pathelement location="build/i2p.jar" />
874            </classpath>
875            <arg value="verifysig" />
876            <arg value="i2pupdate.sud" />
877        </java>
878        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
879            <classpath>
880                <pathelement location="build/i2p.jar" />
881            </classpath>
882            <arg value="showversion" />
883            <arg value="i2pupdate.sud" />
884        </java>
885        <!-- now build and verify the packed sud from the packed zip -->
886        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
887            <classpath>
888                <pathelement location="build/i2p.jar" />
889            </classpath>
890            <arg value="sign" />
891            <arg value="i2pupdate200.zip" />
892            <arg value="i2pupdate.su2" />
893            <arg value="${release.privkey}" />
894            <arg value="${release.number}" />
895        </java>
896        <echo message="Verify version and VALID signature:" />
897        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
898            <classpath>
899                <pathelement location="build/i2p.jar" />
900            </classpath>
901            <arg value="verifysig" />
902            <arg value="i2pupdate.su2" />
903        </java>
904        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
905            <classpath>
906                <pathelement location="build/i2p.jar" />
907            </classpath>
908            <arg value="showversion" />
909            <arg value="i2pupdate.su2" />
910        </java>
911        <!-- will this use the monotonerc file in the current workspace? -->
912        <echo message="Checking out fresh copy into ../i2p-${release.number} for tarballing:" />
913        <delete dir="../i2p-${release.number}" />
914        <exec executable="mtn" failonerror="true">
915            <arg value="co" />
916            <arg value="-b" />
917            <arg value="i2p.i2p" />
918            <!-- w: is the revision of the current workspace -->
919            <arg value="-r" />
920            <arg value="w:" />
921            <arg value="../i2p-${release.number}/" />
922        </exec>
923        <exec executable="tar" failonerror="true">
924            <arg value="cjf" />
925            <arg value="i2psource_${release.number}.tar.bz2" />
926            <arg value="-C" />
927            <arg value=".." />
928            <arg value="--exclude" />
929            <arg value="i2p-${release.number}/_MTN*" />
930            <arg value="i2p-${release.number}/" />
931        </exec>
932        <echo message="Sign the files:" />
933        <delete file="i2pinstall_${release.number}.exe.sig" />
934        <delete file="i2psource_${release.number}.tar.bz2.sig" />
935        <delete file="i2pupdate_${release.number}.zip.sig" />
936        <exec executable="gpg" failonerror="true">
937            <arg value="-b" />
938            <arg value="i2pinstall_${release.number}.exe" />
939        </exec>
940        <exec executable="gpg" failonerror="true">
941            <arg value="-b" />
942            <arg value="i2psource_${release.number}.tar.bz2" />
943        </exec>
944        <exec executable="gpg" failonerror="true">
945            <arg value="-b" />
946            <arg value="i2pupdate_${release.number}.zip" />
947        </exec>
948        <echo message="File sizes:" />
949        <exec executable="ls" failonerror="true">
950            <arg value="-l" />
951            <arg value="i2pinstall_${release.number}.exe" />
952            <arg value="i2psource_${release.number}.tar.bz2" />
953            <arg value="i2pupdate_${release.number}.zip" />
954            <arg value="i2pupdate.su2" />
955            <arg value="i2pupdate.sud" />
956            <arg value="i2pinstall_${release.number}.exe.sig" />
957            <arg value="i2psource_${release.number}.tar.bz2.sig" />
958            <arg value="i2pupdate_${release.number}.zip.sig" />
959        </exec>
960        <echo message="SHA256 sums:" />
961        <exec executable="sha256sum" failonerror="true">
962            <arg value="i2pinstall_${release.number}.exe" />
963            <arg value="i2psource_${release.number}.tar.bz2" />
964            <arg value="i2pupdate_${release.number}.zip" />
965            <arg value="i2pupdate.su2" />
966            <arg value="i2pupdate.sud" />
967        </exec>
968        <echo message="Don't forget to mtn tag w: i2p-${release.number}" />
969        <echo message="... and mtn cert t:i2p-${release.number} branch i2p.i2p.release" />
970    </target>
971
972    <target name="debian" depends="distclean, debian-source, debian-binary" />
973
974    <target name="debian-binary">
975        <echo message="Did you update the version in these files?" />
976        <exec executable="ls" failonerror="true">
977            <arg value="-l" />
978            <arg value="debian/changelog" />
979        </exec>
980        <echo message="====================" />
981        <!-- bundle the 20MB jetty 5 lib since there probably isn't a deb for it -->
982        <ant dir="apps/jetty" target="ensureJettylib" />
983       
984        <exec dir="debian" executable="./buildpackage.sh" failonerror="true">
985            <arg value="i386" />
986        </exec>
987        <exec dir="debian" executable="./buildpackage.sh" failonerror="true">
988            <arg value="amd64" />
989        </exec>
990    </target>
991    <target name="debian-source">
992        <!-- bundle the 20MB jetty 5 lib since there probably isn't a deb for it -->
993        <ant dir="apps/jetty" target="ensureJettylib" />
994        <echo message="Did you update the version in these files?" />
995        <exec executable="ls" failonerror="true">
996            <arg value="-l" />
997            <arg value="debian/changelog" />
998        </exec>
999        <echo message="====================" />
1000        <exec dir="debian" executable="./buildpackage.sh" failonerror="true">
1001            <arg value="source" />
1002        </exec>
1003    </target>
1004    <target name="debianrepo" depends="debian">
1005        <exec dir="debian" executable="./makerepo.sh" failonerror="true"/>
1006    </target>
1007
1008<!-- the following are appened to help build barebone portable version,
1009     none of the above is modified for this purpose -->
1010        <target name = "pkg-portable-clean">
1011                <delete dir="build/" />
1012                <delete dir="pkg-temp/" />
1013                <delete>
1014                        <fileset dir="." includes="portable-**.zip**" />
1015                </delete>
1016        </target>
1017<!-- build a portable archive -->
1018
1019<!-- *0* Since we simply pack all files in folder "build/" into our archieve,
1020                we need to make sure its small, with NO redundent jars or wars.
1021                thus cleaning is required before each build-->
1022        <target name="buildSmallOnly" depends="pkg-portable-clean,buildSmall"/>
1023<!-- *1* preparing the jars by OS dependent de-bloating -->
1024        <target name="preppkg-portable-win32-jbigi" depends="buildSmallOnly">
1025                <!-- rip the non-windows stuff out of jbigi.jar -->
1026                <mkdir dir="tmpextract" />
1027                <unjar src="build/jbigi.jar" dest="tmpextract/" />
1028                <jar destfile="build/jbigi.jar" >
1029                        <fileset dir="tmpextract/" includes="*windows*" />
1030                </jar>
1031                <delete dir="tmpextract/" />
1032        </target>
1033        <target name="preppkg-portable-linux-jbigi"  depends="buildSmallOnly">
1034                <!-- rip the non-linux stuff out of jbigi.jar -->
1035                <mkdir dir="tmpextract" />
1036                <unjar src="build/jbigi.jar" dest="tmpextract/" />
1037                <jar destfile="build/jbigi.jar" >
1038                        <fileset dir="tmpextract/" includes="*linux*" />
1039                </jar>
1040                <delete dir="tmpextract/" />
1041        </target>
1042
1043<!-- *2* os independent procedure  -->
1044        <target name="preppkg-portable-basic" >
1045                <mkdir dir="pkg-temp" />
1046                        <!-- non OS dependent configurations only, dont add *nux/win stuff here -->
1047                        <copy todir="pkg-temp">
1048                                <fileset dir="installer/resources/portable/configs/" />
1049                        </copy>
1050                        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
1051                        <copy file="installer/resources/hosts.txt" todir="pkg-temp/" />
1052                        <copy file="installer/resources/readme.license.txt" todir="pkg-temp/" />
1053                <mkdir dir="pkg-temp/addressbook" />
1054                        <copy file="apps/addressbook/subscriptions.txt" todir="pkg-temp/addressbook/" />
1055                        <copy file="apps/addressbook/myhosts.txt"  todir="pkg-temp/addressbook/" />
1056                        <!-- config.txt is in installer/resources/portable -->
1057                <mkdir dir="pkg-temp/docs" />
1058                        <copy file="installer/resources/initialNews.xml" tofile="pkg-temp/docs/news.xml" overwrite="true" />
1059                        <copy file="installer/resources/readme/readme.html" tofile="pkg-temp/docs/readme.html" />
1060                        <copy file="installer/resources/startconsole.html" todir="pkg-temp/docs/" />
1061                        <copy file="installer/resources/start.ico" todir="pkg-temp/docs/" />
1062                        <copy file="installer/resources/console.ico" todir="pkg-temp/docs/" />
1063                        <!-- HTTP Header files, english only,
1064                                if you need a different lang do it in a sepreate target -->
1065                        <copy todir="pkg-temp/docs/" >
1066                                <fileset dir="installer/resources/proxy/"  includes="**-header.ht" />
1067                        </copy>
1068                        <!-- Theme light only -->
1069                        <copy todir="pkg-temp/docs/themes/console/light/" overwrite="true" >
1070                                <fileset dir="installer/resources/themes/console/light/" includes="**.css" />
1071                        </copy>
1072<!-- @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/" / -->
1073                        <copy todir="pkg-temp/docs/themes/console/images/" >
1074                                <fileset dir="installer/resources/themes/console/images/" />
1075                        </copy>
1076                        <!-- FLAGs for language icon (not for ip)-->
1077                        <copy todir="pkg-temp/docs/icons/flags" >
1078                                <fileset dir="installer/resources/icons/flags/" includes="cn.png,de.png,fr.png,nl.png,ru.png,se.png,us.png" />
1079                        </copy>
1080                <mkdir dir="pkg-temp/webapps" />
1081                        <copy todir="pkg-temp/webapps/">
1082                                <fileset dir="build/" includes="**.war" />
1083                        </copy>
1084                <mkdir dir="pkg-temp/lib" />
1085                        <copy todir ="pkg-temp/lib/" >
1086                                <fileset dir="build/" includes="**.jar" />
1087                        </copy>
1088                        <!-- 3rd party jars from apps/  -->
1089                                <!-- jrobin - without jobin , you lost graph and get a lot error entry in logs -->
1090                        <copy file="apps/jrobin/jrobin-1.4.0.jar" tofile="pkg-temp/lib/jrobin.jar" />
1091        </target>
1092<!-- *3* os dependent procedure/commands -->
1093        <target name = "preppkg-portable-win32" depends="preppkg-portable-win32-jbigi,preppkg-portable-basic">
1094                        <!-- systray4.j  - why do we need trayicons for portable version ? dependency hardcoded in console -->
1095                <copy file="apps/systray/java/lib/systray4j.dll" todir="pkg-temp/lib" />
1096                <copy file="apps/systray/java/lib/systray4j.jar" todir="pkg-temp/lib" />
1097                        <!--wrapper - dont even think about it. i2p cosumes appreantly more mem without it on win32-->
1098                <copy file="installer/lib/wrapper/win32/wrapper.dll" todir="pkg-temp/lib" />
1099                <copy file="installer/lib/wrapper/win32/wrapper.jar" todir="pkg-temp/lib" />
1100                <copy file="installer/lib/wrapper/win32/I2Psvc.exe" tofile="pkg-temp/i2psvc.ex_" />
1101                        <!--  copy the unpack/start batchfiles -->
1102                <copy todir="pkg-temp">
1103                        <fileset dir="installer/resources/portable/win32/" />
1104                </copy>
1105        </target>
1106<!-- *4* command for windows package -->
1107        <target name = "pkg-portable-win32"     depends="preppkg-portable-win32, pack200" >
1108                <!-- i need the portable\ folder in .zip so basedir is set to . -->
1109                <move file="pkg-temp" tofile="portable"/>
1110                <zip destfile="portable-win32.zip" basedir="." level="9" includes="portable\**" />
1111                <checksum file="portable-win32.zip" forceOverwrite="yes"/>
1112                <move file="portable" tofile="pkg-temp"/>
1113        </target>
1114</project>
Note: See TracBrowser for help on using the repository browser.