source: build.xml @ 7c00a51

Last change on this file since 7c00a51 was 7c00a51, checked in by zzz <zzz@…>, 6 years ago

Build: Honor require.gettext=false for i2prouter translations

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