source: build.xml @ 0e719b8e

Last change on this file since 0e719b8e was 0e719b8e, checked in by zzz <zzz@…>, 9 years ago

fixup after prop

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