source: build.xml @ 5beb739

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

fix message

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