source: build.xml @ 635b53c

Last change on this file since 635b53c was 635b53c, checked in by zzz <zzz@…>, 11 years ago

fix ant distclean javadoc

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