source: build.xml @ ab612d0

Last change on this file since ab612d0 was ab612d0, checked in by kytv <kytv@…>, 6 years ago

cleanup of *clean targets, remove more generated files in distclean

  • Property mode set to 100644
File size: 98.7 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<project basedir="." default="all" name="i2p">
3
4    <!-- Include property files so that values can be easily overridden.
5         Users should create an override.properties file to make changes.
6     -->
7    <property file="override.properties"/>
8    <property file="build.properties"/>
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 (updater, installer)" />
15        <echo message="  dist:      pkg and javadoc" />
16        <echo message="  dist200:   pkg, updater200, and javadoc" />
17        <echo message="  installer: build the GUI installer" />
18        <echo message="  installer-freebsd: build the GUI installer (FreeBSD only)" />
19        <echo message="  installer-linux: build the GUI installer (Linux only)" />
20        <echo message="  installer-osx: build the GUI installer (OSX only)" />
21        <echo message="  installer-windows: build the GUI installer (Windows only)" />
22        <echo message="  installer-nowindows: build the GUI installer (all but Windows)" />
23        <echo message="  tarball:   tar the full install into i2p.tar.bz2 (extracts to build a new clean install)" />
24        <echo message="  updater:   Package the built files in i2pupdate.zip (extracts safely over existing installs)" />
25        <echo message="  updater200: Updater compressed with pack200 (creates i2pupdate200.zip, 60% smaller)" />
26        <echo message="  updaterWithJavadoc: updater including the javadocs, for display in the console" />
27        <echo message="  updater200WithJavadoc: updater including the javadocs, for display in the console (creates i2pupdate200.zip)" />
28        <echo message="  updaterWithJavadocAndJetty: updater including the javadocs, for display in the console, and Jetty " />
29        <echo message="  updater200WithJavadocAndJetty: updater including the javadocs, for display in the console, and Jetty (creates i2pupdate200.zip)" />
30        <echo message="  updaterWithJetty: Updater including Jetty" />
31        <echo message="  updater200withJetty: Updater including Jetty" />
32        <echo message="  updaterWithJettyFixes: updater including local jetty patches" />
33        <echo message="  updaterWithGeoIP: updater including GeoIP Files" />
34        <echo message="  updaterWithJettyFixesAndGeoIP" />
35        <echo message="  updaterWithJettyFixesAndJbigi" />
36        <echo message="  updaterSmall:   updater with the essentials only - no SAM, i2psnark, SusiMail, SusiDNS, or history.txt" />
37        <echo message="  updaterRouter:  updater with the i2p.jar and router.jar only" />
38        <echo message="  distclean: clean up all derived files" />
39        <!-- <echo message="  syndie:    generate a standalone syndie install" /> -->
40        <echo message="  desktopgui: generate a standalone desktopgui install" />
41        <echo message="  i2psnark:  generate a standalone i2psnark install" />
42        <echo message="  justBOB:  generate a standalone BOB-one.jar" />
43        <echo message="  javadoc:   generate javadoc for the entire project into ./build/javadoc and ./javadoc.zip" />
44        <echo message="  javadoc-test: Javadocs for unit test classes (build/javadoc-test)" />
45        <echo message="  slackpkg:  generate Slackware packages in ./Slackware/i2p and ./Slackware/i2p-base" />
46        <echo message="  debianhowto: instructions on building Debian packages" />
47        <echo message="  debian: generate Debian packages in ../" />
48        <echo message="          run &quot;ant debianhowto&quot; for instructions" />
49        <echo message="  debian-clean: rollback debian specific patches and run the &quot;distclean&quot; target (done automatically at the end of the &quot;debian&quot; target)" />
50        <!-- <echo message="  debianrepo: build a Debian repository (reprepro required)" /> -->
51        <echo message="  poupdate: update the .po files for translators" />
52        <echo message="  pkg-portable-win32:  build a minimum portable version for win32" />
53   </target>
54    <target name="debianhowto">
55            <echo message="To build debian packages, you must make sure that you have" />
56            <echo message="the necessary build-dependencies installed." />
57            <echo message="The packages required to build can be found in the file "/>
58            <echo message="&quot;debian/control&quot; in the &quot;Build-Depends&quot; field."/>
59            <echo message="In addition to those packages, be sure to install &quot;fakeroot&quot;,"/>
60            <echo message="&quot;quilt&quot; and &quot;build-essential&quot;!" />
61            <echo message="" />
62            <echo message="The following command will install all of the dependencies for you:" />
63            <echo message=" " />
64            <echo message="apt-get install debhelper ant debconf default-jdk gettext libgmp3-dev po-debconf fakeroot build-essential \" />
65            <echo message="                   quilt libcommons-logging-java" />
66            <echo message=" " />
67            <echo message="Once the dependencies are installed, run &quot;ant debian&quot;"/>
68            <echo message="to patch the source and build the packages." />
69    </target>
70    <target name="dist" depends="pkg, javadoc" />
71    <target name="dist200" depends="pkg200, javadoc" />
72    <target name="build" depends="build2">
73        <!-- so we don't build standalone for the updater -->
74        <!-- This builds apps/i2psnark/java/i2psnark-standalone.zip,
75          -   which we don't distribute anywhere...
76        <ant dir="apps/i2psnark/java/" target="standalone" />
77        -->
78    </target>
79    <target name="build2" depends="builddep, jar, buildWEB" />
80    <target name="buildSmall" depends="builddepSmall, jarSmall, buildWEB" />
81    <target name="buildclean" depends="distclean, build" />
82
83    <target name="builddep" depends="builddepSmall, buildBOB, buildSAM, buildSusiMail, buildSusiDNS, buildI2PSnark" />
84
85    <target name="builddepSmall" depends="buildrouter, buildSystray, buildDesktopGui, buildRouterConsole, buildStreaming, buildI2PTunnel, buildAddressbook" />
86
87    <!-- start of buildX, one for each sub-build.xml.
88         Do not put ant tasks in the sub-build.xmls anymore,
89         so the build will go faster.
90      -->
91
92    <target name="buildBOB" depends="buildStreaming" >
93        <ant dir="apps/BOB/" target="jar" />
94    </target>
95
96    <target name="buildSAM" depends="buildStreaming" >
97        <ant dir="apps/sam/java/" target="jar" />
98    </target>
99
100    <target name="buildSusiMail" depends="buildCore, buildJetty" >
101        <ant dir="apps/susimail/" target="war" />
102    </target>
103
104    <target name="buildSusiDNS" depends="buildCore, buildJetty" >
105        <ant dir="apps/susidns/src" target="all" />
106    </target>
107
108    <target name="buildI2PSnark" depends="buildStreaming, buildJetty" >
109        <ant dir="apps/i2psnark/java/" target="war" />
110    </target>
111
112    <!-- jar (not war) for Android -->
113    <target name="buildAddressbookJar" depends="buildCore" >
114        <ant dir="apps/addressbook/" target="jar" />
115    </target>
116
117    <target name="buildAddressbook" depends="buildCore, buildJetty" >
118        <ant dir="apps/addressbook/" target="war" />
119    </target>
120
121    <!-- jar only (no war) for Android -->
122    <target name="buildI2PTunnelJar" depends="buildStreaming" >
123        <ant dir="apps/i2ptunnel/java/" target="jar" />
124    </target>
125
126    <target name="buildI2PTunnel" depends="buildStreaming, buildJetty" >
127        <ant dir="apps/i2ptunnel/java/" target="build" />
128    </target>
129
130    <target name="buildDesktopGui" depends="buildCore, buildrouter" >
131<!--
132        <ant dir="apps/desktopgui" target="clean" />
133-->
134        <ant dir="apps/desktopgui" target="jar" />
135    </target>
136
137    <target name="buildRouterConsole" depends="buildrouter, buildSystray, buildDesktopGui, buildJetty" >
138        <ant dir="apps/routerconsole/java/" target="jar" />
139    </target>
140
141    <target name="buildJetty" depends="buildCore" >
142        <ant dir="apps/jetty" target="build" />
143    </target>
144
145    <target name="buildSystray" depends="buildCore" >
146        <ant dir="apps/systray/java/" target="jar" />
147    </target>
148
149    <target name="buildStreaming" depends="buildMinistreaming" >
150        <ant dir="apps/streaming/java/" target="jar" />
151    </target>
152
153    <target name="buildMinistreaming" depends="buildCore" >
154        <ant dir="apps/ministreaming/java/" target="jar" />
155    </target>
156
157    <target name="buildRouter" depends="buildrouter" />
158    <target name="buildrouter" depends="buildCore" >
159        <ant dir="router/java/" target="jar" />
160        <copy file="router/java/build/router.jar" todir="build/" />
161    </target>
162
163    <target name="buildCore" depends="buildProperties" >
164        <ant dir="core/java/" target="jar" />
165        <copy file="core/java/build/i2p.jar" todir="build/" />
166    </target>
167
168    <target name="buildJrobin" depends="buildProperties" >
169        <!-- take only what we need from the jrobin jar -->
170        <jar destfile="build/jrobin.jar" >
171            <zipfileset src="apps/jrobin/jrobin-1.5.9.1.jar"
172                        excludes="org/jrobin/cmd/ org/jrobin/convertor/ org/jrobin/inspector/" />
173            <manifest>
174                <attribute name="Built-By" value="${build.built-by}" />
175                <attribute name="Build-Date" value="${build.timestamp}" />
176                <attribute name="Base-Revision" value="${workspace.version}" />
177            </manifest>
178        </jar>
179    </target>
180
181    <target name="checkForMtn" >
182        <available property="mtn.available" file="_MTN" type="dir" />
183    </target>
184
185    <target name="getMtnRev" depends="checkForMtn" if="mtn.available" >
186        <exec executable="mtn" outputproperty="workspace.version" errorproperty="mtn.error1" failifexecutionfails="false" >
187            <arg value="automate" />
188            <arg value="get_base_revision_id" />
189        </exec>
190    </target>
191
192    <target name="trimMtnRev" depends="getMtnRev">
193        <script language="javascript">
194            <![CDATA[
195            var MtnRev = project.getProperty("workspace.version");
196            if (MtnRev != 'unknown' && MtnRev != null) {
197                echo = project.createTask("echo");
198                var MtnShortHash = MtnRev.substring(0,8);
199                project.setProperty("MtnShortHash", MtnShortHash);
200                echo.setMessage("Trimmed hash: " + MtnShortHash);
201                echo.perform();
202            } else {
203                project.setProperty("MtnShortHash", 'unknown');
204            }
205            ]]>
206        </script>
207    </target>
208
209    <target name="checkIfBumped">
210        <exec executable="mtn" outputproperty="bumped" errorproperty="mtn.error2" failifexecutionfails="false" >
211            <arg value="ls" />
212            <arg value="ch" />
213            <arg value="router/java/src/net/i2p/router/RouterVersion.java" />
214        </exec>
215        <condition property="bumped.already">
216            <not>
217                <equals arg1="${bumped}" arg2=""/>
218            </not>
219        </condition>
220    </target>
221
222    <target name="bumpBuild" depends="checkIfBumped, getBuildNumber" unless="bumped.already">
223        <script language="javascript">
224            <![CDATA[
225            var newBuildNumber = (Number(project.getProperty("i2p.build.number")) + 1);
226            if (newBuildNumber != 'unknown' && newBuildNumber != null) {
227                echo = project.createTask("echo");
228                project.setProperty("new.i2p.build.number", newBuildNumber);
229                echo.setMessage("Build number is now: " + newBuildNumber);
230                echo.perform();
231            }
232            ]]>
233        </script>
234        <replaceregexp byline="true" file="router/java/src/net/i2p/router/RouterVersion.java"
235            match='(^\s+public\s+final\s+static\s+long\s+BUILD\s+=\s+)[0-9]+;' replace='\1${new.i2p.build.number};'/>
236    </target>
237
238    <target name="buildProperties" depends="getMtnRev, getReleaseNumber, getBuildNumber" >
239        <!-- default if not set above -->
240        <property name="workspace.version" value="unknown" />
241        <tstamp>
242            <format property="build.timestamp" pattern="yyyy-MM-dd HH:mm:ss z" timezone="UTC" locale="en" />
243        </tstamp>
244        <property name="full.version" value="${release.number}-${i2p.build.number}${build.extra}" />
245        <echo message="Building version ${full.version} (mtn rev ${workspace.version})" />
246    </target>
247
248    <!-- end of sub-build.xml targets -->
249
250    <target name="buildWEB" depends="buildRouterConsole" >
251        <copy file="apps/routerconsole/java/build/routerconsole.jar" todir="build/" />
252        <copy file="apps/routerconsole/java/build/routerconsole.war" todir="build/" />
253        <copy todir="build/" >
254            <fileset dir="apps/jetty/jettylib" excludes="ant.jar" />
255        </copy>
256    </target>
257
258    <condition property="noExe">
259        <not>
260            <!-- We only have launch4j binaries for the following systems -->
261            <and>
262                <or>
263                    <os arch="x86" />
264                    <os arch="i386" />
265                    <os arch="i586" />
266                    <os arch="i686" />
267                    <os arch="amd64" />
268                    <os arch="x86_64" />
269                </or>
270                <or>
271                    <os name="Linux" />
272                    <os family="windows" />
273                </or>
274            </and>
275        </not>
276    </condition>
277
278    <!-- this makes an empty build/launchi2p.jar and the build/i2p.exe for the no-wrapper windows startup, if possible -->
279    <target name="buildexe" depends="buildProperties, launch4j" unless="noExe">
280        <echo message="See the file &quot;build.properties&quot; if this step fails." />
281        <jar destfile="./build/launchi2p.jar">
282            <manifest>
283                <attribute name="Main-Class" value="net.i2p.router.RouterLaunch" />
284                <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-runtime.jar lib/commons-logging.jar lib/commons-el.jar lib/wrapper.jar lib/systray.jar lib/systray4j.jar lib/desktopgui.jar lib/i2psnark.jar lib/jrobin.jar lib/jstl.jar lib/standard.jar lib/jetty-continuation.jar lib/jetty-deploy.jar lib/jetty-http.jar lib/jetty-i2p.jar lib/jetty-io.jar lib/jetty-rewrite-handler.jar lib/jetty-security.jar lib/jetty-servlet.jar lib/jetty-servlets.jar lib/jetty-start.jar lib/jetty-util.jar lib/jetty-webapp.jar lib/jetty-xml.jar" />
285                <attribute name="Built-By" value="${build.built-by}" />
286                <attribute name="Build-Date" value="${build.timestamp}" />
287                <attribute name="Base-Revision" value="${workspace.version}" />
288            </manifest>
289        </jar>
290        <!-- now the standalone launcher exe -->
291        <launch4j configFile="./installer/i2pstandalone.xml" />
292        <!-- thazzit -->
293    </target>
294
295    <target name="launch4j">
296        <taskdef name="launch4j"
297                 classname="net.sf.launch4j.ant.Launch4jTask"
298                 classpath="${basedir}/installer/lib/launch4j/launch4j.jar:${basedir}/installer/lib/launch4j/lib/xstream.jar" />
299     </target>
300
301    <target name="jar" depends="jarSmall" >
302        <copy file="apps/BOB/dist/BOB.jar" todir="build/" />
303        <copy file="apps/sam/java/build/sam.jar" todir="build/" />
304        <copy file="apps/susimail/susimail.war" todir="build/" />
305        <copy file="apps/susidns/src/susidns.war" todir="build/" />
306        <copy file="apps/i2psnark/i2psnark.war" todir="build/" />
307        <copy file="apps/i2psnark/java/build/i2psnark.jar" todir="build/" />
308
309    </target>
310    <target name="jarSmall" depends="builddepSmall, buildJrobin" >
311        <copy file="core/java/build/i2p.jar" todir="build/" />
312        <copy file="router/java/build/router.jar" todir="build/" />
313        <copy file="apps/ministreaming/java/build/mstreaming.jar" todir="build/" />
314        <copy file="apps/streaming/java/build/streaming.jar" todir="build/" />
315        <copy file="apps/i2ptunnel/java/build/i2ptunnel.jar" todir="build/" />
316        <copy file="apps/i2ptunnel/java/build/i2ptunnel.war" todir="build/" />
317        <copy file="apps/systray/java/build/systray.jar" todir="build/" />
318        <copy file="apps/desktopgui/dist/desktopgui.jar" todir="build/" />
319        <copy file="apps/addressbook/dist/addressbook.war" todir="build/" />
320    </target>
321
322    <target name="jbigi-list-changes" depends="checkForMtn" if="mtn.available" >
323        <exec executable="mtn" outputproperty="workspace.changes.jbigi" errorproperty="mtn.error.jbigi" failifexecutionfails="false" >
324            <arg value="list" />
325            <arg value="changed" />
326            <arg value="installer/lib/jbigi" />
327        </exec>
328        <!-- \n in an attribute value generates an invalid manifest -->
329        <exec executable="tr" inputstring="${workspace.changes.jbigi}" outputproperty="workspace.changes.jbigi.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
330            <arg value="-s" />
331            <arg value="&quot;[:space:]&quot;" />
332            <arg value="," />
333        </exec>
334    </target>
335
336    <target name="jbigi" depends="buildProperties, jbigi-list-changes" >
337        <!-- set if unset -->
338        <property name="workspace.changes.jbigi.tr" value="" />
339        <mkdir dir="./build" />
340        <jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
341            <fileset dir="installer/lib/jbigi" includes="*.so *.dll *.jnilib" />
342            <manifest>
343                <attribute name="Built-By" value="${build.built-by}" />
344                <attribute name="Build-Date" value="${build.timestamp}" />
345                <attribute name="Base-Revision" value="${workspace.version}" />
346                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
347            </manifest>
348        </jar>
349    </target>
350
351    <target name="jbigi-nowindows" depends="buildProperties, jbigi-list-changes" >
352        <!-- set if unset -->
353        <property name="workspace.changes.jbigi.tr" value="" />
354        <jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
355            <fileset dir="installer/lib/jbigi" includes="*.so *.jnilib" />
356            <manifest>
357                <attribute name="Built-By" value="${build.built-by}" />
358                <attribute name="Build-Date" value="${build.timestamp}" />
359                <attribute name="Base-Revision" value="${workspace.version}" />
360                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
361            </manifest>
362        </jar>
363    </target>
364
365    <!-- Now system-specific jbigis in alphabetical order -->
366    <target name="jbigi-freebsd-only"  depends="buildProperties, jbigi-list-changes" >
367        <!-- set if unset -->
368        <property name="workspace.changes.jbigi.tr" value="" />
369        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
370            <fileset dir="installer/lib/jbigi" includes="*bsd*.so" />
371            <manifest>
372                <attribute name="Built-By" value="${build.built-by}" />
373                <attribute name="Build-Date" value="${build.timestamp}" />
374                <attribute name="Base-Revision" value="${workspace.version}" />
375                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
376            </manifest>
377        </jar>
378    </target>
379
380    <target name="jbigi-linux-only"  depends="buildProperties, jbigi-list-changes" >
381        <!-- set if unset -->
382        <property name="workspace.changes.jbigi.tr" value="" />
383        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
384            <fileset dir="installer/lib/jbigi" includes="*linux*.so" />
385            <manifest>
386                <attribute name="Built-By" value="${build.built-by}" />
387                <attribute name="Build-Date" value="${build.timestamp}" />
388                <attribute name="Base-Revision" value="${workspace.version}" />
389                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
390            </manifest>
391        </jar>
392    </target>
393
394    <target name="jbigi-linux-nonx86-only"  depends="buildProperties, jbigi-list-changes" >
395        <!-- set if unset -->
396        <property name="workspace.changes.jbigi.tr" value="" />
397        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
398            <fileset dir="installer/lib/jbigi" includes="*linux-arm*.so,*linux-ppc*.so" />
399            <manifest>
400                <attribute name="Built-By" value="${build.built-by}" />
401                <attribute name="Build-Date" value="${build.timestamp}" />
402                <attribute name="Base-Revision" value="${workspace.version}" />
403                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
404            </manifest>
405        </jar>
406    </target>
407
408    <target name="jbigi-osx-only"  depends="buildProperties, jbigi-list-changes" >
409        <!-- set if unset -->
410        <property name="workspace.changes.jbigi.tr" value="" />
411        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
412            <fileset dir="installer/lib/jbigi" includes="*.jnilib" />
413            <manifest>
414                <attribute name="Built-By" value="${build.built-by}" />
415                <attribute name="Build-Date" value="${build.timestamp}" />
416                <attribute name="Base-Revision" value="${workspace.version}" />
417                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
418            </manifest>
419        </jar>
420    </target>
421
422    <target name="jbigi-windows-only" depends="buildProperties, jbigi-list-changes" >
423        <!-- set if unset -->
424        <property name="workspace.changes.jbigi.tr" value="" />
425        <jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
426            <fileset dir="installer/lib/jbigi" includes="*windows*.dll" />
427            <manifest>
428                <attribute name="Built-By" value="${build.built-by}" />
429                <attribute name="Build-Date" value="${build.timestamp}" />
430                <attribute name="Base-Revision" value="${workspace.version}" />
431                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
432            </manifest>
433        </jar>
434    </target>
435
436    <!-- the apps need to compile the jsps to poupdate -->
437    <target name="poupdate" depends="buildRouter, buildStreaming, buildSystray, buildJetty, buildDesktopGui" >
438        <echo message="Setting environment variable LG2 to a lang code (eg: de,zh,nl etc)" />
439        <echo message=" will restrict language update to the language you specified, leaving other language untact." />
440        <ant dir="apps/routerconsole/java/" >
441            <target name="poupdate" />
442            <target name="poupdate-news" />
443            <target name="poupdate-countries" />
444        </ant>
445        <ant dir="apps/i2psnark/java/" target="poupdate" />
446        <ant dir="apps/i2ptunnel/java/" >
447            <target name="poupdate" />
448            <target name="poupdate-proxy" />
449        </ant>
450        <ant dir="apps/susidns/src/" target="poupdate" />
451        <ant dir="apps/susimail/" target="poupdate" />
452        <ant dir="apps/desktopgui" target="poupdate" />
453        <ant dir="installer/resources/locale" target="poupdate" />
454    </target>
455
456    <condition property="no.bundle">
457        <isfalse value="${require.gettext}" />
458    </condition>
459
460    <target name="prep-script-translation" unless="no.bundle" >
461        <!-- script translation added in 0.8.13, enabled in 0.9.5. -->
462        <ant dir="installer/resources/locale" target="bundle" />
463        <copy todir="pkg-temp/locale/">
464            <fileset dir="installer/resources/locale/mo/" />
465        </copy>
466    </target>
467
468    <target name="javadoc" depends="getReleaseNumber, getBuildNumber" >
469        <ant dir="apps/jetty" target="ensureJettylib" />
470        <mkdir dir="./build" />
471        <mkdir dir="./build/javadoc" />
472        <javadoc access="package"
473            destdir="./build/javadoc"
474            packagenames="*"
475            use="true"
476            splitindex="true"
477            doctitle="I2P Javadocs for Release ${release.number} Build ${i2p.build.number}${build.extra}"
478            windowtitle="I2P Anonymous Network - Java Documentation - Version ${release.number}">
479            <group title="Core SDK (i2p.jar)" packages="net.i2p:net.i2p.*:net.i2p.client:net.i2p.client.*:net.i2p.internal:net.i2p.internal.*:freenet.support.CPUInformation:org.bouncycastle.oldcrypto:org.bouncycastle.oldcrypto.*:gnu.crypto.*:gnu.getopt:gnu.gettext:com.nettgryppa.security:net.metanotion:net.metanotion.*" />
480            <group title="Streaming Library" packages="net.i2p.client.streaming:net.i2p.client.streaming.impl" />
481            <group title="Router" packages="net.i2p.router:net.i2p.router.*:net.i2p.data.i2np:org.cybergarage.*:org.freenetproject:org.xlattice.crypto.filters" />
482            <group title="Router Console" packages="net.i2p.router.web:net.i2p.router.update" />
483            <!-- apps and bridges starting here, alphabetical please -->
484            <group title="Addressbook Application" packages="net.i2p.addressbook" />
485            <group title="BOB Bridge" packages="net.i2p.BOB" />
486            <group title="BOB Demos" packages="net.i2p.BOB.Demos.echo.echoclient:net.i2p.BOB.Demos.echo.echoserver" />
487            <group title="Desktopgui Application" packages="net.i2p.desktopgui:net.i2p.desktopgui.*" />
488            <group title="I2PSnark Application" packages="org.klomp.snark:org.klomp.snark.*" />
489            <group title="I2PTunnel Application" packages="net.i2p.i2ptunnel:net.i2p.i2ptunnel.*" />
490            <group title="Installer Utilities" packages="net.i2p.installer" />
491            <group title="Jetty Starter and Logging" packages="net.i2p.jetty" />
492            <group title="SAM Bridge" packages="net.i2p.sam" />
493            <group title="SAM Demos" packages="net.i2p.sam.client" />
494            <group title="SusiDNS Application" packages="i2p.susi.dns" />
495            <group title="SusiMail Application" packages="i2p.susi.webmail:i2p.susi.webmail.*:i2p.susi.debug:i2p.susi.util:org.mortbay.servlet:org.mortbay.util" />
496            <group title="Systray Application" packages="net.i2p.apps.systray" />
497            <sourcepath>
498                <pathelement location="core/java/src" />
499                <pathelement location="router/java/src" />
500                <pathelement location="apps/ministreaming/java/src" />
501                <pathelement location="apps/streaming/java/src" />
502                <pathelement location="apps/i2ptunnel/java/src" />
503                <pathelement location="apps/systray/java/src" />
504                <pathelement location="apps/desktopgui/src" />
505                <pathelement location="apps/routerconsole/java/src" />
506                <pathelement location="apps/addressbook/java/src" />
507                <pathelement location="apps/i2psnark/java/src" />
508                <pathelement location="apps/sam/java/src" />
509                <pathelement location="apps/BOB/src" />
510                <pathelement location="apps/BOB/Demos/echo/echoclient/src" />
511                <pathelement location="apps/BOB/Demos/echo/echoserver/src" />
512                <pathelement location="apps/susidns/src/java/src" />
513                <pathelement location="apps/susimail/src/src" />
514                <pathelement location="apps/jetty/java/src" />
515                <pathelement location="installer/java/src" />
516            </sourcepath>
517            <classpath>
518                <pathelement location="apps/jetty/jettylib/org.mortbay.jetty.jar" />
519                <pathelement location="apps/jetty/jettylib/javax.servlet.jar" />
520                <pathelement location="apps/jetty/jettylib/jetty-http.jar" />
521                <pathelement location="apps/jetty/jettylib/jetty-security.jar" />
522                <pathelement location="apps/jetty/jettylib/jetty-servlet.jar" />
523                <pathelement location="apps/jetty/jettylib/jetty-start.jar" />
524                <pathelement location="apps/jetty/jettylib/jetty-util.jar" />
525                <pathelement location="apps/jetty/jettylib/jetty-webapp.jar" />
526                <pathelement location="apps/jetty/jettylib/jetty-xml.jar" />
527                <pathelement location="apps/systray/java/lib/systray4j.jar" />
528                <pathelement location="apps/jrobin/jrobin-1.5.9.1.jar" />
529                <pathelement location="installer/lib/wrapper/all/wrapper.jar" />
530            </classpath>
531            <!-- These variables are stored in build.properties.
532                 End-users can override by creating the file override.properties -->
533            <link offline="true" href="${javasedocs.url}" packagelistLoc="installer/resources/package-lists/java/" />
534            <link offline="true" href="${javaeedocs.url}" packagelistLoc="installer/resources/package-lists/javaee/" />
535            <link offline="true" href="${jettydocs.url}" packagelistLoc="installer/resources/package-lists/jetty/" />
536            <link offline="true" href="${jrobindocs.url}" packagelistLoc="installer/resources/package-lists/jrobin/" />
537            <link offline="true" href="${wrapperdocs.url}" packagelistLoc="installer/resources/package-lists/wrapper/" />
538        </javadoc>
539        <echo message="Warning, javadoc embeds timestamps in the output, run with 'TZ=UTC ant javadoc' if you plan to distribute" />
540        <zip destfile="javadoc.zip" basedir="build" level="9" includes="javadoc\**" />
541    </target>
542
543    <target name="javadoc-test" depends="buildRouter, javadoc" >
544        <mkdir dir="./build" />
545        <mkdir dir="./build/javadoc-test" />
546
547        <!-- set junit home to the old default unless overridden elsewhere -->
548        <property name="junit.home" value="${ant.home}/lib/" />
549        <javadoc access="package"
550            destdir="./build/javadoc-test"
551            packagenames="*"
552            use="true"
553            splitindex="true"
554            doctitle="I2P Unit Test Javadocs for Release ${release.number} Build ${i2p.build.number}${build.extra}"
555            windowtitle="I2P Anonymous Network - Java Documentation - Version ${release.number}">
556            <group title="Core SDK" packages="net.i2p:net.i2p.*:net.i2p.client:net.i2p.client.*:net.i2p.internal:net.i2p.internal.*:freenet.support.CPUInformation:org.bouncycastle.oldcrypto:org.bouncycastle.oldcrypto.*:gnu.crypto.*:gnu.gettext:org:com.nettgryppa.security:net.metanotion:net.metanotion.*" />
557            <group title="Router" packages="net.i2p.router:net.i2p.router.*:net.i2p.data.i2np:org.cybergarage.*:org.freenetproject:org.xlattice.crypto.filters" />
558            <sourcepath>
559                <pathelement location="core/java/test/junit" />
560                <pathelement location="router/java/test/junit" />
561                <pathelement location="core/java/test/scalatest" />
562            </sourcepath>
563            <classpath>
564                <pathelement location="build/i2p.jar" />
565                <pathelement location="build/router.jar" />
566                <pathelement location="${junit.home}/junit4.jar" />
567            </classpath>
568            <!-- These variables are stored in build.properties.
569         End-users can override by creating the file override.properties -->
570            <link offline="true" href="${javasedocs.url}" packagelistLoc="installer/resources/package-lists/java/" />
571            <link offline="true" href="${junitdocs.url}" packagelistLoc="installer/resources/package-lists/junit/" />
572            <link offline="true" href="${i2pdocs.url}" packagelistLoc="build/javadoc/" />
573        </javadoc>
574        <echo message="Warning, javadoc embeds timestamps in the output, run with 'TZ=UTC ant javadoc' if you plan to distribute" />
575    </target>
576
577    <target name="getReleaseNumber">
578        <loadfile srcfile="core/java/src/net/i2p/CoreVersion.java" property="release.number">
579            <filterchain>
580                <linecontains>
581                    <contains value="public final static String VERSION"/>
582                </linecontains>
583                <tokenfilter>
584                    <replaceregex pattern='.*"([^"]+)";' replace="\1" flags="gi" />
585                </tokenfilter>
586                <striplinebreaks/>
587                <trim/>
588            </filterchain>
589        </loadfile>
590        <property name="release.number" value="unknown" />
591        <echo message="Release number is ${release.number}" />
592    </target>
593
594    <target name="getBuildNumber">
595        <loadfile srcfile="router/java/src/net/i2p/router/RouterVersion.java" property="i2p.build.number">
596            <filterchain>
597                <linecontains>
598                    <contains value="public final static long BUILD" />
599                </linecontains>
600                <tokenfilter>
601                    <replaceregex pattern=".*=\s+([0-9]+);" replace="\1" flags="gi" />
602                </tokenfilter>
603                <trim/>
604                <striplinebreaks/>
605            </filterchain>
606        </loadfile>
607        <loadfile srcfile="router/java/src/net/i2p/router/RouterVersion.java" property="build.extra">
608            <filterchain>
609                <linecontains>
610                    <contains value="public final static String EXTRA" />
611                </linecontains>
612                <tokenfilter>
613                    <replaceregex pattern='.*"(.*)";' replace="\1" flags="gi" />
614                </tokenfilter>
615                <trim/>
616                <striplinebreaks/>
617            </filterchain>
618        </loadfile>
619        <property name="i2p.build.number" value="??" />
620        <property name="build.extra" value="" />
621        <echo message="Build number is ${i2p.build.number}${build.extra}" />
622    </target>
623
624    <target name="verifyReleaseBuildNumbers" depends="getReleaseNumber, getBuildNumber" >
625        <echo message="SDK: ${java.vendor} ${java.version} (${java.runtime.name} ${java.runtime.version})" />
626        <fail message="Bad release number: ${release.number}" >
627            <condition>
628                <or>
629                    <equals arg1="${release.number}" arg2="unknown"/>
630                    <equals arg1="${release.number}" arg2=""/>
631                </or>
632            </condition>
633        </fail>
634        <fail message="Non-zero build number: ${i2p.build.number}" >
635            <condition>
636                <not>
637                    <equals arg1="${i2p.build.number}" arg2="0"/>
638                </not>
639            </condition>
640        </fail>
641        <fail message="Non-empty extra build: ${build.extra}" >
642            <condition>
643                <not>
644                    <equals arg1="${build.extra}" arg2=""/>
645                </not>
646            </condition>
647        </fail>
648    </target>
649
650    <target name="clean" depends="pkgclean" >
651        <delete dir="./build" />
652        <delete dir="./reports" />
653        <delete file="installer/lib/izpack/patches.jar" failonerror="false" quiet="true" />
654        <delete file="syndie-standalone.zip" failonerror="false" quiet="true" />
655        <delete file="i2psnark-standalone.zip" failonerror="false" quiet="true" />
656        <delete file="BOB-one.jar" failonerror="false" quiet="true" />
657        <delete file="core/java/cobertura.ser"/>
658        <delete file="javadoc.zip" />
659        <delete file="i2p.fba" />
660        <delete file="${sloccount.report.file}" />
661    </target>
662
663    <target name="distclean" depends="clean">
664        <delete failonerror="false" quiet="true">
665            <fileset dir="." includes="i2pinstall* *.deb i2pupdate* i2psource*" />
666        </delete>
667        <ant dir="core/java/" target="distclean" />
668        <ant dir="router/java/" target="distclean" />
669        <ant dir="installer/java" target="distclean" />
670        <ant dir="apps/ministreaming/java/" target="distclean" />
671        <ant dir="apps/streaming/java/" target="distclean" />
672        <ant dir="apps/i2ptunnel/java/" target="distclean" />
673        <ant dir="apps/sam/java/" target="distclean" />
674        <ant dir="apps/BOB" target="clean" />
675        <ant dir="apps/desktopgui" target="clean" />
676        <ant dir="apps/routerconsole/java/" target="distclean" />
677        <ant dir="apps/addressbook/" target="distclean" />
678        <ant dir="apps/susimail/" target="distclean" />
679        <ant dir="apps/susidns/src/" target="distclean" />
680        <ant dir="apps/systray/java/" target="distclean" />
681        <ant dir="apps/i2psnark/java/" target="distclean" />
682        <ant dir="apps/jetty/" target="distclean" />
683        <delete dir="core/c/jbigi/bin" />
684        <delete dir="core/c/jbigi/lib" />
685        <delete dir="core/c/jcpuid/lib" />
686        <ant dir="installer/resources/locale" target="distclean" />
687        <!--
688                NOTE! We need to turn off the default excludes for these
689                patterns to work.
690                These are the defaultexcludes in Ant as seen on
691                http://ant.apache.org/manual/CoreTasks/defaultexcludes.html
692                     **/*~
693                     **/#*#
694                     **/.#*
695                     **/%*%
696                     **/._*
697                     **/CVS
698                     **/CVS/**
699                     **/.cvsignore
700                     **/SCCS
701                     **/SCCS/**
702                     **/vssver.scc
703                     **/.svn
704                     **/.svn/**
705                     **/.DS_Store
706                The only recourse is to remove the offending ones.
707                We do this here, as we only need one change, and then put it
708                back after we are done with it.
709        -->
710        <defaultexcludes remove="**/*~"/>
711
712        <delete>
713            <fileset dir="." includes="**/*.class **/*.java~ **/*.txt~ **/*.xml~ **/*.sh~ **/*.SlackBuild~" />
714            <!--
715                Less common, but they pollute my workspace here, so we
716                might as well nuke these as well. Are there any others?
717               
718                !!??? Why don't we just nuke "**/*~" ???!!
719
720                ++Sponge
721            -->
722        </delete>
723        <!--
724                Now we put the defaults back
725        -->
726        <defaultexcludes default="true"/>
727    </target>
728
729    <target name="webappDistclean">
730        <ant dir="apps/i2ptunnel/java/" target="distclean" />
731        <ant dir="apps/routerconsole/java/" target="distclean" />
732        <ant dir="apps/addressbook/" target="distclean" />
733        <ant dir="apps/susimail/" target="distclean" />
734        <ant dir="apps/susidns/src/" target="distclean" />
735        <ant dir="apps/i2psnark/java/" target="distclean" />
736    </target>
737
738    <target name="pkg" depends="distclean, updater, preppkg, installer" />
739
740    <target name="pkg200" depends="distclean, updater200, preppkg, installer" />
741
742    <target name="pkgclean" depends="deletepkg-temp">
743        <delete>
744            <fileset dir="." includes="i2p.tar.bz2 install.jar i2pupdate.zip i2pupdate200.zip" />
745        </delete>
746    </target>
747
748    <target name="preppkg" depends="preppkg-linux, preppkg-freebsd, preppkg-osx, preppkg-windows, jbigi">
749        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
750        <copy todir="pkg-temp/lib/wrapper/solaris/">
751            <fileset dir="installer/lib/wrapper/solaris/" excludes="*.txt" />
752        </copy>
753    </target>
754
755    <target name="preppkg-nowindows" depends="preppkg-linux, preppkg-freebsd, preppkg-osx, jbigi-nowindows">
756        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
757        <copy todir="pkg-temp/lib/wrapper/solaris/">
758            <fileset dir="installer/lib/wrapper/solaris/" excludes="*.txt" />
759        </copy>
760        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
761    </target>
762
763    <target name="preppkgRepack" depends="preppkg-linux, preppkg-freebsd, preppkg-osx, preppkg-windows, jbigi">
764        <ant target="repack200" />
765        <!-- no use doing repack200 on jbigi.jar -->
766        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
767        <copy todir="pkg-temp/lib/wrapper/solaris/">
768            <fileset dir="installer/lib/wrapper/solaris/" excludes="*.txt" />
769        </copy>
770    </target>
771
772    <target name="preppkg-freebsd" depends="preppkg-unix">
773        <copy todir="pkg-temp/lib/wrapper/freebsd/">
774            <fileset dir="installer/lib/wrapper/freebsd/" excludes="*.txt" />
775        </copy>
776        <copy todir="pkg-temp/lib/wrapper/freebsd64/">
777            <fileset dir="installer/lib/wrapper/freebsd64" excludes="*.txt" />
778        </copy>
779    </target>
780
781    <target name="preppkg-freebsd-only" depends="preppkg-freebsd, jbigi-freebsd-only" >
782        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
783        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
784    </target>
785
786    <!-- only what is needed for debian, etc. -->
787    <target name="preppkg-linux-only" depends="preppkg-linux, jbigi-linux-only" >
788        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
789        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
790    </target>
791
792    <target name="preppkg-unix" depends="preppkg-base, prep-script-translation" >
793        <copy file="installer/resources/runplain.sh" todir="pkg-temp/" />
794        <copy file="installer/resources/eepget" todir="pkg-temp/" />
795        <copy file="installer/resources/i2prouter" todir="pkg-temp/" />
796        <copy file="installer/resources/osid" todir="pkg-temp/" />
797        <copy file="installer/resources/postinstall.sh" todir="pkg-temp/" />
798        <copy todir="pkg-temp/man/">
799            <fileset dir="installer/resources/man/" />
800        </copy>
801    </target>
802
803    <target name="preppkg-linux" depends="preppkg-linux-x86,preppkg-linux-nonx86" />
804
805    <target name="preppkg-linux-x86" depends="preppkg-unix">
806        <copy todir="pkg-temp/lib/wrapper/linux/">
807            <fileset dir="installer/lib/wrapper/linux/" excludes="*.txt" />
808        </copy>
809        <copy todir="pkg-temp/lib/wrapper/linux64/">
810            <fileset dir="installer/lib/wrapper/linux64/" excludes="*.txt" />
811        </copy>
812    </target>
813
814    <target name="preppkg-linux-nonx86" depends="preppkg-unix">
815        <copy todir="pkg-temp/lib/wrapper/linux-ppc/">
816            <fileset dir="installer/lib/wrapper/linux-ppc/" excludes="*.txt" />
817        </copy>
818        <copy todir="pkg-temp/lib/wrapper/linux-armv5/">
819            <fileset dir="installer/lib/wrapper/linux-armv5/" excludes="*.txt" />
820        </copy>
821        <copy todir="pkg-temp/lib/wrapper/linux-armv6/">
822            <fileset dir="installer/lib/wrapper/linux-armv6/" excludes="*.txt" />
823        </copy>
824    </target>
825
826    <target name="preppkg-osx" depends="preppkg-unix">
827        <!--<copy file="installer/resources/I2P Router Console.webloc" todir="pkg-temp/" />-->
828        <copy todir="pkg-temp/Start I2P Router.app">
829            <fileset dir="installer/resources/Start I2P Router.app" />
830        </copy>
831        <copy todir="pkg-temp/lib/wrapper/macosx/">
832            <fileset dir="installer/lib/wrapper/macosx/" excludes="*.txt" />
833        </copy>
834        <copy file="installer/resources/net.i2p.router.plist.template" todir="pkg-temp/" />
835        <copy file="installer/resources/install_i2p_service_osx.command" todir="pkg-temp/" />
836        <copy file="installer/resources/uninstall_i2p_service_osx.command" todir="pkg-temp/" />
837    </target>
838
839    <target name="preppkg-osx-only" depends="preppkg-osx, jbigi-osx-only" >
840        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
841        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
842    </target>
843
844    <target name="preppkg-windows" depends="preppkg-base, buildUtilityJar, buildexe">
845        <copy file="build/i2p.exe" todir="pkg-temp/" failonerror="false" />
846        <copy file="apps/systray/java/lib/systray4j.dll" todir="pkg-temp/lib" />
847        <copy file="apps/systray/java/resources/iggy.ico" todir="pkg-temp/icons" />
848        <copy file="apps/systray/java/resources/iggy.xpm" todir="pkg-temp/icons" />
849        <copy file="installer/resources/eepget.bat" todir="pkg-temp/" />
850        <copy file="installer/resources/i2prouter.bat" todir="pkg-temp/" />
851        <copy file="installer/resources/fixperms.bat" todir="pkg-temp/" />
852        <copy file="installer/resources/install_i2p_service_winnt.bat" todir="pkg-temp/" />
853        <copy file="installer/resources/set_config_dir_for_nt_service.bat" todir="pkg-temp/" />
854        <copy file="installer/resources/uninstall_i2p_service_winnt.bat" todir="pkg-temp/" />
855        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
856        <copy file="build/utility.jar" todir="pkg-temp" />
857        <copy todir="pkg-temp/lib/wrapper/win32/">
858            <fileset dir="installer/lib/wrapper/win32/" excludes="*.txt" />
859        </copy>
860        <copy todir="pkg-temp/lib/wrapper/win64/">
861            <fileset dir="installer/lib/wrapper/win64/" excludes="*.txt" />
862        </copy>
863    </target>
864
865    <target name="preppkg-windows-only" depends="preppkg-windows, jbigi-windows-only">
866        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
867        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
868    </target>
869
870    <target name="preppkg-base" depends="build, preplicenses, prepConsoleDocs, prepthemeupdates, prepCertificates">
871        <!-- if updater200 was run previously, it left *.pack files in pkg-temp -->
872        <!-- Also remove deletelist.txt used for updater only -->
873        <delete>
874            <fileset dir="pkg-temp" includes="**/*.jar.pack **/*.war.pack deletelist.txt" />
875        </delete>
876        <copy file="build/i2p.jar" todir="pkg-temp/lib/" />
877        <copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
878        <!-- all jetty stuff -->
879        <copy todir="pkg-temp/lib" >
880            <fileset dir="build" includes="commons*.jar jasper*.jar javax*.jar jetty*.jar jsp*.jar org.mortbay.*.jar" />
881        </copy>
882        <copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
883        <copy file="build/streaming.jar" todir="pkg-temp/lib/" />
884        <copy file="build/router.jar" todir="pkg-temp/lib/" />
885        <copy file="build/desktopgui.jar" todir="pkg-temp/lib/" />
886        <copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
887        <!-- pulled out of routerconsole.jar in 0.7.12; name without version so we can overwrite if we upgrade  -->
888        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
889        <copy file="build/sam.jar" todir="pkg-temp/lib/" />
890        <copy file="build/BOB.jar" todir="pkg-temp/lib/" />
891        <copy file="build/systray.jar" todir="pkg-temp/lib" />
892        <copy file="build/i2psnark.jar" todir="pkg-temp/lib/" />
893        <copy file="apps/systray/java/lib/systray4j.jar" todir="pkg-temp/lib" />
894        <copy file="build/i2ptunnel.war" todir="pkg-temp/webapps/" />
895        <copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
896        <copy file="build/addressbook.war" todir="pkg-temp/webapps/" />
897        <copy file="build/susimail.war" todir="pkg-temp/webapps/" />
898        <copy file="build/susidns.war" todir="pkg-temp/webapps/" />
899        <copy file="apps/susidns/src/WEB-INF/lib/jstl.jar" todir="pkg-temp/lib/" />
900        <copy file="apps/susidns/src/WEB-INF/lib/standard.jar" todir="pkg-temp/lib/" />
901        <copy file="build/i2psnark.war" todir="pkg-temp/webapps/" />
902        <!--
903             Disabling per zzz's statement on IRC: jetty-i2psnark.xml is for an obscure feature that is broken anyway,
904                                                   you can remove the file, the link, and the patch from the package
905
906                     So I'm going one further: I'm disabling it in build.xml
907                     +++kytv
908                     -->
909        <!--
910        <copy file="apps/i2psnark/jetty-i2psnark.xml" todir="pkg-temp/" />
911        -->
912        <copy file="apps/i2psnark/i2psnark.config" todir="pkg-temp/" />
913        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
914        <copy file="installer/resources/clients.config" todir="pkg-temp/" />
915        <copy file="installer/resources/i2ptunnel.config" todir="pkg-temp/" />
916        <copy file="installer/resources/systray.config" todir="pkg-temp/" />
917        <copy file="installer/resources/wrapper.config" todir="pkg-temp/" />
918        <copy file="installer/resources/hosts.txt" todir="pkg-temp/" />
919        <copy file="INSTALL-headless.txt" todir="pkg-temp/" />
920        <!-- overwrite the truncated history put in by the updater -->
921        <copy file="history.txt" todir="pkg-temp/" overwrite="true" />
922        <mkdir dir="pkg-temp/scripts" />
923        <copy file="apps/proxyscript/i2pProxy.pac" todir="pkg-temp/scripts/" />
924        <copy file="installer/resources/startconsole.html" todir="pkg-temp/docs/" />
925        <copy file="installer/resources/start.ico" todir="pkg-temp/docs/" />
926        <copy file="installer/resources/console.ico" todir="pkg-temp/docs/" />
927        <copy file="installer/resources/uninstall.ico" todir="pkg-temp/docs/" />
928        <!-- Eepsite stuff here -->
929        <mkdir dir="pkg-temp/eepsite" />
930        <copy todir="pkg-temp/eepsite/" >
931            <fileset dir="installer/resources/eepsite/" excludes="**/.placeholder" />
932        </copy>
933        <copy todir="pkg-temp/eepsite/docroot/help/lib/" >
934            <fileset dir="installer/resources/icons/flags/" includes="cn.png de.png es.png fr.png ir.png it.png jp.png nl.png ru.png se.png us.png" />
935        </copy>
936        <copy file="installer/resources/themes/console/images/favicon.ico" tofile="pkg-temp/eepsite/docroot/favicon.ico" />
937    </target>
938
939    <target name="preplicenses">
940        <copy file="LICENSE.txt" todir="pkg-temp/" />
941        <copy todir="pkg-temp/licenses/" >
942          <fileset dir="licenses/" />
943        </copy>
944        <!--
945              The license in launch4j/ is a BSD license for launch4j
946              The license in launch4j/head is a MIT license for the code that is actually wrapped around the jars
947              So we include the MIT one in our binary package
948         -->
949        <copy file="installer/lib/launch4j/head/LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-Launch4j.txt" />
950        <copy file="apps/jetty/apache-tomcat-deployer/NOTICE" tofile="pkg-temp/licenses/NOTICE-Tomcat.txt" />
951        <!--  Not sure if these are used or should be included -->
952        <copy file="installer/lib/launch4j/lib/foxtrot.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-Foxtrot.txt" />
953        <copy file="installer/lib/launch4j/lib/JGoodies.Forms.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-JGoodies-Forms.txt" />
954        <copy file="installer/lib/launch4j/lib/JGoodies.Looks.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-JGoodies-Looks.txt" />
955        <copy file="installer/lib/launch4j/lib/XStream.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-XStream.txt" />
956    </target>
957
958    <target name="prepthemeupdates">
959        <copy todir="pkg-temp/docs/themes/" >
960            <fileset dir="installer/resources/themes/" />
961        </copy>
962    </target>
963
964    <!-- SSL Certs -->
965    <target name="prepCertificates">
966        <copy todir="pkg-temp/certificates/" >
967          <fileset dir="installer/resources/certificates/" />
968        </copy>
969    </target>
970
971    <!-- this is no longer required, izpack 4.3.0 supports headless installs with java -jar i2pinstall.exe -console -->
972    <target name="tarball" depends="preppkg">
973        <tar compression="bzip2" destfile="i2p.tar.bz2">
974            <tarfileset dir="pkg-temp" includes="**/*" prefix="i2p" />
975        </tar>
976    </target>
977
978    <target name="deletepkg-temp">
979        <delete dir="pkg-temp" />
980    </target>
981
982    <!-- readme and proxy error page files, initialNews.xml files, GeoIP files, and flag icons -->
983    <target name="prepConsoleDocs" depends="prepConsoleDocUpdates, prepgeoupdate" >
984        <copy todir="pkg-temp/docs/initialNews/">
985          <fileset dir="installer/resources/initialNews/" />
986        </copy>
987        <!-- ensure the proxy files have the correct line endings -->
988        <fixcrlf srcdir="pkg-temp/docs" includes="*.ht" encoding="utf8" eol="crlf" />
989    </target>
990
991    <!-- readme and proxy error page files -->
992    <target name="prepConsoleDocUpdates">
993        <copy todir="pkg-temp/docs/" >
994          <fileset dir="installer/resources/readme/" includes="readme*.html" />
995          <fileset dir="installer/resources/proxy/" includes="*.ht" />
996          <!-- lang_ar.png added in 0.8.4; a1,a2,je, and eu.png added in 0.8.9; gg.png added in 0.8.10; im.png added in 0.8.12; cw.png added in 0.9.5 -->
997          <fileset dir="installer/resources/" includes="icons/flags/lang_ar.png icons/flags/gg.png icons/flags/je.png icons/flags/eu.png icons/flags/im.png icons/flags/a1.png icons/flags/a2.png icons/flags/cw.png" />
998        </copy>
999    </target>
1000
1001    <target name="consoleDocs" depends="deletepkg-temp, prepConsoleDocs">
1002        <zip destfile="docs.zip" basedir="pkg-temp" whenempty="fail" />
1003    </target>
1004
1005    <target name="copyJavadoc" depends="javadoc">
1006        <copy todir="pkg-temp/docs/javadoc" >
1007          <fileset dir="build/javadoc/" />
1008        </copy>
1009    </target>
1010
1011    <target name="updater200" depends="prepupdate, preplicenses, pack200, zipit200" />
1012    <target name="updater200WithJetty" depends="prepjupdate, preplicenses, pack200, zipit200" />
1013    <target name="updater200WithJettyFixes" depends="prepjupdatefixes, preplicenses, pack200, zipit200" />
1014    <target name="updater200WithJettyFixesAndJbigi" depends="prepjupdatefixes, prepjbigiupdate, preplicenses, pack200, zipit200" />
1015    <target name="updater" depends="prepupdate, preplicenses, zipit" />
1016    <target name="updaterRepack" depends="prepupdate, preplicenses, repack200, zipit" />
1017    <target name="updaterWithJavadoc" depends="prepupdate, preplicenses, copyJavadoc, zipit" />
1018    <target name="updater200WithJavadoc" depends="prepupdate, preplicenses, copyJavadoc, pack200, zipit200" />
1019    <target name="updaterWithJavadocAndJetty" depends="prepjupdate, preplicenses, copyJavadoc, zipit" />
1020    <target name="updater200WithJavadocAndJetty" depends="prepjupdate, preplicenses, copyJavadoc, pack200, zipit200" />
1021    <target name="updaterWithGeoIP" depends="prepupdate, prepgeoupdate, preplicenses, zipit" />
1022    <target name="updaterWithJetty" depends="prepjupdate, preplicenses, zipit" />
1023    <target name="updaterWithJettyRepack" depends="prepjupdate, preplicenses, repack200, zipit" />
1024    <target name="updaterWithJettyFixes" depends="prepjupdatefixes, preplicenses, zipit" />
1025    <target name="updaterWithJettyFixesAndJbigi" depends="prepjupdatefixes, prepjbigiupdate, preplicenses, zipit" />
1026    <target name="updaterWithJettyFixesAndGeoIP" depends="prepjupdatefixes, prepgeoupdate, preplicenses, zipit" />
1027    <target name="updaterSmall" depends="prepupdateSmall, zipit" />
1028    <target name="updaterRouter" depends="prepupdateRouter, zipit" />
1029
1030    <target name="zipit" depends="getReleaseNumber" >
1031        <!--
1032             As of release 0.8.8, the router will enforce a zipfile comment equal to the
1033             version number in the sud/su2 header, since the version in the header is NOT
1034             covered by the signature.
1035         -->
1036        <zip destfile="i2pupdate.zip" basedir="pkg-temp" whenempty="fail" comment="${release.number}" />
1037       <!-- just a test, makes almost no difference
1038        <tar destfile="i2pupdate.tgz" basedir="pkg-temp" compression="gzip" />
1039        <tar destfile="i2pupdate.tbz" basedir="pkg-temp" compression="bzip2" />
1040       -->
1041    </target>
1042
1043    <target name="zipit200" depends="getReleaseNumber" >
1044        <zip destfile="i2pupdate200.zip" basedir="pkg-temp" whenempty="fail" comment="${release.number}" />
1045    </target>
1046
1047    <target name="pack200">
1048        <!-- pack200 will only pack to a .pack file, and only from a .jar file, so we put another .jar on the end -->
1049        <!-- can't pack an empty jar or one without classes, it will fail to unpack on Java 5;
1050          -  see http://bugs.sun.com/view_bug.do?bug_id=6712743
1051          -->
1052        <!-- *nix here -->
1053        <exec executable="sh" osfamily="unix" failonerror="true">
1054            <arg value="-c" />
1055            <arg value="for i in pkg-temp/lib/*.jar pkg-temp/webapps/*war; do if [ $i = pkg-temp/lib/jasper-compiler.jar -o $i = pkg-temp/lib/jbigi.jar -o $i = pkg-temp/lib/jetty-java5-threadpool.jar -o $i = pkg-temp/lib/jetty-sslengine.jar ]; then continue; fi; echo pack200 $i; mv $i $i.jar; pack200 -g $i.pack $i.jar; rm -f $i.jar; done" />
1056        </exec>
1057        <exec executable="sh" osfamily="mac" failonerror="true">
1058            <arg value="-c" />
1059            <arg value="for i in pkg-temp/lib/*.jar pkg-temp/webapps/*war; do if [ $i = pkg-temp/lib/jasper-compiler.jar -o $i = pkg-temp/lib/jbigi.jar -o $i = pkg-temp/lib/jetty-java5-threadpool.jar -o $i = pkg-temp/lib/jetty-sslengine.jar ]; then continue; fi; echo pack200 $i; mv $i $i.jar; pack200 -g $i.pack $i.jar; rm -f $i.jar; done" />
1060        </exec>
1061        <!-- windoz here : i admit, i hate escaped symbols in xml, indeed = =! -->
1062        <exec executable="cmd" osfamily="windows" failonerror="true">
1063            <arg value="/c" />
1064            <!-- TODO implement fix above -->
1065            <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" />
1066        </exec>
1067        <exec executable="cmd" osfamily="windows" failonerror="true">
1068                <arg value="/c" />
1069                <arg value="for %i in (pkg-temp\lib\*.jar) do pack200 -g %i.pack %i &amp;&amp; del %i" />
1070        </exec>
1071    </target>
1072
1073    <!-- saves about 1% on average (more on jars with multiple compiled po files since they have lots of common strings) -->
1074    <target name="repack200">
1075        <!-- pack200 will only repack a .jar file, so we put another .jar on the end -->
1076        <!-- *nix here -->
1077        <exec executable="sh" osfamily="unix" failonerror="true">
1078            <arg value="-c" />
1079            <arg value="for i in pkg-temp/lib/*.jar pkg-temp/webapps/*war; do echo pack200 -r $i; mv $i $i.jar; pack200 -r $i.jar; mv $i.jar $i; done" />
1080        </exec>
1081        <exec executable="sh" osfamily="mac" failonerror="true">
1082            <arg value="-c" />
1083            <arg value="for i in pkg-temp/lib/*.jar pkg-temp/webapps/*war; do echo pack200 -r $i; mv $i $i.jar; pack200 -r $i.jar; mv $i.jar $i; done" />
1084        </exec>
1085        <!-- windoz here : i admit, i hate escaped symbols in xml, indeed = =! -->
1086        <exec executable="cmd" osfamily="windows" failonerror="true">
1087            <arg value="/c" />
1088            <arg value="for %i in (pkg-temp\webapps\*.war) do move %i %i.jar &amp;&amp; pack200 -r %i.jar &amp;&amp; move %i.jar %i" />
1089        </exec>
1090        <exec executable="cmd" osfamily="windows" failonerror="true">
1091                <arg value="/c" />
1092                <arg value="for %i in (pkg-temp\lib\*.jar) do pack200 -r %i" />
1093        </exec>
1094    </target>
1095
1096    <target name="prepupdate" depends="build2, prepupdateSmall, prepConsoleDocUpdates, prepCertificates, prep-script-translation">
1097        <copy file="build/BOB.jar" todir="pkg-temp/lib/" />
1098        <copy file="build/sam.jar" todir="pkg-temp/lib/" />
1099        <copy file="build/i2psnark.jar" todir="pkg-temp/lib" />
1100        <!-- include systray changes in 0.7.5 -->
1101        <copy file="build/systray.jar" todir="pkg-temp/lib/" />
1102       <!-- removed from updater in 0.9
1103        <copy file="build/desktopgui.jar" todir="pkg-temp/lib/" />
1104       -->
1105        <copy file="build/susimail.war" todir="pkg-temp/webapps/" />
1106        <copy file="build/susidns.war" todir="pkg-temp/webapps/" />
1107        <!-- as of 0.7.12; someday, we can remove these from the updater -->
1108        <copy file="apps/susidns/src/WEB-INF/lib/jstl.jar" todir="pkg-temp/lib/" />
1109        <copy file="apps/susidns/src/WEB-INF/lib/standard.jar" todir="pkg-temp/lib/" />
1110        <copy file="build/i2psnark.war" todir="pkg-temp/webapps/" />
1111        <copy file="history.txt" todir="pkg-temp/" />
1112        <!-- the following overwrites history.txt on unix to shrink the update file -->
1113        <copy file="history.txt" tofile="pkg-temp/history.txt" overwrite="true">
1114            <filterchain>
1115                <headfilter lines="1500" />
1116            </filterchain>
1117        </copy>
1118        <concat append="true" destfile="pkg-temp/history.txt">&#10;&#10;----------------&#10;&#10;EARLIER HISTORY IS AVAILABLE IN THE SOURCE PACKAGE"</concat>
1119        <copy file="installer/resources/deletelist.txt" todir="pkg-temp/" />
1120    </target>
1121
1122    <target name="prepupdateSmall" depends="buildSmall, prepupdateRouter, prepjupdatefixes, prepthemeupdates">
1123        <copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
1124        <copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
1125        <copy file="build/streaming.jar" todir="pkg-temp/lib/" />
1126        <copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
1127        <!-- pulled out of routerconsole.jar in 0.7.12, someday we can take out of updater -->
1128        <!-- name without version so we can overwrite if we upgrade  -->
1129        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
1130        <copy file="build/i2ptunnel.war" todir="pkg-temp/webapps/" />
1131        <copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
1132        <copy file="build/addressbook.war" todir="pkg-temp/webapps/" />
1133        <!-- decapitalized the file in 0.7.8 -->
1134        <copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
1135        <!-- small enough to include for now -->
1136        <copy file="installer/resources/geoipv6.dat.gz" todir="pkg-temp/geoip/" />
1137    </target>
1138
1139    <target name="prepupdateRouter" depends="buildrouter, deletepkg-temp">
1140        <copy file="build/i2p.jar" todir="pkg-temp/lib/" />
1141        <copy file="build/router.jar" todir="pkg-temp/lib/" />
1142    </target>
1143
1144    <!-- jbigi.jar -->
1145    <target name="prepjbigiupdate" depends="jbigi">
1146        <copy file="build/jbigi.jar" todir="pkg-temp/lib/" />
1147    </target>
1148
1149    <!-- GeoIP files and flag icons -->
1150    <target name="prepgeoupdate">
1151        <copy file="installer/resources/geoip.txt" todir="pkg-temp/geoip/" />
1152        <copy file="installer/resources/geoipv6.dat.gz" todir="pkg-temp/geoip/" />
1153        <copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
1154        <copy todir="pkg-temp/docs/icons/flags" >
1155          <fileset dir="installer/resources/icons/flags" />
1156        </copy>
1157    </target>
1158
1159    <!-- All jetty jars required for update.
1160         We don't need commons-el or commons-logging, they haven't changed.
1161         TODO do we need to bother updating jasper?
1162         TODO where is JMX? We don't need it I hope.
1163      -->
1164    <target name="prepjupdate" depends="prepupdate, buildWEB">
1165        <copy todir="pkg-temp/lib" >
1166            <fileset dir="build" includes="commons*.jar jasper*.jar javax*.jar jetty*.jar jsp*.jar org.mortbay.*.jar" />
1167        </copy>
1168        <!--  We have to package the new eepsite files for MigrateJetty.java, but we
1169              can't overwrite an existing eepsite dir in a non-split configuration.
1170          -->
1171        <copy todir="pkg-temp/eepsite-jetty7" >
1172            <fileset dir="installer/resources/eepsite" includes="*.xml contexts/* etc/*" />
1173        </copy>
1174    </target>
1175
1176    <target name="delete-j6-update">
1177        <delete dir="pkg-temp/eepsite-jetty7" />
1178    </target>
1179
1180    <!-- Jetty 6 I2P logging addons, not really fixes -->
1181    <target name="prepjupdatefixes" depends="buildWEB">
1182        <copy file="build/jetty-i2p.jar" todir="pkg-temp/lib/" />
1183    </target>
1184
1185    <target name="util-list-changes" depends="checkForMtn" if="mtn.available" >
1186        <exec executable="mtn" outputproperty="workspace.changes.util" errorproperty="mtn.error.util" failifexecutionfails="false" >
1187            <arg value="list" />
1188            <arg value="changed" />
1189            <arg value="core/java/src/net/i2p/util" />
1190        </exec>
1191        <!-- \n in an attribute value generates an invalid manifest -->
1192        <exec executable="tr" inputstring="${workspace.changes.util}" outputproperty="workspace.changes.util.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
1193            <arg value="-s" />
1194            <arg value="[:space:]" />
1195            <arg value="," />
1196        </exec>
1197    </target>
1198
1199    <target name="izpack-patches" >
1200            <taskdef name="izpack"
1201                     classpath="${basedir}/installer/lib/izpack/patches.jar:${basedir}/installer/lib/izpack/standalone-compiler.jar"
1202                     classname="com.izforge.izpack.ant.IzPackTask" />
1203        <jar destfile="${basedir}/installer/lib/izpack/patches.jar"
1204             basedir="${basedir}/installer/lib/izpack/patches" />
1205    </target>
1206
1207    <target name="buildUtilityJar" depends="buildCore">
1208        <ant dir="installer/java" target="build" />
1209    </target>
1210
1211    <target name="installer" depends="preppkg, buildProperties, util-list-changes, izpack-patches, buildUtilityJar" >
1212        <!--
1213          Force 1.5 pack200 output
1214          Doesnt work!
1215          http://jira.codehaus.org/browse/IZPACK-404
1216          http://forums.sun.com/thread.jspa?threadID=773439
1217          http://bfo.co.uk/blog/2010/05/13/combining_ant_jar_signatures_and_pack200.html
1218        <property name="com.sun.java.util.jar.pack.package.majver" value="150" />
1219        <property name="com.sun.java.util.jar.pack.package.minver" value="7" />
1220        -->
1221        <izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
1222
1223        <ant target="installerexe" />
1224    </target>
1225
1226    <!-- this makes i2pinstall.exe from install.jar -->
1227    <target name="installerexe" depends="launch4j" unless="noExe">
1228        <echo message="See the file &quot;build.properties&quot; if this step fails." />
1229        <!-- now the installer exe -->
1230        <launch4j configFile="./installer/i2pinstaller.xml" />
1231        <!-- thazzit -->
1232    </target>
1233
1234    <!-- Custom installers -->
1235    <target name="installer-nowindows" depends="clean, preppkg-nowindows, izpack-patches" >
1236        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1237        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}.jar" installerType="standard" basedir="${basedir}" />
1238    </target>
1239
1240
1241    <target name="installer-freebsd" depends="clean, preppkg-freebsd-only, izpack-patches" >
1242        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1243        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_freebsd-only.jar" installerType="standard" basedir="${basedir}" />
1244    </target>
1245
1246    <target name="installer-linux" depends="clean, preppkg-linux-only, izpack-patches" >
1247        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1248        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_linux-only.jar" installerType="standard" basedir="${basedir}" />
1249    </target>
1250
1251
1252    <target name="installer-osx" depends="clean, checkForIzpack2App, preppkg-osx-only, izpack-patches">
1253        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1254        <mkdir dir="pkg-temp/osx" />
1255        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_osx-only.jar" installerType="standard" basedir="${basedir}" />
1256        <ant target="installer2app" />
1257        <delete dir="pkg-temp/osx" />
1258    </target>
1259
1260    <target name="checkForIzpack2App">
1261        <!-- we'll set the izpack2app binary name if it's not been set elsewhere yet -->
1262        <property name="izpack2app.binary" value="${user.home}/IzPack/utils/wrappers/izpack2app/izpack2app.py" />
1263        <available property="izpack2app.available" file="${izpack2app.binary}" />
1264    </target>
1265
1266    <target name="installer2app" if="izpack2app.available">
1267        <mkdir dir="pkg-temp/osx" />
1268        <exec executable="python" failonerror="true">
1269            <arg value="${izpack2app.binary}" />
1270            <arg value="${basedir}/i2pinstall_${full.version}_osx-only.jar" />
1271            <arg value="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" />
1272        </exec>
1273
1274        <tar longfile="gnu" destfile="${basedir}/i2pinstall_${full.version}_osx.tar.bz2" compression="bzip2">
1275            <tarfileset dir="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" prefix="/i2p-${full.version}_osx-install.app" filemode="644">
1276                <include name="**/**" />
1277                <exclude name="Contents/MacOS/*" />
1278            </tarfileset>
1279            <tarfileset dir="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" prefix="/i2p-${full.version}_osx-install.app" filemode="755">
1280                <include name="Contents/MacOS/*" />
1281            </tarfileset>
1282        </tar>
1283    </target>
1284
1285    <!-- call between installer-xxx and installer-windows -->
1286    <target name="delete-nonwindows">
1287        <delete dir="pkg-temp/lib/wrapper/" />
1288        <delete dir="pkg-temp/locale/" />
1289        <delete dir="pkg-temp/man/" />
1290        <delete dir="pkg-temp/Start I2P Router.app/" />
1291        <delete dir="pkg-temp" includes="eepget i2prouter INSTALL-headless.txt osid postinstall.sh runplain.sh" />
1292    </target>
1293
1294    <target name="installer-windows" depends="clean, preppkg-windows-only, util-list-changes, izpack-patches, buildUtilityJar" >
1295        <fixcrlf srcdir="pkg-temp" includes="*.config *.bat *.cmd **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="crlf"/>
1296        <izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
1297        <ant target="installerexe" />
1298        <delete file="${basedir}/install.jar" />
1299        <move file="${basedir}/i2pinstall.exe" tofile="${basedir}/i2pinstall_${full.version}_windows-only.exe" />
1300    </target>
1301
1302    <!-- this is broken as installer-xxx targets may delete (or not delete) things in pkg-temp -->
1303    <target name="installer-all" depends="installer-freebsd, installer-linux, installer-osx, installer-windows, installer-nowindows, installer" >
1304    </target>
1305    <!-- end custom installers -->
1306
1307    <!-- unit tests -->
1308    <target name="buildTest">
1309        <ant dir="core/java/" target="jarTest" />
1310        <ant dir="router/java/" target="jarTest" />
1311        <copy file="core/java/build/i2ptest.jar" todir="build" />
1312        <copy file="router/java/build/routertest.jar" todir="build" />
1313    </target>
1314    <target name="prepTest" depends="prepupdate, buildTest">
1315        <!-- overwrite i2p.jar and router.jar with the test versions -->
1316        <copy file="build/i2ptest.jar" tofile="pkg-temp/lib/i2p.jar" overwrite="true" />
1317        <copy file="build/routertest.jar" tofile="pkg-temp/lib/router.jar" overwrite="true" />
1318    </target>
1319    <target name="updateTest" depends="prepTest, zipit" />
1320    <target name="junit.test" depends="buildProperties, jbigi" >
1321        <ant dir="core/java/" target="junit.test" />
1322        <ant dir="router/java/" target="junit.test" />
1323        <ant dir="apps/streaming/java/" target="junit.test" />
1324    </target>
1325    <target name="scalatest.test" depends="buildProperties, jbigi" >
1326        <ant dir="core/java/" target="scalatest.test" />
1327        <!-- note there are no router scala tests yet -->
1328        <ant dir="router/java/" target="scalatest.test" />
1329    </target>
1330    <target name="test" depends="buildProperties, jbigi" >
1331        <!-- both junit and scala -->
1332        <ant dir="core/java/" target="test" />
1333        <ant dir="router/java/" target="test" />
1334        <ant dir="apps/streaming/java/" target="test" />
1335    </target>
1336    <target name="scalatest.report" depends="buildProperties" >
1337        <ant dir="core/java/" target="scalatest.report" />
1338        <ant dir="router/java/" target="scalatest.report" />
1339    </target>
1340    <target name="junit.report" depends="buildProperties" >
1341        <ant dir="core/java/" target="junit.report" />
1342        <ant dir="router/java/" target="junit.report" />
1343        <ant dir="apps/streaming/java/" target="junit.report" />
1344    </target>
1345    <target name="clover.report" depends="buildProperties" if="with.clover">
1346        <ant dir="core/java/" target="clover.report" />
1347        <ant dir="router/java/" target="clover.report" />
1348        <ant dir="apps/streaming/java" target="clover.report" />
1349    </target>
1350    <target name="cobertura.report" depends="buildProperties" if="with.cobertura">
1351        <ant dir="core/java/" target="cobertura.report" />
1352        <ant dir="router/java/" target="cobertura.report" />
1353        <ant dir="apps/streaming/java" target="cobertura.report" />
1354    </target>
1355    <target name="test.report" depends="junit.report, scalatest.report, clover.report, cobertura.report"/>
1356    <target name="fulltest" depends="buildProperties, jbigi" >
1357        <ant dir="core/java/" target="fulltest" />
1358        <ant dir="router/java/" target="fulltest" />
1359        <ant dir="apps/streaming/java" target="fulltest" />
1360    </target>
1361    <target name="jenkins.cobertura.report" depends="cobertura.report">
1362        <!--
1363             The jenkins cobertura plugin couldn't find the source files.
1364         -->
1365        <replaceregexp byline="true" file="reports/core/cobertura/coverage.xml"
1366            match='filename="net' replace='filename="core/java/src/net'/>
1367        <replaceregexp byline="true" file="reports/core/cobertura/coverage.xml"
1368            match="&lt;source&gt;./src" replace='&lt;source&gt;./core/java/src'/>
1369
1370        <replaceregexp byline="true" file="reports/router/cobertura/coverage.xml"
1371            match='filename="net' replace='filename="router/java/src/net'/>
1372        <replaceregexp byline="true" file="reports/router/cobertura/coverage.xml"
1373            match="&lt;source&gt;./src" replace="&lt;source&gt;router/java/src"/>
1374
1375        <replaceregexp byline="true" file="reports/streaming/cobertura/coverage.xml"
1376            match='filename="net' replace='filename="apps/streaming/java/src/net'/>
1377        <replaceregexp byline="true" file="reports/streaming/cobertura/coverage.xml"
1378            match="&lt;source&gt;./src" replace="&lt;source&gt;apps/streaming/java/src"/>
1379    </target>
1380    <!-- end unit tests -->
1381
1382    <target name="testscripts" >
1383        <exec executable="tests/scripts/checkcerts.sh" failonerror="true" />
1384        <exec executable="tests/scripts/checkpo.sh" failonerror="true" />
1385        <exec executable="tests/scripts/checkutf8.sh" failonerror="true" />
1386        <exec executable="tests/scripts/checkxml.sh" failonerror="true" />
1387        <exec executable="tests/scripts/checkscripts.sh" failonerror="true" />
1388    </target>
1389
1390
1391    <!-- <target name="syndie" >
1392        <ant dir="apps/syndie/java/" target="standalone" />
1393        <copy file="apps/syndie/java/syndie-standalone.zip" todir="." />
1394    </target> -->
1395    <target name="i2psnark" depends="buildProperties" >
1396        <ant dir="apps/i2psnark/java" target="standalone" />
1397        <copy file="apps/i2psnark/java/i2psnark-standalone.zip" todir="." />
1398    </target>
1399    <target name="slackpkg">
1400        <echo message="Building Slackware package." />
1401        <ant dir="Slackware/i2p/" target="slackpkg" />
1402        <ant dir="Slackware/i2p-base/" target="slackpkg" />
1403    </target>
1404    <target name="justBOB" depends="builddepSmall, jbigi">
1405        <ant dir="apps/BOB/" target="onejar" />
1406        <copy file="apps/BOB/dist/BOB-one.jar" todir="." />
1407    </target>
1408
1409    <target name="sloccount.report">
1410        <property name="sloccount.report.file" value="sloccount.sc" />
1411        <echo message="Generating sloccount report (this will take awhile)" />
1412        <exec executable="sloccount" failonerror="true">
1413            <arg value="--details"/>
1414            <arg value="--wide"/>
1415            <arg value="${basedir}"/>
1416            <redirector output="${sloccount.report.file}">
1417                <outputfilterchain>
1418                    <linecontainsregexp negate="true">
1419                        <regexp pattern="(Warning: |lib/launch4j|_MTN|reports|pkg-temp|licenses|i2p\.fba|gmp-|WEB-INF)" />
1420                    </linecontainsregexp>
1421                    <linecontains negate="true">
1422                        <contains value="${sloccount.report.file}" />
1423                    </linecontains>
1424                </outputfilterchain>
1425            </redirector>
1426        </exec>
1427        <echo message="sloccount report saved to the file &quot;${sloccount.report.file}&quot;" />
1428    </target>
1429
1430    <target name="findbugs" depends="build2, buildUtilityJar">
1431        <echo message="Starting findbugs, this will take a while..." />
1432        <exec executable="nice" failonerror="true">
1433            <arg value="findbugs"/>
1434            <arg value="-textui"/>
1435            <arg value="-projectName"/>
1436            <arg value="i2p"/>
1437            <arg value="-sortByClass"/>
1438            <arg value="-xml"/>
1439            <arg value="-output"/>
1440            <arg value="i2p.fba"/>
1441            <arg value="-auxclasspath"/>
1442            <arg value="build/commons-el.jar:build/commons-logging.jar:build/jasper-runtime.jar:build/javax.servlet.jar:build/org.mortbay.jetty.jar:apps/jrobin/jrobin-1.5.9.1.jar:apps/systray/java/lib/systray4j.jar:installer/lib/wrapper/all/wrapper.jar:apps/susidns/src/WEB-INF/lib/standard.jar:apps/susidns/src/WEB-INF/lib/jstl.jar:apps/jrobin/jrobin-1.5.9.1.jar"/>
1443            <arg value="-sourcepath"/>
1444            <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/:installer/java/src"/>
1445            <!-- start of the files to be analyzed -->
1446            <arg value="build/BOB.jar"/>
1447            <arg value="build/addressbook.war"/>
1448            <arg value="build/i2p.jar"/>
1449            <arg value="build/i2psnark.jar"/>
1450            <arg value="build/i2psnark.war"/>
1451            <arg value="build/i2ptunnel.jar"/>
1452            <arg value="build/i2ptunnel.war"/>
1453            <arg value="build/mstreaming.jar"/>
1454            <arg value="build/router.jar/"/>
1455            <arg value="build/desktopgui.jar"/>
1456            <arg value="build/routerconsole.jar"/>
1457            <arg value="build/routerconsole.war"/>
1458            <arg value="build/sam.jar"/>
1459            <arg value="build/streaming.jar"/>
1460            <arg value="build/susidns.war"/>
1461            <arg value="build/susimail.war"/>
1462            <arg value="build/systray.jar"/>
1463            <arg value="build/utility.jar"/>
1464        </exec>
1465        <echo message="Findbugs output stored in i2p.fba" />
1466        <echo message="Now run: findbugs i2p.fba" />
1467    </target>
1468
1469    <!-- this is the same dependency as pkg, but with updater200 in the middle,
1470         since preppkg puts too much stuff in pkg-temp -->
1471<!--
1472    <target name="release" depends="distclean, updaterWithJettyFixesAndJbigi , updater200WithJettyFixes, preppkg, installer, getReleaseNumber" >
1473-->
1474    <target name="release" depends="verifyReleaseBuildNumbers, distclean, testscripts, updaterWithJettyRepack, updater200WithJetty, delete-j6-update, installer-nowindows, delete-nonwindows, installer-windows" >
1475        <echo message="================================================================" />
1476        <echo message="Did you update these files?" />
1477        <exec executable="ls" failonerror="true">
1478            <arg value="-l" />
1479            <arg value="history.txt" />
1480            <arg value="installer/install.xml" />
1481            <arg value="core/java/src/net/i2p/CoreVersion.java" />
1482            <arg value="router/java/src/net/i2p/router/RouterVersion.java" />
1483        </exec>
1484        <echo message="Everything is checked in, right? Let's be sure:" />
1485        <exec executable="mtn" failonerror="true">
1486            <arg value="st" />
1487        </exec>
1488        <echo message="If there are any modified files above, stop now!" />
1489
1490        <echo message="New version number is ${release.number}" />
1491        <copy file="i2pupdate.zip" tofile="i2pupdate_${release.number}.zip" />
1492        <copy file="i2pinstall_${full.version}_windows-only.exe" tofile="i2pinstall_${release.number}_windows.exe" />
1493        <copy file="i2pinstall_${full.version}.jar" tofile="i2pinstall_${release.number}.jar" />
1494        <delete file="i2pupdate.sud" />
1495        <delete file="i2pupdate.su2" />
1496        <!-- make this a lot easier by putting release.privkey=/path/to/privkey in override.properties -->
1497        <input message="Enter private signing key file:" addproperty="release.privkey" />
1498        <fail message="You must enter a path." >
1499            <condition>
1500                <equals arg1="${release.privkey}" arg2=""/>
1501            </condition>
1502        </fail>
1503        <echo message="Key file is ${release.privkey}" />
1504        <!-- now build and verify the unpacked sud from the unpacked zip -->
1505        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
1506            <classpath>
1507                <pathelement location="build/i2p.jar" />
1508            </classpath>
1509            <arg value="sign" />
1510            <arg value="i2pupdate.zip" />
1511            <arg value="i2pupdate.sud" />
1512            <arg value="${release.privkey}" />
1513            <arg value="${release.number}" />
1514        </java>
1515        <echo message="Verify version and VALID signature:" />
1516        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
1517            <classpath>
1518                <pathelement location="build/i2p.jar" />
1519            </classpath>
1520            <arg value="verifysig" />
1521            <arg value="i2pupdate.sud" />
1522        </java>
1523        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
1524            <classpath>
1525                <pathelement location="build/i2p.jar" />
1526            </classpath>
1527            <arg value="verifyversion" />
1528            <arg value="i2pupdate.sud" />
1529        </java>
1530        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
1531            <classpath>
1532                <pathelement location="build/i2p.jar" />
1533            </classpath>
1534            <arg value="showversion" />
1535            <arg value="i2pupdate.sud" />
1536        </java>
1537        <!-- now build and verify the packed su2 from the packed zip -->
1538        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
1539            <classpath>
1540                <pathelement location="build/i2p.jar" />
1541            </classpath>
1542            <arg value="sign" />
1543            <arg value="i2pupdate200.zip" />
1544            <arg value="i2pupdate.su2" />
1545            <arg value="${release.privkey}" />
1546            <arg value="${release.number}" />
1547        </java>
1548        <echo message="Verify version and VALID signature:" />
1549        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
1550            <classpath>
1551                <pathelement location="build/i2p.jar" />
1552            </classpath>
1553            <arg value="verifysig" />
1554            <arg value="i2pupdate.su2" />
1555        </java>
1556        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
1557            <classpath>
1558                <pathelement location="build/i2p.jar" />
1559            </classpath>
1560            <arg value="verifyversion" />
1561            <arg value="i2pupdate.su2" />
1562        </java>
1563        <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
1564            <classpath>
1565                <pathelement location="build/i2p.jar" />
1566            </classpath>
1567            <arg value="showversion" />
1568            <arg value="i2pupdate.su2" />
1569        </java>
1570        <!-- now build and verify the packed su3 from the packed zip -->
1571        <input message="Enter su3 private signing key store:" addproperty="release.privkey.su3" />
1572        <fail message="You must enter a path." >
1573            <condition>
1574                <equals arg1="${release.privkey.su3}" arg2=""/>
1575            </condition>
1576        </fail>
1577        <input message="Enter key name (you@mail.i2p):" addproperty="release.signer.su3" />
1578        <fail message="You must enter a name." >
1579            <condition>
1580                <equals arg1="${release.signer.su3}" arg2=""/>
1581            </condition>
1582        </fail>
1583        <input message="Enter key password for ${release.signer.su3}:" addproperty="release.password.su3" />
1584        <fail message="You must enter a password." >
1585            <condition>
1586                <equals arg1="${release.password.su3}" arg2=""/>
1587            </condition>
1588        </fail>
1589        <java classname="net.i2p.crypto.SU3File" inputstring="${release.password.su3}" fork="true" failonerror="true">
1590            <classpath>
1591                <pathelement location="build/i2p.jar" />
1592            </classpath>
1593            <arg value="sign" />
1594            <arg value="-c" />
1595            <arg value="ROUTER" />
1596            <arg value="-t" />
1597            <arg value="RSA_SHA512_4096" />
1598            <arg value="i2pupdate200.zip" />
1599            <arg value="i2pupdate.su3" />
1600            <arg value="${release.privkey.su3}" />
1601            <arg value="${release.number}" />
1602            <arg value="${release.signer.su3}" />
1603        </java>
1604        <echo message="Verify version and VALID signature:" />
1605        <java classname="net.i2p.crypto.SU3File" fork="true" failonerror="true">
1606            <classpath>
1607                <pathelement location="build/i2p.jar" />
1608            </classpath>
1609            <!-- set base dir so it can find the pubkey cert -->
1610            <jvmarg value="-Di2p.dir.base=installer/resources" />
1611            <arg value="verifysig" />
1612            <arg value="i2pupdate.su3" />
1613        </java>
1614        <java classname="net.i2p.crypto.SU3File" fork="true" failonerror="true">
1615            <classpath>
1616                <pathelement location="build/i2p.jar" />
1617            </classpath>
1618            <!-- set base dir so it can find the pubkey cert -->
1619            <jvmarg value="-Di2p.dir.base=installer/resources" />
1620            <arg value="showversion" />
1621            <arg value="i2pupdate.su3" />
1622        </java>
1623        <!-- will this use the monotonerc file in the current workspace? -->
1624        <echo message="Checking out fresh copy into ../i2p-${release.number} for tarballing:" />
1625        <delete dir="../i2p-${release.number}" />
1626        <exec executable="mtn" failonerror="true">
1627            <arg value="co" />
1628            <!-- w: is the revision of the current workspace -->
1629            <arg value="-r" />
1630            <arg value="w:" />
1631            <arg value="../i2p-${release.number}/" />
1632        </exec>
1633        <exec executable="tar" failonerror="true">
1634            <arg value="cjf" />
1635            <arg value="i2psource_${release.number}.tar.bz2" />
1636            <arg value="-C" />
1637            <arg value=".." />
1638            <arg value="--exclude" />
1639            <arg value="i2p-${release.number}/_MTN*" />
1640            <arg value="i2p-${release.number}/" />
1641        </exec>
1642        <echo message="Sign the files:" />
1643        <delete file="i2pinstall_${release.number}_windows.exe.sig" />
1644        <delete file="i2pinstall_${release.number}.jar.sig" />
1645        <delete file="i2psource_${release.number}.tar.bz2.sig" />
1646        <delete file="i2pupdate_${release.number}.zip.sig" />
1647        <exec executable="gpg" failonerror="true">
1648            <arg value="-b" />
1649            <arg value="i2pinstall_${release.number}_windows.exe" />
1650        </exec>
1651        <exec executable="gpg" failonerror="true">
1652            <arg value="-b" />
1653            <arg value="i2pinstall_${release.number}.jar" />
1654        </exec>
1655        <exec executable="gpg" failonerror="true">
1656            <arg value="-b" />
1657            <arg value="i2psource_${release.number}.tar.bz2" />
1658        </exec>
1659        <exec executable="gpg" failonerror="true">
1660            <arg value="-b" />
1661            <arg value="i2pupdate_${release.number}.zip" />
1662        </exec>
1663        <exec executable="chmod" failonerror="true">
1664            <arg value="444" />
1665            <arg value="i2pinstall_${release.number}_windows.exe" />
1666            <arg value="i2pinstall_${release.number}.jar" />
1667            <arg value="i2psource_${release.number}.tar.bz2" />
1668            <arg value="i2pupdate_${release.number}.zip" />
1669            <arg value="i2pupdate.su2" />
1670            <arg value="i2pupdate.su3" />
1671            <arg value="i2pupdate.sud" />
1672            <arg value="i2pinstall_${release.number}_windows.exe.sig" />
1673            <arg value="i2pinstall_${release.number}.jar.sig" />
1674            <arg value="i2psource_${release.number}.tar.bz2.sig" />
1675            <arg value="i2pupdate_${release.number}.zip.sig" />
1676        </exec>
1677        <echo message="File sizes:" />
1678        <exec executable="ls" failonerror="true">
1679            <arg value="-l" />
1680            <arg value="i2pinstall_${release.number}_windows.exe" />
1681            <arg value="i2pinstall_${release.number}.jar" />
1682            <arg value="i2psource_${release.number}.tar.bz2" />
1683            <arg value="i2pupdate_${release.number}.zip" />
1684            <arg value="i2pupdate.su2" />
1685            <arg value="i2pupdate.su3" />
1686            <arg value="i2pupdate.sud" />
1687            <arg value="i2pinstall_${release.number}_windows.exe.sig" />
1688            <arg value="i2pinstall_${release.number}.jar.sig" />
1689            <arg value="i2psource_${release.number}.tar.bz2.sig" />
1690            <arg value="i2pupdate_${release.number}.zip.sig" />
1691        </exec>
1692        <echo message="SHA256 sums:" />
1693        <exec executable="sha256sum" failonerror="true">
1694            <arg value="i2pinstall_${release.number}_windows.exe" />
1695            <arg value="i2pinstall_${release.number}.jar" />
1696            <arg value="i2psource_${release.number}.tar.bz2" />
1697            <arg value="i2pupdate_${release.number}.zip" />
1698            <arg value="i2pupdate.su2" />
1699            <arg value="i2pupdate.su3" />
1700            <arg value="i2pupdate.sud" />
1701        </exec>
1702        <!-- make torrent files -->
1703        <copy file="i2pupdate.sud" tofile="i2pupdate-${release.number}.sud" />
1704        <java classname="org.klomp.snark.Storage" fork="true" failonerror="true">
1705            <classpath>
1706                <pathelement location="build/i2p.jar" />
1707                <pathelement location="build/i2psnark.jar" />
1708            </classpath>
1709            <arg value="i2pupdate-${release.number}.sud" />
1710            <arg value="http://tracker2.postman.i2p/announce.php" />
1711        </java>
1712        <copy file="i2pupdate.su2" tofile="i2pupdate-${release.number}.su2" />
1713        <java classname="org.klomp.snark.Storage" fork="true" failonerror="true">
1714            <classpath>
1715                <pathelement location="build/i2p.jar" />
1716                <pathelement location="build/i2psnark.jar" />
1717            </classpath>
1718            <arg value="i2pupdate-${release.number}.su2" />
1719            <arg value="http://tracker2.postman.i2p/announce.php" />
1720        </java>
1721        <copy file="i2pupdate.su3" tofile="i2pupdate-${release.number}.su3" />
1722        <java classname="org.klomp.snark.Storage" fork="true" failonerror="true">
1723            <classpath>
1724                <pathelement location="build/i2p.jar" />
1725                <pathelement location="build/i2psnark.jar" />
1726            </classpath>
1727            <arg value="i2pupdate-${release.number}.su3" />
1728            <arg value="http://tracker2.postman.i2p/announce.php" />
1729        </java>
1730        <echo message="Don't forget to mtn tag w: i2p-${release.number}" />
1731        <echo message="... and mtn cert t:i2p-${release.number} branch i2p.i2p.release" />
1732    </target>
1733
1734    <target name="debian" depends="debian-clean, debchange, debian-binary" />
1735
1736    <target name="getExtendedVersion" depends="buildProperties, trimMtnRev">
1737        <property name="MtnShortHash" value="unknown" />
1738        <condition property="Extended.Version" value="${full.version}-${MtnShortHash}">
1739            <not>
1740                <or>
1741                    <equals arg1="${MtnShortHash}" arg2="" />
1742                    <equals arg1="${MtnShortHash}" arg2="unknown" />
1743                </or>
1744            </not>
1745        </condition>
1746        <!-- if not set above we'll set it here -->
1747        <property name="Extended.Version" value="${full.version}" />
1748    </target>
1749
1750    <target name="debchange" depends="getExtendedVersion" unless="noAutoDebchange">
1751        <echo message= "Debian version is ${Extended.Version}-1" />
1752        <exec executable="dch" failonerror="true">
1753            <arg value="-b" />
1754            <arg value="--check-dirname-level" />
1755            <arg value="0" />
1756            <arg value="-v" />
1757            <arg value="${Extended.Version}-1" />
1758            <arg value="Unofficial Debian package built using &quot;ant debian&quot;" />
1759        </exec>
1760    </target>
1761
1762    <target name="debian-binary" depends="getExtendedVersion">
1763        <exec executable="fakeroot" failonerror="true">
1764            <arg value="debian/rules" />
1765            <arg value="patch" />
1766            <arg value="binary" />
1767            <arg value="clean" />
1768        </exec>
1769        <delete dir=".pc" />
1770        <move todir=".">
1771            <fileset dir=".." includes="libjbigi*${release.number}*.deb i2p*${release.number}*.deb" />
1772        </move>
1773        <echo message="" />
1774        <echo message="====================" />
1775        <echo message="Packages have been built and moved to ${basedir}" />
1776        <echo message="====================" />
1777    </target>
1778
1779    <target name="debian-clean" depends="getExtendedVersion" >
1780        <exec executable="fakeroot" failonerror="true">
1781            <arg value="debian/rules" />
1782            <arg value="clean" />
1783        </exec>
1784        <delete dir="./.pc" />
1785    </target>
1786
1787    <target name="debian-tarball" depends="getExtendedVersion">
1788        <!-- will this use the monotonerc file in the current workspace? -->
1789        <fail message="This target cannot be used without Monotone! Use &quot;fakeroot debian/rules get-orig-source&quot; instead.">
1790            <condition>
1791                <not>
1792                    <isset property="mtn.available" />
1793                </not>
1794            </condition>
1795        </fail>
1796        <property name="debian.tarball.name" value="i2p_${Extended.Version}.orig.tar.bz2" />
1797        <echo message="Checking out fresh copy into ../i2p-${Extended.Version} for tarballing:" />
1798        <delete dir="../i2p-${Extended.Version}" />
1799        <exec executable="mtn" failonerror="true">
1800            <arg value="co" />
1801            <arg value="-b" />
1802            <arg value="i2p.i2p" />
1803            <!-- w: is the revision of the current workspace -->
1804            <arg value="-r" />
1805            <arg value="w:" />
1806            <arg value="../i2p-${Extended.Version}" />
1807        </exec>
1808        <delete includeemptydirs="true" quiet="false">
1809            <fileset dir="../i2p-${Extended.Version}/installer/lib/" />
1810            <fileset dir="../i2p-${Extended.Version}/Slackware" />
1811            <fileset dir="../i2p-${Extended.Version}/_MTN" />
1812        </delete>
1813        <tar longfile="gnu" destfile="../${debian.tarball.name}" compression="bzip2">
1814            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${Extended.Version}">
1815                <include name="**/**" />
1816                <exclude name="debian/**"/>
1817                <exclude name="**/*.sh"/>
1818            </tarfileset>
1819            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${Extended.Version}" filemode="755">
1820                <exclude name="debian/**" />
1821                <include name="**/*.sh" />
1822            </tarfileset>
1823        </tar>
1824    </target>
1825
1826    <target name="debian-patch" depends="getExtendedVersion" >
1827        <exec executable="quilt" failonerror="true">
1828            <arg value="-a" />
1829            <arg value="push" />
1830        </exec>
1831        <echo message="====================" />
1832    </target>
1833    <target name="debian-unpatch" depends="buildProperties">
1834        <exec executable="quilt" failonerror="false">
1835            <arg value="-a" />
1836            <arg value="pop" />
1837        </exec>
1838    </target>
1839
1840    <target name="debianrepo" depends="debian">
1841        <exec dir="debian" executable="./makerepo.sh" failonerror="true"/>
1842    </target>
1843
1844<!-- the following are appened to help build barebone portable version,
1845     none of the above is modified for this purpose -->
1846        <target name = "pkg-portable-clean">
1847                <delete dir="build/" />
1848                <delete dir="pkg-temp/" />
1849                <delete>
1850                        <fileset dir="." includes="portable-**.zip**" />
1851                </delete>
1852        </target>
1853<!-- build a portable archive -->
1854
1855<!-- *0* Since we simply pack all files in folder "build/" into our archieve,
1856                we need to make sure its small, with NO redundent jars or wars.
1857                thus cleaning is required before each build-->
1858        <target name="buildSmallOnly" depends="pkg-portable-clean,buildSmall"/>
1859
1860<!-- *1* preparing the jars by OS dependent de-bloating -->
1861        <target name="preppkg-portable-win32-jbigi" depends="buildSmallOnly, jbigi-windows-only" />
1862
1863        <target name="preppkg-portable-linux-jbigi"  depends="buildSmallOnly, jbigi-linux-only" />
1864
1865<!-- *2* os independent procedure  -->
1866        <target name="preppkg-portable-basic" >
1867                <mkdir dir="pkg-temp" />
1868                        <!-- non OS dependent configurations only, dont add *nux/win stuff here -->
1869                        <copy todir="pkg-temp">
1870                                <fileset dir="installer/resources/portable/configs/" />
1871                        </copy>
1872                        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
1873                        <copy file="installer/resources/hosts.txt" todir="pkg-temp/" />
1874                        <copy file="installer/resources/readme.license.txt" todir="pkg-temp/" />
1875                <mkdir dir="pkg-temp/addressbook" />
1876                        <copy file="apps/addressbook/subscriptions.txt" todir="pkg-temp/addressbook/" />
1877                        <copy file="apps/addressbook/myhosts.txt"  todir="pkg-temp/addressbook/" />
1878                        <!-- config.txt is in installer/resources/portable -->
1879                <mkdir dir="pkg-temp/docs" />
1880                        <copy file="installer/resources/initialNews/initialNews.xml" tofile="pkg-temp/docs/news.xml" overwrite="true" />
1881                        <copy file="installer/resources/readme/readme.html" tofile="pkg-temp/docs/readme.html" />
1882                        <copy file="installer/resources/startconsole.html" todir="pkg-temp/docs/" />
1883                        <copy file="installer/resources/start.ico" todir="pkg-temp/docs/" />
1884                        <copy file="installer/resources/console.ico" todir="pkg-temp/docs/" />
1885                        <!-- HTTP Header files, english only,
1886                                if you need a different lang do it in a seperate target -->
1887                        <copy todir="pkg-temp/docs/" >
1888                                <fileset dir="installer/resources/proxy/"  includes="**-header.ht" />
1889                        </copy>
1890                        <!-- Theme light only -->
1891                        <copy todir="pkg-temp/docs/themes/console/light/" overwrite="true" >
1892                                <fileset dir="installer/resources/themes/console/light/" includes="**.css" />
1893                        </copy>
1894                        <copy file="installer/resources/themes/console/light/console_big.css" todir="portable/docs/themes/console/light/" />
1895                        <copy todir="pkg-temp/docs/themes/console/images/" >
1896                                <fileset dir="installer/resources/themes/console/images/" />
1897                        </copy>
1898                        <!-- FLAGs for language icon (not for ip)-->
1899                        <copy todir="pkg-temp/docs/icons/flags" >
1900                                <fileset dir="installer/resources/icons/flags/" includes="cn.png,de.png,fr.png,nl.png,ru.png,se.png,us.png" />
1901                        </copy>
1902                <mkdir dir="pkg-temp/webapps" />
1903                        <copy todir="pkg-temp/webapps/">
1904                                <fileset dir="build/" includes="**.war" />
1905                        </copy>
1906                <mkdir dir="pkg-temp/lib" />
1907                        <copy todir ="pkg-temp/lib/" >
1908                                <fileset dir="build/" includes="**.jar" />
1909                        </copy>
1910                        <!-- 3rd party jars from apps/  -->
1911                                <!-- jrobin - without jobin , you lost graph and get a lot error entry in logs -->
1912                        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
1913        </target>
1914<!-- *3* os dependent procedure/commands -->
1915        <target name = "preppkg-portable-win32" depends="preppkg-portable-win32-jbigi,preppkg-portable-basic">
1916                        <!-- systray4.j  - why do we need trayicons for portable version ? dependency hardcoded in console -->
1917                <copy file="apps/systray/java/lib/systray4j.dll" todir="pkg-temp/lib" />
1918                <copy file="apps/systray/java/lib/systray4j.jar" todir="pkg-temp/lib" />
1919                        <!--wrapper - dont even think about it. i2p cosumes appreantly more mem without it on win32-->
1920                <copy file="installer/lib/wrapper/win32/wrapper.dll" todir="pkg-temp/lib" />
1921                <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
1922                <copy file="installer/lib/wrapper/win32/I2Psvc.exe" tofile="pkg-temp/i2psvc.ex_" />
1923                        <!--  copy the unpack/start batchfiles -->
1924                <copy todir="pkg-temp">
1925                        <fileset dir="installer/resources/portable/win32/" />
1926                </copy>
1927        </target>
1928<!-- *4* command for windows package -->
1929        <target name = "pkg-portable-win32"     depends="preppkg-portable-win32, pack200" >
1930                <!-- i need the portable\ folder in .zip so basedir is set to . -->
1931                <move file="pkg-temp" tofile="portable"/>
1932                <zip destfile="portable-win32.zip" basedir="." level="9" includes="portable\**" />
1933                <checksum file="portable-win32.zip" forceOverwrite="yes"/>
1934                <move file="portable" tofile="pkg-temp"/>
1935        </target>
1936</project>
Note: See TracBrowser for help on using the repository browser.