source: build.xml @ c393e70

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