source: build.xml @ ec51ea6

Last change on this file since ec51ea6 was ec51ea6, checked in by zzz <zzz@…>, 10 years ago
  • Console: Split initialNews.xml into a file for each language;

don't copy to config dir at install.

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