source: build.xml @ bfb74f7

Last change on this file since bfb74f7 was bfb74f7, checked in by walking <walking@…>, 10 years ago

reveal the secret protable target

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