source: build.xml @ d59e3f9

Last change on this file since d59e3f9 was d59e3f9, checked in by zzz <zzz@…>, 10 years ago
  • Add Arabic
  • A flag of for the Arabic language, including the four Pan-Arab colors. Note: This is the 1917 Arab revolt / Hashemite dynasty flag.

Source:

http://commons.wikimedia.org/wiki/File:Arabic-Language-Flag.svg

License:

I, the copyright holder of this work, release this work into the public domain. This applies worldwide.
In some countries this may not be legally possible; if so:
I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law.

Converted to 16x11 png by zzz / gimp

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