source: build.xml @ b434a475

Last change on this file since b434a475 was b434a475, checked in by mathiasdm <mathiasdm@…>, 10 years ago

Thrown away additional libraries and code, started something simpler to build on.

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