source: build.xml @ cd8c954

Last change on this file since cd8c954 was cd8c954, checked in by kytv <kytv@…>, 9 years ago

Debian: Drop junit from Build-Depends-Indep

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