source: build.xml @ fdfbab8

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

minor cleanups

  • Property mode set to 100644
File size: 40.7 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
10    <!-- You probably don't want to change anything from here down -->
11    <target name="help" depends="all" />
12    <target name="all" >
13        <echo message="Useful targets: " />
14        <echo message="  pkg:       distclean then package everything up (installer, clean tarball, update tarball)" />
15        <echo message="  dist:      pkg and javadoc" />
16        <echo message="  installer: build the GUI installer" />
17        <echo message="  tarball:   tar the full install into i2p.tar.bz2 (extracts to build a new clean install)" />
18        <echo message="  updater:   tar the built i2p specific files into an i2pupdate.zip (extracts safely over existing installs)" />
19        <echo message="  updaterWithJetty:   tar the built i2p specific files and jetty into an i2pupdate.zip (extracts safely over existing installs)" />
20        <echo message="  updaterWithJettyFixes: updater including local jetty patches" />
21        <echo message="  updaterWithGeoIP: updater including GeoIP Files" />
22        <echo message="  updaterWithJettyFixesAndGeoIP" />
23        <echo message="  updaterSmall:   updater with the essentials only - no SAM, i2psnark, SusiMail, SusiDNS, news.xml, or history.txt" />
24        <echo message="  updaterRouter:  updater with the i2p.jar and router.jar only" />
25        <echo message="  distclean: clean up all derived files" />
26        <echo message="  syndie:    generate a standalone syndie install" />
27        <echo message="  i2psnark:  generate a standalone i2psnark install" />
28        <echo message="  justBOB:  generate a standalone BOB-one.jar" />
29        <echo message="  javadoc:   generate javadoc for the entire project into ./build/javadoc" />
30        <echo message="  slackpkg:  generate Slackware packages in ./Slackware/i2p and ./Slackware/i2p-base" />
31        <echo message="  debianhowto: instructions on building Debian packages" />
32        <echo message="  updaterWithDesktopgui: tar the built files and desktopgui in an i2pupdate.zip" />
33        <echo message="  pkgWithDesktopgui: distclean then package everything up with the desktopgui" />
34        <echo message="  distWithDesktopgui: pkgWithDesktopgui and javadoc" />
35        <echo message="  distcleanWithDesktopgui: clean up all derived files (including desktopgui files)" />
36        <echo message="  poupdate: update the .po files for translators" />
37    </target>
38    <target name="debianhowto">
39        <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." />
40    </target>
41    <target name="dist" depends="pkg, javadoc">
42    </target>
43    <target name="build" depends="build2">
44        <!-- so we don't build standalone for the updater -->
45        <!-- This builds apps/i2psnark/java/i2psnark-standalone.zip,
46          -   which we don't distribute anywhere...
47        <ant dir="apps/i2psnark/java/" target="standalone" />
48        -->
49    </target>
50    <target name="build2" depends="builddep, jar, buildWEB" />
51    <target name="buildSmall" depends="builddepSmall, jarSmall, buildWEB" />
52    <target name="buildclean" depends="distclean, build" />
53    <target name="builddep" depends="builddepSmall">
54        <!-- build *everything* here, but only once -->
55        <ant dir="apps/BOB/" target="jar" />
56        <ant dir="apps/sam/java/" target="jar" />
57        <ant dir="apps/susimail/" target="war" />
58        <ant dir="apps/susidns/src" target="all" />
59        <ant dir="apps/i2psnark/java/" target="war" />
60    </target>
61    <target name="builddepSmall">
62        <ant dir="core/java/" target="jar" />
63        <ant dir="router/java/" target="jar" />
64        <ant dir="apps/systray/java/" target="jar" />
65        <ant dir="apps/routerconsole/java/" target="jar" />
66        <ant dir="apps/ministreaming/java/" target="jar" />
67        <ant dir="apps/streaming/java/" target="jar" />
68        <ant dir="apps/i2ptunnel/java/" target="jar" />
69        <ant dir="apps/addressbook/" target="war" />
70    </target>
71    <target name="buildrouter">
72        <ant dir="core/java/" target="jar" />
73        <ant dir="router/java/" target="jar" />
74        <copy file="core/java/build/i2p.jar" todir="build/" />
75        <copy file="router/java/build/router.jar" todir="build/" />
76    </target>
77    <target name="buildWEB">
78        <ant dir="apps/jetty" target="ensureJettylib" />
79        <ant dir="apps/routerconsole/java" target="build" />
80        <copy file="apps/routerconsole/java/build/routerconsole.jar" todir="build/" />
81        <copy file="apps/routerconsole/java/build/routerconsole.war" todir="build/" />
82        <copy file="apps/jetty/jettylib/org.mortbay.jetty.jar" todir="build/" />
83        <copy file="apps/jetty/jettylib/jasper-compiler.jar" todir="build/" />
84        <copy file="apps/jetty/jettylib/jasper-runtime.jar" todir="build/" />
85        <copy file="apps/jetty/jettylib/commons-logging.jar" todir="build/" />
86        <copy file="apps/jetty/jettylib/commons-el.jar" todir="build/" />
87        <copy file="apps/jetty/jettylib/javax.servlet.jar" todir="build/" />
88    </target>
89    <target name="buildexe">
90        <condition property="noExe">
91            <os arch="x86_64" />
92        </condition>
93        <condition property="noExe">
94            <os arch="ppc" />
95        </condition>
96        <condition property="noExe">
97            <os arch="amd64" />
98        </condition>
99        <condition property="noExe">
100           <not>
101            <or>
102             <os name="Linux" />
103             <os family="windows" />
104            </or>
105           </not>
106        </condition>
107        <ant target="doBuildEXE" />
108    </target>
109    <target name="doBuildEXE" unless="noExe">
110        <jar destfile="./build/launchi2p.jar">
111            <manifest>
112             <attribute name="Main-Class" value="net.i2p.router.RouterLaunch" />
113             <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" />
114            </manifest>
115        </jar>
116        <!-- now the standalone launcher exe -->
117        <taskdef name="launch4j"
118                 classname="net.sf.launch4j.ant.Launch4jTask"
119                 classpath="${basedir}/installer/lib/launch4j/launch4j.jar:${basedir}/installer/lib/launch4j/lib/xstream.jar" />
120        <launch4j configFile="./installer/i2pstandalone.xml" />
121        <!-- thazzit -->
122    </target>
123    <target name="compile" />
124    <target name="jar" depends="jarSmall" >
125        <copy file="apps/BOB/dist/BOB.jar" todir="build/" />
126        <copy file="apps/sam/java/build/sam.jar" todir="build/" />
127        <copy file="apps/susimail/susimail.war" todir="build/" />
128        <copy file="apps/susidns/src/susidns.war" todir="build/" />
129        <copy file="apps/i2psnark/i2psnark.war" todir="build/" />
130        <copy file="apps/i2psnark/java/build/i2psnark.jar" todir="build/" />
131    </target>
132    <target name="jarSmall" depends="compile" >
133        <copy file="core/java/build/i2p.jar" todir="build/" />
134        <copy file="router/java/build/router.jar" todir="build/" />
135        <copy file="apps/ministreaming/java/build/mstreaming.jar" todir="build/" />
136        <copy file="apps/streaming/java/build/streaming.jar" todir="build/" />
137        <copy file="apps/i2ptunnel/java/build/i2ptunnel.jar" todir="build/" />
138        <copy file="apps/i2ptunnel/java/build/i2ptunnel.war" todir="build/" />
139        <copy file="apps/systray/java/build/systray.jar" todir="build/" />
140        <copy file="installer/lib/jbigi/jbigi.jar" todir="build" />
141        <copy file="apps/addressbook/dist/addressbook.war" todir="build/" />
142    </target>
143    <target name="poupdate">
144        <ant dir="apps/routerconsole/java/" target="poupdate" />
145        <ant dir="apps/i2psnark/java/" target="poupdate" />
146        <ant dir="apps/i2ptunnel/java/" target="poupdate" />
147        <ant dir="apps/susidns/src/" target="poupdate" />
148    </target>
149    <target name="javadoc">
150        <mkdir dir="./build" />
151        <mkdir dir="./build/javadoc" />
152        <javadoc access="package" 
153            destdir="./build/javadoc" 
154            packagenames="*" 
155            use="true" 
156            group="SDK net.i2p:net.i2p.*:net.i2p.client:net.i2p.client.*:freenet.support.CPUInformation,
157                   Streaming net.i2p.client.streaming,
158                   BOB net.i2p.BOB,
159                   SAM net.i2p.sam:net.i2p.sam.client,
160                   RouterConsole net.i2p.router.web,
161                   Router net.i2p.router:net.i2p.router.*:net.i2p.data.i2np,
162                   Systray net.i2p.apps.systray,
163                   I2PTunnel net.i2p.i2ptunnel:net.i2p.i2ptunnel.*"
164            splitindex="true" 
165            windowtitle="I2P">
166            <sourcepath>
167                <pathelement location="core/java/src" />
168                <!--<pathelement location="core/java/test" />-->
169                <pathelement location="router/java/src" />
170                <!--<pathelement location="router/java/test" />-->
171                <pathelement location="apps/ministreaming/java/src" />
172                <pathelement location="apps/streaming/java/src" />
173                <pathelement location="apps/i2ptunnel/java/src" />
174                <pathelement location="apps/systray/java/src" />
175                <pathelement location="apps/routerconsole/java/src" />
176                <pathelement location="apps/addressbook/java/src" />
177                <pathelement location="apps/i2psnark/java/src" />
178                <pathelement location="apps/sam/java/src" />
179                <pathelement location="apps/BOB/src" />
180            </sourcepath>
181            <classpath>
182                <pathelement location="apps/jetty/jettylib/org.mortbay.jetty.jar" />
183                <pathelement location="apps/jetty/jettylib/javax.servlet.jar" />
184                <pathelement location="apps/systray/java/lib/systray4j.jar" />
185                <pathelement location="apps/jrobin/jrobin-1.4.0.jar" />
186                <pathelement location="installer/lib/wrapper/win32/wrapper.jar" />
187                <pathelement location="core/lib/junit.jar" />               
188            </classpath>
189        </javadoc>
190    </target>
191    <target name="clean" depends="pkgclean" >
192        <delete dir="./build" />
193        <delete file="i2pinstall.exe" failonerror="false" quiet="true" />       
194        <delete file="i2p.exe" failonerror="false" quiet="true" />
195        <delete file="syndie-standalone.zip" failonerror="false" quiet="true" />
196        <delete file="i2psnark-standalone.zip" failonerror="false" quiet="true" />
197        <delete file="BOB-one.jar" failonerror="false" quiet="true" /> 
198    </target>
199    <target name="distclean" depends="clean">
200        <ant dir="core/java/" target="distclean" />
201        <ant dir="router/java/" target="distclean" />
202        <ant dir="apps/ministreaming/java/" target="distclean" />
203        <ant dir="apps/streaming/java/" target="distclean" />
204        <ant dir="apps/i2ptunnel/java/" target="distclean" />
205        <ant dir="apps/sam/java/" target="distclean" />
206        <ant dir="apps/BOB" target="clean" />
207        <ant dir="apps/routerconsole/java/" target="distclean" />
208        <ant dir="apps/addressbook/" target="distclean" />
209        <ant dir="apps/susimail/" target="distclean" />
210        <ant dir="apps/susidns/src/" target="distclean" />
211        <ant dir="apps/systray/java/" target="distclean" />
212        <ant dir="apps/i2psnark/java/" target="distclean" />
213        <ant dir="apps/jetty/" target="distclean" />
214        <!--
215                NOTE! We need to turn off the default excludes for these
216                patterns to work.
217                These are the defaultexcludes in Ant as seen on
218                http://ant.apache.org/manual/CoreTasks/defaultexcludes.html
219                     **/*~
220                     **/#*#
221                     **/.#*
222                     **/%*%
223                     **/._*
224                     **/CVS
225                     **/CVS/**
226                     **/.cvsignore
227                     **/SCCS
228                     **/SCCS/**
229                     **/vssver.scc
230                     **/.svn
231                     **/.svn/**
232                     **/.DS_Store
233                The only recourse is to remove the offending ones.
234                We do this here, as we only need one change, and then put it
235                back after we are done with it.
236        -->
237        <defaultexcludes remove="**/*~"/>
238
239        <delete>
240            <fileset dir="." includes="**/*.class" />
241            <fileset dir="." includes="**/*.java~" />
242            <!--
243                Less common, but they pollute my workspace here, so we
244                might as well nuke these as well. Are there any others?
245               
246                !!??? Why don't we just nuke "**/*~" ???!!
247
248                ++Sponge
249            -->
250            <fileset dir="." includes="**/*.txt~" />
251            <fileset dir="." includes="**/*.xml~"  />
252            <fileset dir="." includes="**/*.sh~"  />
253            <fileset dir="." includes="**/*.SlackBuild~" />
254        </delete>
255        <!--
256                Now we put the defaults back
257        -->
258        <defaultexcludes default="true"/>
259    </target>
260    <target name="pkg" depends="distclean, updater, preppkg, installer" />
261    <target name="pkgclean" depends="deletepkg-temp">
262        <delete>
263            <fileset dir="." includes="i2p.tar.bz2 install.jar i2pupdate.zip" />
264        </delete>
265    </target>
266    <target name="preppkg" depends="build, buildexe, preplicenses, prepconsoleDocs">
267        <copy file="build/i2p.jar" todir="pkg-temp/lib/" />
268        <copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
269        <copy file="build/jasper-compiler.jar" todir="pkg-temp/lib/" />
270        <copy file="build/jasper-runtime.jar" todir="pkg-temp/lib/" />
271        <copy file="build/commons-logging.jar" todir="pkg-temp/lib/" />
272        <copy file="build/commons-el.jar" todir="pkg-temp/lib/" />
273        <copy file="build/javax.servlet.jar" todir="pkg-temp/lib/" />
274        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
275        <copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
276        <copy file="build/streaming.jar" todir="pkg-temp/lib/" />
277        <copy file="build/org.mortbay.jetty.jar" todir="pkg-temp/lib/" />
278        <copy file="build/router.jar" todir="pkg-temp/lib/" />
279        <copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
280        <copy file="build/sam.jar" todir="pkg-temp/lib/" />
281        <copy file="build/BOB.jar" todir="pkg-temp/lib/" />
282        <copy file="build/systray.jar" todir="pkg-temp/lib" />
283        <!-- <copy file="build/sucker.jar" todir="pkg-temp/lib" /> -->
284        <copy file="build/i2psnark.jar" todir="pkg-temp/lib/" />
285        <copy file="i2p.exe" todir="pkg-temp/" failonerror="false" />
286        <copy file="installer/resources/runplain.sh" todir="pkg-temp/" />
287        <copy file="apps/systray/java/lib/systray4j.jar" todir="pkg-temp/lib" />
288        <copy file="apps/systray/java/lib/systray4j.dll" todir="pkg-temp/lib" />
289        <copy file="apps/systray/java/resources/iggy.ico" todir="pkg-temp/icons" />
290        <copy file="apps/systray/java/resources/iggy.xpm" todir="pkg-temp/icons" />
291        <copy file="build/i2ptunnel.war" todir="pkg-temp/webapps/" />
292        <copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
293        <copy file="build/addressbook.war" todir="pkg-temp/webapps/" />
294        <copy file="build/susimail.war" todir="pkg-temp/webapps/" />
295        <copy file="build/susidns.war" todir="pkg-temp/webapps/" />
296        <!-- <copy file="build/syndie.war" todir="pkg-temp/webapps/" /> -->
297        <copy file="build/i2psnark.war" todir="pkg-temp/webapps/" />
298        <copy file="apps/i2psnark/launch-i2psnark" todir="pkg-temp/" />
299        <copy file="apps/i2psnark/jetty-i2psnark.xml" todir="pkg-temp/" />
300        <copy file="apps/i2psnark/i2psnark.config" todir="pkg-temp/" />
301        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
302        <copy file="installer/resources/clients.config" todir="pkg-temp/" />
303        <copy file="installer/resources/eepget" todir="pkg-temp/" />
304        <copy file="installer/resources/eepget.bat" todir="pkg-temp/" />
305        <copy file="installer/resources/i2prouter" todir="pkg-temp/" />
306        <copy file="installer/resources/i2prouter.bat" todir="pkg-temp/" />
307        <copy file="installer/resources/fixperms.bat" todir="pkg-temp/" />
308        <copy file="installer/resources/i2ptunnel.config" todir="pkg-temp/" />
309        <!-- <copy file="installer/resources/install_i2p_service_unix" todir="pkg-temp/" /> -->
310        <copy file="installer/resources/install_i2p_service_winnt.bat" todir="pkg-temp/" />
311        <copy file="installer/resources/osid" todir="pkg-temp/" />
312        <copy file="installer/resources/postinstall.bat" todir="pkg-temp/" />
313        <copy file="installer/resources/postinstall.sh" todir="pkg-temp/" />
314        <copy file="installer/resources/systray.config" todir="pkg-temp/" />
315        <!-- <copy file="installer/resources/uninstall_i2p_service_unix" todir="pkg-temp/" /> -->
316        <copy file="installer/resources/uninstall_i2p_service_winnt.bat" todir="pkg-temp/" />
317        <copy file="installer/resources/wrapper.config" todir="pkg-temp/" />
318        <copy todir="pkg-temp/lib/wrapper/freebsd/">
319            <fileset dir="installer/lib/wrapper/freebsd/" />
320        </copy>
321        <copy todir="pkg-temp/lib/wrapper/linux/">
322            <fileset dir="installer/lib/wrapper/linux/" />
323        </copy>
324        <copy todir="pkg-temp/lib/wrapper/linux64/">
325            <fileset dir="installer/lib/wrapper/linux64/" />
326        </copy>
327        <copy todir="pkg-temp/lib/wrapper/macosx/">
328            <fileset dir="installer/lib/wrapper/macosx/" />
329        </copy>
330        <copy todir="pkg-temp/lib/wrapper/solaris/">
331            <fileset dir="installer/lib/wrapper/solaris/" />
332        </copy>
333        <copy todir="pkg-temp/lib/wrapper/win32/">
334            <fileset dir="installer/lib/wrapper/win32/" />
335        </copy>
336        <copy file="installer/resources/hosts.txt" todir="pkg-temp/" />
337        <copy file="INSTALL-headless.txt" todir="pkg-temp/" />
338        <!-- overwrite the truncated history put in by the updater -->
339        <copy file="history.txt" todir="pkg-temp/" overwrite="true" />
340        <mkdir dir="pkg-temp/scripts" />
341        <copy file="apps/proxyscript/i2pProxy.pac" todir="pkg-temp/scripts/" />
342        <!-- test classes aren't in the jars anymore
343        <copy file="core/perl/i2pbench.sh" todir="pkg-temp/scripts/" />
344        <copy file="core/perl/i2ptest.sh" todir="pkg-temp/scripts/" />
345        -->
346        <!-- polecat: please put your modified toolbar.html in installer/resources/toolbar.html
347             and uncomment the following -->
348        <!-- <copy file="installer/resources/toolbar.html" todir="pkg-temp/docs/" /> -->
349        <!-- overwrite the news put in by the updater -->
350        <copy file="installer/resources/initialNews.xml" tofile="pkg-temp/docs/news.xml" overwrite="true" />
351        <copy file="installer/resources/startconsole.html" todir="pkg-temp/docs/" />
352        <copy file="installer/resources/start.ico" todir="pkg-temp/docs/" />
353        <copy file="installer/resources/console.ico" todir="pkg-temp/docs/" />
354        <copy file="installer/resources/uninstall.ico" todir="pkg-temp/docs/" />
355        <mkdir dir="pkg-temp/docs/themes/" />
356        <copy todir="pkg-temp/docs/themes/" >
357          <fileset dir="installer/resources/themes/" />
358        </copy>
359        <!-- Eepsite stuff here -->
360        <mkdir dir="pkg-temp/eepsite" />
361        <mkdir dir="pkg-temp/eepsite/webapps" />
362        <mkdir dir="pkg-temp/eepsite/logs" />
363        <mkdir dir="pkg-temp/eepsite/cgi-bin" />
364        <mkdir dir="pkg-temp/eepsite/docroot" />
365        <mkdir dir="pkg-temp/eepsite/docroot/help" />
366        <mkdir dir="pkg-temp/eepsite/docroot/help/lib" />
367        <copy todir="pkg-temp/eepsite/docroot/" >
368            <fileset dir="installer/resources/eepsite.help/"  includes="robots.txt index.html help/pagetemplate.html help/index*.html **/*.png **/*.css" />
369        </copy>
370        <copy file="installer/resources/themes/console/images/favicon.ico" tofile="pkg-temp/eepsite/docroot/favicon.ico" />
371        <copy file="installer/resources/jetty.xml" tofile="pkg-temp/eepsite/jetty.xml" />
372    </target>
373    <target name="preplicenses">
374        <copy file="LICENSE.txt" todir="pkg-temp/" />
375        <copy todir="pkg-temp/licenses/" >
376          <fileset dir="licenses/" />
377        </copy>
378        <copy file="installer/lib/launch4j/lib/foxtrot.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-Foxtrot.txt" />
379        <copy file="installer/lib/launch4j/lib/JGoodies.Forms.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-JGoodies-Forms.txt" />
380        <copy file="installer/lib/launch4j/lib/JGoodies.Looks.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-JGoodies-Looks.txt" />
381        <copy file="installer/lib/launch4j/lib/XStream.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-XStream.txt" />
382    </target>
383    <target name="prepthemeupdates">
384        <!-- Add extricated I2PSnark css here, for now -->
385        <copy file="installer/resources/themes/console/snark.css" todir="pkg-temp/docs/themes/console/" />
386        <!-- these files now in docs/, not in the .war -->
387        <!-- No need to copy these individually, we're copying the whole dir below..
388        <copy file="installer/resources/themes/console/images/favicon.ico" todir="pkg-temp/docs/themes/console/images/" />
389        <copy file="installer/resources/themes/console/images/i2plogo.png" todir="pkg-temp/docs/themes/console/images/" />
390        -->
391        <!-- Since the logo moved, we have to update the error pages -->
392        <copy todir="pkg-temp/docs/" >
393          <fileset dir="installer/resources/proxy" />
394        </copy>
395        <!-- make a "classic" theme -->
396        <copy todir="pkg-temp/docs/themes/console/classic/" >
397            <fileset  dir="installer/resources/themes/console/classic/" excludes="**/i2plogo.png" />
398        </copy>
399        <!-- Add dark theme -->
400        <copy todir="pkg-temp/docs/themes/console/dark/" >
401            <fileset  dir="installer/resources/themes/console/dark/" excludes="**/i2plogo.png" />
402        </copy>
403        <!-- Add light theme -->
404        <copy todir="pkg-temp/docs/themes/console/light/" >
405            <fileset  dir="installer/resources/themes/console/light/" excludes="**/i2plogo.png" />
406        </copy>
407         <!-- Add midnight theme -->
408        <copy todir="pkg-temp/docs/themes/console/midnight/" >
409            <fileset  dir="installer/resources/themes/console/midnight/" excludes="**/i2plogo.png" />
410        </copy>       
411        <!-- Add shared images.. these are subject to flux and change! -->
412        <copy todir="pkg-temp/docs/themes/console/images/" >
413            <fileset  dir="installer/resources/themes/console/images/" />
414        </copy>         
415        <copy todir="pkg-temp/docs/" >
416          <fileset dir="installer/resources/readme/" includes="readme*.html" />
417        </copy>
418    </target>
419
420    <!-- this is no longer required, izpack 4.3.0 supports headless installs with java -jar i2pinstall.exe -console -->
421    <target name="tarball" depends="preppkg">
422        <tar compression="bzip2" destfile="i2p.tar.bz2">
423            <tarfileset dir="pkg-temp" includes="**/*" prefix="i2p" />
424        </tar>
425    </target>
426    <target name="deletepkg-temp">
427        <delete dir="pkg-temp" />
428    </target>
429    <target name="prepconsoleDocs" depends="prepgeoupdate">
430        <copy todir="pkg-temp/docs/" >
431          <fileset dir="." includes="readme*.html" />
432          <fileset dir="installer/resources/proxy" />
433        </copy>
434    </target>
435    <target name="consoleDocs" depends="deletepkg-temp, prepconsoleDocs">
436        <zip destfile="docs.zip" basedir="pkg-temp" whenempty="fail" />
437    </target>
438    <target name="updater" depends="prepupdate, preplicenses, zipit" />
439    <target name="updaterWithGeoIP" depends="prepupdate, prepgeoupdate, preplicenses, zipit" />
440    <target name="updaterWithJetty" depends="prepjupdate, preplicenses, zipit" />
441    <target name="updaterWithJettyFixes" depends="prepjupdatefixes, preplicenses, zipit" />
442    <target name="updaterWithJettyFixesAndGeoIP" depends="prepjupdatefixes, prepgeoupdate, preplicenses, zipit" />
443    <target name="updaterSmall" depends="prepupdateSmall, zipit" />
444    <target name="updaterRouter" depends="prepupdateRouter, zipit" />
445    <target name="zipit">
446        <zip destfile="i2pupdate.zip" basedir="pkg-temp" whenempty="fail" />
447    </target>
448    <target name="updateTest" depends="prepupdate">
449        <ant dir="core/java/" target="jarTest" />   
450        <copy file="core/java/build/i2ptest.jar" todir="pkg-temp/lib" />
451        <zip destfile="i2pupdate.zip" basedir="pkg-temp" />
452    </target>
453    <target name="prepupdate" depends="build2, prepupdateSmall">
454        <copy file="build/BOB.jar" todir="pkg-temp/lib/" />
455        <copy file="build/sam.jar" todir="pkg-temp/lib/" />
456        <copy file="build/i2psnark.jar" todir="pkg-temp/lib" />
457        <!-- include systray changes in 0.7.5 -->
458        <copy file="build/systray.jar" todir="pkg-temp/lib/" />
459        <copy file="build/susimail.war" todir="pkg-temp/webapps/" />
460        <copy file="build/susidns.war" todir="pkg-temp/webapps/" />
461        <copy file="build/i2psnark.war" todir="pkg-temp/webapps/" />
462        <copy file="history.txt" todir="pkg-temp/" />
463        <!-- the following overwrites history.txt on unix to shrink the update file -->
464        <exec executable="head" osfamily="unix" failifexecutionfails="true" output="pkg-temp/history.txt">
465            <arg value="-n" />
466            <arg value="1500" />
467            <arg value="history.txt" />
468        </exec>
469        <exec executable="echo" osfamily="unix" failifexecutionfails="true" output="pkg-temp/history.txt" append="true">
470            <arg value="EARLIER HISTORY IS AVAILABLE IN THE SOURCE PACKAGE" />
471        </exec>
472        <!-- may be pointless now, people with split directories will never see this -->
473        <copy file="installer/resources/news.xml" todir="pkg-temp/docs/" />
474    </target>
475    <target name="prepupdateSmall" depends="buildSmall, prepupdateRouter, prepthemeupdates">
476        <copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
477        <copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
478        <copy file="build/streaming.jar" todir="pkg-temp/lib/" />
479        <copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
480        <copy file="build/i2ptunnel.war" todir="pkg-temp/webapps/" />
481        <copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
482        <copy file="build/addressbook.war" todir="pkg-temp/webapps/" />
483        <!-- decapitalized the file in 0.7.8 -->
484        <copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
485    </target>
486    <target name="prepupdateRouter" depends="buildrouter, deletepkg-temp">
487        <copy file="build/i2p.jar" todir="pkg-temp/lib/" />
488        <copy file="build/router.jar" todir="pkg-temp/lib/" />
489    </target>
490    <target name="prepgeoupdate">
491        <copy file="installer/resources/geoip.txt" todir="pkg-temp/geoip/" />
492        <copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
493        <copy todir="pkg-temp/docs/icons/flags" >
494          <fileset dir="installer/resources/icons/flags" />
495        </copy>
496    </target>
497    <target name="prepjupdate" depends="prepupdate, buildWEB">
498        <copy file="build/jasper-compiler.jar" todir="pkg-temp/lib/" />
499        <copy file="build/jasper-runtime.jar" todir="pkg-temp/lib/" />
500        <copy file="build/commons-logging.jar" todir="pkg-temp/lib/" />
501        <copy file="build/commons-el.jar" todir="pkg-temp/lib/" />
502        <copy file="build/javax.servlet.jar" todir="pkg-temp/lib/" />
503        <copy file="build/org.mortbay.jetty.jar" todir="pkg-temp/lib/" />
504    </target>
505    <target name="prepjupdatefixes" depends="prepupdate, buildWEB">
506        <copy file="build/org.mortbay.jetty.jar" todir="pkg-temp/lib/" />
507    </target>
508    <target name="installer" depends="preppkg">
509        <taskdef name="izpack" classpath="${basedir}/installer/lib/izpack/standalone-compiler.jar" classname="com.izforge.izpack.ant.IzPackTask" />
510        <mkdir dir="pkg-temp/installer" />
511        <jar destfile="./pkg-temp/installer/copy.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Copy.class net/i2p/util/FileUtil.class">
512            <manifest><attribute name="Main-Class" value="net.i2p.util.Copy" /></manifest>
513        </jar>
514        <jar destfile="./pkg-temp/installer/delete.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Delete.class net/i2p/util/FileUtil.class">
515            <manifest><attribute name="Main-Class" value="net.i2p.util.Delete" /></manifest>
516        </jar>
517        <jar destfile="./pkg-temp/installer/exec.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Exec.class">
518            <manifest><attribute name="Main-Class" value="net.i2p.util.Exec" /></manifest>
519        </jar>
520        <izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
521
522        <ant target="installerexe" />
523    </target>
524    <target name="installerexe">
525        <condition property="noExe">
526            <os arch="x86_64" />
527        </condition>
528        <condition property="noExe">
529            <os arch="amd64" />
530        </condition>
531        <condition property="noExe">
532           <not>
533            <or>
534             <os name="Linux" />
535             <os family="windows" />
536            </or>
537           </not>
538        </condition>
539        <ant target="doInstallerEXE" />
540    </target>
541    <target name="doInstallerEXE" unless="noExe">
542        <!-- now the installer exe -->
543        <taskdef name="launch4j"
544                 classname="net.sf.launch4j.ant.Launch4jTask"
545                 classpath="${basedir}/installer/lib/launch4j/launch4j.jar:${basedir}/installer/lib/launch4j/lib/xstream.jar" />
546        <launch4j configFile="./installer/i2pinstaller.xml" />
547        <launch4j configFile="./installer/i2pstandalone.xml" />
548        <!-- thazzit -->
549    </target>
550    <target name="test">
551        <ant dir="core/java/" target="test" />
552    </target>
553    <target name="junit.report">
554        <ant dir="core/java/" target="junit.report" />
555    </target>
556    <target name="clover.report">
557        <ant dir="core/java/" target="clover.report" />
558    </target>
559    <target name="test.report" depends="junit.report, clover.report"/>
560    <target name="fulltest">
561                <ant dir="core/java/" target="fulltest" />
562                <ant dir="router/java/" target="fulltest" />
563    </target>
564    <target name="fullclovertest">
565                <ant dir="core/java/" target="fullclovertest" />
566                <ant dir="router/java/" target="fullclovertest" />
567    </target>
568    <target name="syndie" >
569        <ant dir="apps/syndie/java/" target="standalone" />
570        <copy file="apps/syndie/java/syndie-standalone.zip" todir="." />
571    </target>
572    <target name="i2psnark">
573        <ant dir="apps/i2psnark/java" target="standalone" />
574        <copy file="apps/i2psnark/java/i2psnark-standalone.zip" todir="." />
575    </target>
576    <target name="slackpkg">
577        <echo message="Building Slackware package." />
578        <ant dir="Slackware/i2p/" target="slackpkg" />
579        <ant dir="Slackware/i2p-base/" target="slackpkg" />
580    </target>
581    <target name="justBOB" depends="builddepSmall">
582        <ant dir="apps/BOB/" target="onejar" />
583        <copy file="apps/BOB/dist/BOB-one.jar" todir="." />
584    </target>
585    <target name="findbugs" depends="build2">
586        <echo message="Starting findbugs, this will take a while..." />
587        <exec executable="nice">
588            <arg value="findbugs"/>
589            <arg value="-textui"/>
590            <arg value="-projectName"/>
591            <arg value="i2p"/>
592            <arg value="-sortByClass"/>
593            <arg value="-xml"/>
594            <arg value="-output"/>
595            <arg value="findbugs.xml"/>
596            <arg value="-auxclasspath"/>
597            <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"/>
598            <arg value="-sourcepath"/>
599            <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/"/>
600            <!-- start of the files to be analyzed -->
601            <arg value="build/BOB.jar"/>
602            <arg value="build/addressbook.war"/>
603            <arg value="build/i2p.jar"/>
604            <arg value="build/i2psnark.jar"/>
605            <arg value="build/i2psnark.war"/>
606            <arg value="build/i2ptunnel.jar"/>
607            <arg value="build/i2ptunnel.war"/>
608            <arg value="build/jbigi.jar"/>
609            <arg value="build/mstreaming.jar"/>
610            <arg value="build/router.jar/"/>
611            <!-- use the class files rather than the jar for routerconsole so we don't analyze jrobin -->
612            <arg value="apps/routerconsole/java/build/obj/"/>
613            <arg value="build/sam.jar"/>
614            <arg value="build/streaming.jar"/>
615            <arg value="build/susidns.war"/>
616            <arg value="build/susimail.war"/>
617            <arg value="build/systray.jar"/>
618        </exec>
619        <echo message="Findbugs output stored in findbugs.xml" />
620    </target>
621    <target name="buildWithDesktopgui" depends="buildrouter,builddepSmall">
622        <ant dir="apps/desktopgui" target="build_jar" />
623    </target>
624    <target name="preppkgWithDesktopgui" depends="buildWithDesktopgui,preppkg">
625        <copy file="apps/desktopgui/dist/desktopgui.jar" todir="pkg-temp/lib/" />
626        <copy file="apps/desktopgui/lib/swing-worker.jar" todir="pkg-temp/lib/" />
627        <copy file="apps/desktopgui/lib/appframework.jar" todir="pkg-temp/lib/" />
628        <mkdir dir="pkg-temp/desktopgui/resources/" />
629        <copy todir="pkg-temp/desktopgui/resources/">
630            <fileset dir="apps/desktopgui/desktopgui/resources/" />
631        </copy>
632    </target>
633    <target name="installerWithDesktopgui" depends="preppkgWithDesktopgui,installer" />
634    <target name="prepupdateWithDesktopgui" depends="buildWithDesktopgui,prepupdate">
635        <copy file="apps/desktopgui/dist/desktopgui.jar" todir="pkg-temp/lib/" />
636        <copy file="apps/desktopgui/lib/swing-worker.jar" todir="pkg-temp/lib/" />
637        <copy file="apps/desktopgui/lib/appframework.jar" todir="pkg-temp/lib/" />
638        <mkdir dir="pkg-temp/desktopgui/resources/" />
639        <copy todir="pkg-temp/desktopgui/resources/">
640            <fileset dir="apps/desktopgui/desktopgui/resources/" />
641        </copy>
642    </target>
643    <target name="updaterWithDesktopgui" depends="prepupdateWithDesktopgui,updater" />
644    <target name="pkgWithDesktopgui" depends="distclean, updaterWithDesktopgui, installerWithDesktopgui, preppkg" />
645    <target name="distWithDesktopgui" depends="pkgWithDesktopgui, javadoc" />
646    <target name="distcleanWithDesktopgui" depends="distclean">
647        <ant dir="apps/desktopgui" target="build_clean" />
648    </target>
649    <target name="release" depends="pkg">
650        <echo message="================================================================" />
651        <echo message="Did you update these files?" />
652        <exec executable="ls" failonerror="true">
653            <arg value="-l" />
654            <arg value="history.txt" />
655            <arg value="installer/resources/initialNews.xml" />
656            <arg value="installer/install.xml" />
657            <arg value="installer/resources/news.xml" />
658            <arg value="core/java/src/net/i2p/CoreVersion.java" />
659            <arg value="router/java/src/net/i2p/router/RouterVersion.java" />
660        </exec>
661        <echo message="Everything is checked in, right? Let's be sure:" />
662        <exec executable="mtn" failonerror="true">
663            <arg value="st" />
664        </exec>
665        <echo message="If there are any modified files above, stop now!" />
666        <!-- get release version number -->
667        <exec executable="grep" outputproperty="versionLine" failonerror="true" >
668            <arg value="public final static String VERSION" />
669            <arg value="core/java/src/net/i2p/CoreVersion.java" />
670        </exec>
671        <exec executable="cut" inputstring="${versionLine}" outputproperty="release.number" failonerror="true" >
672            <arg value="-f2" />
673            <arg value="-d&quot;" />
674        </exec>
675        <echo message="New version number is ${release.number}" />
676        <copy file="i2pupdate.zip" tofile="i2pupdate_${release.number}.zip" />
677        <copy file="i2pinstall.exe" tofile="i2pinstall_${release.number}.exe" />
678        <delete file="i2pupdate.sud" failonerror="false" />
679        <input message="Enter private signing key file:" addproperty="release.privkey" />
680        <fail message="You must enter a path." >
681            <condition>
682                <equals arg1="${release.privkey}" arg2=""/>
683            </condition>
684        </fail>
685        <echo message="Key file is ${release.privkey}" />
686        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
687            <classpath>
688                <pathelement location="build/i2p.jar" />
689            </classpath>
690            <arg value="sign" />
691            <arg value="i2pupdate.zip" />
692            <arg value="i2pupdate.sud" />
693            <arg value="${release.privkey}" />
694            <arg value="${release.number}" />
695        </java>
696        <fail message="i2pupdate.sud generation failed!" >
697            <condition>
698                <length file="i2pupdate.sud" when="lt" length="1000000" />
699            </condition>
700        </fail>
701        <echo message="Verify version and VALID signature:" />
702        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
703            <classpath>
704                <pathelement location="build/i2p.jar" />
705            </classpath>
706            <arg value="verifysig" />
707            <arg value="i2pupdate.sud" />
708        </java>
709        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
710            <classpath>
711                <pathelement location="build/i2p.jar" />
712            </classpath>
713            <arg value="showversion" />
714            <arg value="i2pupdate.sud" />
715        </java>
716        <!-- will this use the monotonerc file in the current workspace? -->
717        <echo message="Checking out fresh copy into ../i2p-${release.number} for tarballing:" />
718        <delete dir="../i2p-${release.number}" />
719        <exec executable="mtn" failonerror="true">
720            <arg value="co" />
721            <arg value="-b" />
722            <arg value="i2p.i2p" />
723            <!-- w: is the revision of the current workspace -->
724            <arg value="-r" />
725            <arg value="w:" />
726            <arg value="../i2p-${release.number}/" />
727        </exec>
728        <exec executable="tar" failonerror="true">
729            <arg value="cjf" />
730            <arg value="i2psource_${release.number}.tar.bz2" />
731            <arg value="-C" />
732            <arg value=".." />
733            <arg value="--exclude" />
734            <arg value="i2p-${release.number}/_MTN*" />
735            <arg value="i2p-${release.number}/" />
736        </exec>
737        <echo message="Sign the files:" />
738        <delete file="i2pinstall_${release.number}.exe.sig" />
739        <delete file="i2psource_${release.number}.tar.bz2.sig" />
740        <delete file="i2pupdate_${release.number}.zip.sig" />
741        <exec executable="gpg" failonerror="true">
742            <arg value="-b" />
743            <arg value="i2pinstall_${release.number}.exe" />
744        </exec>
745        <exec executable="gpg" failonerror="true">
746            <arg value="-b" />
747            <arg value="i2psource_${release.number}.tar.bz2" />
748        </exec>
749        <exec executable="gpg" failonerror="true">
750            <arg value="-b" />
751            <arg value="i2pupdate_${release.number}.zip" />
752        </exec>
753        <echo message="File sizes:" />
754        <exec executable="ls" failonerror="true">
755            <arg value="-l" />
756            <arg value="i2pinstall_${release.number}.exe" />
757            <arg value="i2psource_${release.number}.tar.bz2" />
758            <arg value="i2pupdate_${release.number}.zip" />
759            <arg value="i2pupdate.sud" />
760            <arg value="i2pinstall_${release.number}.exe.sig" />
761            <arg value="i2psource_${release.number}.tar.bz2.sig" />
762            <arg value="i2pupdate_${release.number}.zip.sig" />
763        </exec>
764        <echo message="SHA256 sums:" />
765        <exec executable="sha256sum" failonerror="true">
766            <arg value="i2pinstall_${release.number}.exe" />
767            <arg value="i2psource_${release.number}.tar.bz2" />
768            <arg value="i2pupdate_${release.number}.zip" />
769            <arg value="i2pupdate.sud" />
770        </exec>
771        <echo message="Don't forget to mtn tag w: i2p-${release.number}" />
772        <echo message="... and mtn cert t:i2p-${release.number} branch i2p.i2p.release" />
773    </target>
774</project>
Note: See TracBrowser for help on using the repository browser.