source: build.xml @ b2e8d3c

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

Here is the long awaited upgrade of the wrapper.

The aging v3.1.x of the java wrapper is being replaced in this
checkin with the latest (current) stable release, 3.5.9.

There is now only one copy of wrapper.jar, located in wrapper/all.
The build.xml scripts have been changed to reflect this new path.

All binaries—with the exception of solaris (I don't have
SPARC hardware)—have been stripped.

FreeBSD x64 is being included in this release.

I have only included the x86 macosx wrapper due to not having a
system to test the x64 code on. On the plus side, the wrapper is
universal (a FAT powerpc & Intel Mac) binary. No more prompting
to install Rosetta!

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