source: build.xml @ d27d0603

Last change on this file since d27d0603 was fda6730, checked in by zzz <zzz@…>, 3 years ago

Addressbook build changes (ticket #1966):

  • Build as jar, not war
  • Put empty war in updater
  • Move Servlet starter to SusiDNS
  • Skip war in RouterConsoleRunner?
  • Property mode set to 100644
File size: 129.8 KB
RevLine 
[5f18cec]1<?xml version="1.0" encoding="ISO-8859-1"?>
[9a91443]2<project basedir="." default="all" name="i2p"
3    xmlns:artifact="antlib:org.apache.maven.artifact.ant">
[370be48]4
[aba655a]5    <!-- Include property files so that values can be easily overridden.
6         Users should create an override.properties file to make changes.
7     -->
[255ccdc]8    <property file="override.properties"/>
9    <property file="build.properties"/>
[6623616]10
[157b85b]11    <!-- You probably don't want to change anything from here down -->
[b4d83b1]12    <target name="help" depends="all" />
[77bd69c]13    <target name="all" >
14        <echo message="Useful targets: " />
[6a103a1]15        <echo message="  pkg:       distclean then package everything up (updater, installer)" />
[9500a55]16        <echo message="  dist:      pkg and javadoc" />
[6a103a1]17        <echo message="  dist200:   pkg, updater200, and javadoc" />
[44c54ec]18        <echo message="  installer: build the GUI installer" />
[a29fd1e]19        <echo message="  installer-freebsd: build the GUI installer (FreeBSD only)" />
20        <echo message="  installer-linux: build the GUI installer (Linux only)" />
21        <echo message="  installer-osx: build the GUI installer (OSX only)" />
22        <echo message="  installer-windows: build the GUI installer (Windows only)" />
[6a103a1]23        <echo message="  installer-nowindows: build the GUI installer (all but Windows)" />
[44c54ec]24        <echo message="  tarball:   tar the full install into i2p.tar.bz2 (extracts to build a new clean install)" />
[10f674a]25        <echo message="  updater:   Package the built files in i2pupdate.zip (extracts safely over existing installs)" />
26        <echo message="  updater200: Updater compressed with pack200 (creates i2pupdate200.zip, 60% smaller)" />
[6dc3cd9]27        <echo message="  signed-updater200: Signed updater compressed with pack200 (creates i2pupdate.su3, 60% smaller)" />
[ff828e6]28        <echo message="  updaterWithJavadoc: updater including the javadocs, for display in the console" />
[0874b3e]29        <echo message="  updater200WithJavadoc: updater including the javadocs, for display in the console (creates i2pupdate200.zip)" />
[6dc3cd9]30        <echo message="  signed-updater200WithJavadoc: Signed updater including the javadocs, for display in the console (creates i2pupdate.su3)" />
[5376858]31        <echo message="  updaterWithJavadocAndJetty: updater including the javadocs, for display in the console, and Jetty " />
32        <echo message="  updater200WithJavadocAndJetty: updater including the javadocs, for display in the console, and Jetty (creates i2pupdate200.zip)" />
[6dc3cd9]33        <echo message="  signed-updater200WithJavadocAndJetty: Signed updater including the javadocs, for display in the console, and Jetty (creates i2pupdate.su3)" />
[10f674a]34        <echo message="  updaterWithJetty: Updater including Jetty" />
[5a4becb]35        <echo message="  updater200withJetty: Updater including Jetty" />
[6dc3cd9]36        <echo message="  updater200withJetty: Updater including Jetty" />
37        <echo message="  signed-updater200withJetty: Signed updater including Jetty" />
[89f0f09]38        <echo message="  updaterWithJettyFixes: updater including local jetty patches" />
[3ba43a77]39        <echo message="  updaterWithGeoIP: updater including GeoIP Files" />
[dcaa059]40        <echo message="  updaterWithJettyFixesAndGeoIP" />
[2f10cca]41        <echo message="  updaterWithJettyFixesAndJbigi" />
[13d3730]42        <echo message="  updaterWithJbigi" />
43        <echo message="  updater200WithJbigi" />
[74e5ea6]44        <echo message="  updaterSmall:   updater with the essentials only - no SAM, i2psnark, SusiMail, SusiDNS, or history.txt" />
[ffc67d1]45        <echo message="  updaterRouter:  updater with the i2p.jar and router.jar only" />
[77bd69c]46        <echo message="  distclean: clean up all derived files" />
[6a103a1]47        <!-- <echo message="  syndie:    generate a standalone syndie install" /> -->
[b434a475]48        <echo message="  desktopgui: generate a standalone desktopgui install" />
[c287bace]49        <echo message="  i2psnark:  generate a standalone i2psnark install" />
[4f548b7]50        <echo message="  justBOB:  generate a standalone BOB-one.jar" />
[6a103a1]51        <echo message="  javadoc:   generate javadoc for the entire project into ./build/javadoc and ./javadoc.zip" />
[482a63c]52        <echo message="  javadoc-test: Javadocs for unit test classes (build/javadoc-test)" />
[1f8f3eb]53        <echo message="  slackpkg:  generate Slackware package in ./Slackware/i2p" />
[28a14782]54        <echo message="  debianhowto: instructions on building Debian packages" />
[84e4558]55        <echo message="  debian: generate Debian packages in ../" />
56        <echo message="          run &quot;ant debianhowto&quot; for instructions" />
57        <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)" />
58        <!-- <echo message="  debianrepo: build a Debian repository (reprepro required)" /> -->
[56e0c3e0]59        <echo message="  poupdate: update the .po files for translators" />
[bfb74f7]60        <echo message="  pkg-portable-win32:  build a minimum portable version for win32" />
61   </target>
[28a14782]62    <target name="debianhowto">
[84e4558]63            <echo message="To build debian packages, you must make sure that you have" />
64            <echo message="the necessary build-dependencies installed." />
65            <echo message="The packages required to build can be found in the file "/>
66            <echo message="&quot;debian/control&quot; in the &quot;Build-Depends&quot; field."/>
67            <echo message="In addition to those packages, be sure to install &quot;fakeroot&quot;,"/>
68            <echo message="&quot;quilt&quot; and &quot;build-essential&quot;!" />
69            <echo message="" />
[5c8eab9]70            <echo message="The following command will install the build dependencies for you:" />
[84e4558]71            <echo message=" " />
[5c8eab9]72            <echo message="sudo apt-get install debhelper ant debconf default-jdk gettext libgmp-dev po-debconf fakeroot \" />
[ec6c244]73            <echo message="  build-essential quilt dh-apparmor dh-systemd libservice-wrapper-java \"  />
74            <echo message="  devscripts libjetty9-java libtomcat8-java glassfish-javaee libgetopt-java"  />
[5c8eab9]75            <echo message=" " />
76            <echo message="The following command will install the additional runtime dependencies:" />
77            <echo message="sudo apt-get install libecj-java geoip-database" />
[84e4558]78            <echo message=" " />
79            <echo message="Once the dependencies are installed, run &quot;ant debian&quot;"/>
80            <echo message="to patch the source and build the packages." />
[77bd69c]81    </target>
[58512b8]82
83    <macrodef name="gpgsign">
84        <attribute name="file" />
85        <sequential>
86            <delete file="@{file}.sig" quiet="true" />
87            <exec executable="gpg" failonerror="true">
88                <arg value="--default-key" />
89                <arg value="${release.gpg.keyid}" />
90                <arg value="-b" />
91                <arg value="@{file}" />
92            </exec>
93            <chmod type="file" perm="444">
94                <fileset dir="${basedir}">
95                    <include name="@{file} @{file}.sig" />
96                </fileset>
97            </chmod>
98        </sequential>
99    </macrodef>
100
[9a91443]101    <macrodef name="gpgsignasc">
102        <attribute name="file" />
103        <sequential>
104            <delete file="@{file}.asc" quiet="true" />
105            <exec executable="gpg" failonerror="true">
106                <arg value="--default-key" />
107                <arg value="${release.gpg.keyid}" />
108                <arg value="-ab" />
109                <arg value="@{file}" />
110            </exec>
111            <chmod type="file" perm="444">
112                <fileset dir="${basedir}">
113                    <include name="@{file} @{file}.asc" />
114                </fileset>
115            </chmod>
116        </sequential>
117    </macrodef>
118
[58512b8]119    <macrodef name="mktorrent">
120        <attribute name="file" />
121        <sequential>
122            <delete file="@{file}.torrent" quiet="true"/>
123            <java classname="org.klomp.snark.Storage" fork="true" failonerror="true">
124                <classpath>
125                    <pathelement location="build/i2p.jar" />
126                    <pathelement location="build/i2psnark.jar" />
127                </classpath>
[37597b8]128                <arg value="-a" />
[58512b8]129                <arg value="http://tracker2.postman.i2p/announce.php" />
[37597b8]130                <arg value="-c" />
131                <arg value="${build.built-by}" />
132                <arg value="@{file}" />
[58512b8]133            </java>
134        </sequential>
135    </macrodef>
136
137    <macrodef name="sha256sum">
138        <attribute name="file" />
139        <sequential>
140            <!--
141                 Note: "local" only works with ant 1.8+. This limitation shouldn't be
142                 a big deal since this macro is only called by the release
143                 target.
144             -->
145            <local name="file-sum"/>
146            <checksum format="MD5SUM" file="@{file}" property="file-sum" algorithm="sha-256"/>
147            <echo message="${file-sum}  @{file}" />
148        </sequential>
149    </macrodef>
150
[6dc3cd9]151    <macrodef name="sudsign">
152        <attribute name="infile" />
153        <attribute name="outfile" />
154        <sequential>
[7a49b09]155            <input message="Enter sud/su2 private signing key file:" addproperty="release.privkey" />
[6dc3cd9]156            <fail message="You must enter an existing file path." >
157                <condition>
158                    <or>
159                        <equals arg1="${release.privkey}" arg2=""/>
160                        <not>
161                            <length file="${release.privkey}" when="greater" length="0" />
162                        </not>
163                    </or>
164                </condition>
165            </fail>
166            <echo message="Key file is ${release.privkey}" />
167            <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
168                <classpath>
169                    <pathelement location="build/i2p.jar" />
170                </classpath>
171                <arg value="sign" />
172                <arg value="@{infile}" />
173                <arg value="@{outfile}" />
174                <arg value="${release.privkey}" />
175                <arg value="${release.number}" />
176            </java>
177            <echo message="Verify version and VALID signature:" />
178            <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
179                <classpath>
180                    <pathelement location="build/i2p.jar" />
181                </classpath>
182                <arg value="verifysig" />
183                <arg value="@{outfile}" />
184            </java>
185            <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
186                <classpath>
187                    <pathelement location="build/i2p.jar" />
188                </classpath>
189                <arg value="verifyversion" />
190                <arg value="@{outfile}" />
191            </java>
192            <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
193                <classpath>
194                    <pathelement location="build/i2p.jar" />
195                </classpath>
196                <arg value="showversion" />
197                <arg value="@{outfile}" />
198            </java>
199        </sequential>
200    </macrodef>
201
202    <macrodef name="su3sign">
203        <attribute name="infile" />
204        <attribute name="outfile" />
205        <attribute name="sigtype" />
[9f3d5bf]206        <attribute name="su3.ver" />
[6dc3cd9]207        <sequential>
208        <input message="Enter su3 private signing key store:" addproperty="release.privkey.su3" />
209        <fail message="You must enter an existing file path." >
210            <condition>
211                <or>
212                    <equals arg1="${release.privkey.su3}" arg2=""/>
213                    <not>
214                        <length file="${release.privkey.su3}" when="greater" length="0" />
215                    </not>
216                </or>
217            </condition>
218        </fail>
[7a49b09]219        <input message="Enter su3 key name (you@mail.i2p):" addproperty="release.signer.su3" />
[6dc3cd9]220        <fail message="You must enter a name." >
221            <condition>
222                <equals arg1="${release.signer.su3}" arg2=""/>
223            </condition>
224        </fail>
[7a49b09]225        <input message="Enter su3 key password for ${release.signer.su3}:" addproperty="release.password.su3" />
[6dc3cd9]226        <fail message="You must enter a password." >
227            <condition>
228                <equals arg1="${release.password.su3}" arg2=""/>
229            </condition>
230        </fail>
231            <java classname="net.i2p.crypto.SU3File" inputstring="${release.password.su3}" fork="true" failonerror="true">
232                <classpath>
233                    <pathelement location="build/i2p.jar" />
234                </classpath>
235                <arg value="sign" />
236                <arg value="-c" />
237                <arg value="@{sigtype}" />
238                <arg value="-t" />
239                <arg value="RSA_SHA512_4096" />
240                <arg value="@{infile}" />
241                <arg value="@{outfile}" />
242                <arg value="${release.privkey.su3}" />
[9f3d5bf]243                <arg value="@{su3.ver}" />
[6dc3cd9]244                <arg value="${release.signer.su3}" />
245            </java>
246            <echo message="Verify version and VALID signature:" />
247            <java classname="net.i2p.crypto.SU3File" fork="true" failonerror="true">
248                <classpath>
249                    <pathelement location="build/i2p.jar" />
250                </classpath>
251                <!-- set base dir so it can find the pubkey cert -->
252                <jvmarg value="-Di2p.dir.base=installer/resources" />
253                <arg value="verifysig" />
254                <arg value="@{outfile}" />
255            </java>
256            <java classname="net.i2p.crypto.SU3File" fork="true" failonerror="true">
257                <classpath>
258                    <pathelement location="build/i2p.jar" />
259                </classpath>
260                <!-- set base dir so it can find the pubkey cert -->
261                <jvmarg value="-Di2p.dir.base=installer/resources" />
262                <arg value="showversion" />
263                <arg value="@{outfile}" />
264            </java>
265        </sequential>
266    </macrodef>
[34e3909]267
[6a103a1]268    <target name="dist" depends="pkg, javadoc" />
[18f113d]269    <target name="dist200" depends="pkg200, javadoc" />
[2e72ece]270    <target name="build" depends="build2">
271        <!-- so we don't build standalone for the updater -->
[2ca0ae7]272        <!-- This builds apps/i2psnark/java/i2psnark-standalone.zip,
273          -   which we don't distribute anywhere...
[2e72ece]274        <ant dir="apps/i2psnark/java/" target="standalone" />
[2ca0ae7]275        -->
[2e72ece]276    </target>
277    <target name="build2" depends="builddep, jar, buildWEB" />
[2f72f5c]278    <target name="buildSmall" depends="builddepSmall, jarSmall, buildWEB" />
[bd78a66]279    <target name="buildclean" depends="distclean, build" />
[612d06b]280
281    <target name="builddep" depends="builddepSmall, buildBOB, buildSAM, buildSusiMail, buildSusiDNS, buildI2PSnark" />
282
[84d8683]283    <target name="builddepSmall" depends="buildrouter, buildSystray, buildDesktopGui, buildRouterConsole, buildStreaming, buildI2PTunnel, buildAddressbook" />
[612d06b]284
285    <!-- start of buildX, one for each sub-build.xml.
286         Do not put ant tasks in the sub-build.xmls anymore,
287         so the build will go faster.
288      -->
289
[9f3d5bf]290    <target name="-setepoch">
291        <script language="javascript">
292            <![CDATA[
293              property = project.setProperty("epoch",Math.floor((new Date()).getTime()/1000));
294            ]]>
295        </script>
296    </target>
297
[b8ab14b]298    <target name="buildBOB" depends="buildStreaming" >
[bb32672]299        <ant dir="apps/BOB/" target="jar" />
[4407373]300        <copy file="apps/BOB/dist/BOB.jar" todir="build/" />
[612d06b]301    </target>
302
303    <target name="buildSAM" depends="buildStreaming" >
[2f72f5c]304        <ant dir="apps/sam/java/" target="jar" />
[4407373]305        <copy file="apps/sam/java/build/sam.jar" todir="build/" />
[612d06b]306    </target>
307
308    <target name="buildSusiMail" depends="buildCore, buildJetty" >
[2f72f5c]309        <ant dir="apps/susimail/" target="war" />
[4407373]310        <copy file="apps/susimail/susimail.war" todir="build/" />
[612d06b]311    </target>
312
[fda6730]313    <target name="buildSusiDNS" depends="buildCore, buildJetty, buildImagegen, buildAddressbook" >
[2f72f5c]314        <ant dir="apps/susidns/src" target="all" />
[4407373]315        <copy file="apps/susidns/src/susidns.war" todir="build/" />
[612d06b]316    </target>
317
[5004626]318    <target name="buildImagegen" depends="buildCore, buildJetty" >
[7a49b09]319        <ant dir="apps/imagegen" target="build" />
[5004626]320        <copy file="apps/imagegen/imagegen/build/imagegen.war" todir="build/" />
321    </target>
322
[e27af37]323    <target name="buildI2PSnark" depends="buildStreaming, buildJetty, buildSystray" >
[2e72ece]324        <ant dir="apps/i2psnark/java/" target="war" />
[4407373]325        <copy file="apps/i2psnark/i2psnark.war" todir="build/" />
326        <copy file="apps/i2psnark/java/build/i2psnark.jar" todir="build/" />
[2f72f5c]327    </target>
[612d06b]328
[2c049878]329    <!-- jar (not war) for Android -->
330    <target name="buildAddressbookJar" depends="buildCore" >
331        <ant dir="apps/addressbook/" target="jar" />
[1919e36]332        <copy file="apps/addressbook/dist/addressbook.jar" todir="build/" />
[2c049878]333    </target>
334
[fda6730]335    <target name="buildAddressbook" depends="buildCore" >
336        <ant dir="apps/addressbook/" target="all" />
337        <copy file="apps/addressbook/dist/addressbook.jar" todir="build/" />
338        <!-- war is empty, only for updates -->
[4407373]339        <copy file="apps/addressbook/dist/addressbook.war" todir="build/" />
[612d06b]340    </target>
341
[1919e36]342    <!-- Both jars and no war, for Android -->
343    <target name="buildI2PTunnelJars" depends="buildStreaming" >
344        <ant dir="apps/i2ptunnel/java/" target="uiJar" />
[4407373]345        <copy file="apps/i2ptunnel/java/build/i2ptunnel.jar" todir="build/" />
[1919e36]346        <copy file="apps/i2ptunnel/java/build/i2ptunnel-ui.jar" todir="build/" />
[e4f141b]347    </target>
348
[7eed4fa]349    <target name="buildI2PTunnel" depends="buildStreaming, buildJetty, buildImagegen" >
[612d06b]350        <ant dir="apps/i2ptunnel/java/" target="build" />
[4407373]351        <copy file="apps/i2ptunnel/java/build/i2ptunnel.jar" todir="build/" />
352        <copy file="apps/i2ptunnel/java/build/i2ptunnel.war" todir="build/" />
[612d06b]353    </target>
354
[84d8683]355    <target name="buildDesktopGui" depends="buildCore, buildrouter" >
[fd91927c]356<!--
[4471567]357        <ant dir="apps/desktopgui" target="clean" />
[fd91927c]358-->
[84d8683]359        <ant dir="apps/desktopgui" target="jar" />
[4407373]360        <copy file="apps/desktopgui/dist/desktopgui.jar" todir="build/" />
[84d8683]361    </target>
362
[78acf70]363    <target name="buildRouterConsole" depends="buildrouter, buildSystray, buildDesktopGui, buildJetty, buildJrobin" >
[aeb6635]364        <ant dir="apps/routerconsole/java/" target="jar" />
[612d06b]365    </target>
366
[239fe51]367    <!-- newsxml.jar only (subset of routerconsole, no war) for Android -->
368    <target name="buildNewsXMLJar" depends="buildRouter" >
369        <ant dir="apps/routerconsole/java/" target="newsxmljar" />
370    </target>
371
[03e86fcb]372    <target name="buildJetty" depends="buildCore" >
[612d06b]373        <ant dir="apps/jetty" target="build" />
[4407373]374        <copy todir="build/" >
375            <fileset dir="apps/jetty/jettylib" excludes="ant.jar" />
376        </copy>
[612d06b]377    </target>
378
379    <target name="buildSystray" depends="buildCore" >
380        <ant dir="apps/systray/java/" target="jar" />
[4407373]381        <copy file="apps/systray/java/build/systray.jar" todir="build/" />
[612d06b]382    </target>
383
384    <target name="buildStreaming" depends="buildMinistreaming" >
[0c51f2b]385        <ant dir="apps/streaming/java/" target="jar" />
[4407373]386        <copy file="apps/streaming/java/build/streaming.jar" todir="build/" />
[77bd69c]387    </target>
[612d06b]388
389    <target name="buildMinistreaming" depends="buildCore" >
390        <ant dir="apps/ministreaming/java/" target="jar" />
[4407373]391        <copy file="apps/ministreaming/java/build/mstreaming.jar" todir="build/" />
[612d06b]392    </target>
393
394    <target name="buildRouter" depends="buildrouter" />
395    <target name="buildrouter" depends="buildCore" >
[731e26e]396        <ant dir="router/java/" target="jar" />
397        <copy file="router/java/build/router.jar" todir="build/" />
398    </target>
[612d06b]399
[fd91927c]400    <target name="buildCore" depends="buildProperties" >
[612d06b]401        <ant dir="core/java/" target="jar" />
402        <copy file="core/java/build/i2p.jar" todir="build/" />
403    </target>
404
[d7a84c88]405    <target name="buildJrobin" depends="buildCore" >
[78acf70]406        <ant dir="apps/jrobin/java/" target="jar" />
407        <copy file="apps/jrobin/java/build/jrobin.jar" todir="build/" />
[ef26acc]408    </target>
409
[4407373]410    <target name="buildProperties" depends="getMtnRev, getReleaseNumber, getBuildNumber" >
411        <!-- default if not set above -->
412        <property name="workspace.version" value="unknown" />
413        <tstamp>
414            <format property="build.timestamp" pattern="yyyy-MM-dd HH:mm:ss z" timezone="UTC" locale="en" />
415        </tstamp>
416        <property name="full.version" value="${release.number}-${i2p.build.number}${build.extra}" />
417        <echo message="Building version ${full.version} (mtn rev ${workspace.version})" />
418    </target>
419
420    <target name="buildWEB" depends="buildRouterConsole" >
421        <copy file="apps/routerconsole/java/build/routerconsole.jar" todir="build/" />
422        <copy file="apps/routerconsole/java/build/routerconsole.war" todir="build/" />
423    </target>
424
[73256f6]425    <target name="buildTools" depends="buildrouter" >
426        <ant dir="installer/tools/java" target="jar" />
427        <copy file="installer/tools/java/build/tools.jar" todir="build/" />
428    </target>
429
[4407373]430    <!-- end of sub-build.xml targets -->
431
[c5f04ee]432    <target name="checkForMtn" >
433        <available property="mtn.available" file="_MTN" type="dir" />
434    </target>
435
436    <target name="getMtnRev" depends="checkForMtn" if="mtn.available" >
[fd91927c]437        <exec executable="mtn" outputproperty="workspace.version" errorproperty="mtn.error1" failifexecutionfails="false" >
438            <arg value="automate" />
439            <arg value="get_base_revision_id" />
440        </exec>
[c5f04ee]441    </target>
442
[3396626a]443    <target name="trimMtnRev" depends="getMtnRev">
444        <script language="javascript">
445            <![CDATA[
446            var MtnRev = project.getProperty("workspace.version");
447            if (MtnRev != 'unknown' && MtnRev != null) {
448                echo = project.createTask("echo");
449                var MtnShortHash = MtnRev.substring(0,8);
450                project.setProperty("MtnShortHash", MtnShortHash);
451                echo.setMessage("Trimmed hash: " + MtnShortHash);
452                echo.perform();
453            } else {
454                project.setProperty("MtnShortHash", 'unknown');
455            }
456            ]]>
457        </script>
458    </target>
459
[18664d3]460    <target name="checkIfBumped">
461        <exec executable="mtn" outputproperty="bumped" errorproperty="mtn.error2" failifexecutionfails="false" >
462            <arg value="ls" />
463            <arg value="ch" />
464            <arg value="router/java/src/net/i2p/router/RouterVersion.java" />
465        </exec>
466        <condition property="bumped.already">
467            <not>
468                <equals arg1="${bumped}" arg2=""/>
469            </not>
470        </condition>
471    </target>
472
[e7b9a23]473    <target name="bump" depends="bumpBuild" />
[18664d3]474    <target name="bumpBuild" depends="checkIfBumped, getBuildNumber" unless="bumped.already">
475        <script language="javascript">
476            <![CDATA[
477            var newBuildNumber = (Number(project.getProperty("i2p.build.number")) + 1);
478            if (newBuildNumber != 'unknown' && newBuildNumber != null) {
479                echo = project.createTask("echo");
480                project.setProperty("new.i2p.build.number", newBuildNumber);
[e978bb8]481                echo.setMessage("Build number is now: " + newBuildNumber + project.getProperty("build.extra"));
[18664d3]482                echo.perform();
483            }
484            ]]>
485        </script>
486        <replaceregexp byline="true" file="router/java/src/net/i2p/router/RouterVersion.java"
487            match='(^\s+public\s+final\s+static\s+long\s+BUILD\s+=\s+)[0-9]+;' replace='\1${new.i2p.build.number};'/>
488    </target>
489
[7527a02]490    <condition property="noExe">
491        <not>
492            <!-- We only have launch4j binaries for the following systems -->
493            <and>
494                <or>
495                    <os arch="x86" />
496                    <os arch="i386" />
497                    <os arch="i586" />
498                    <os arch="i686" />
499                    <os arch="amd64" />
500                    <os arch="x86_64" />
501                </or>
[6fe1272]502                <or>
503                    <os name="Linux" />
504                    <os family="windows" />
505                </or>
[7527a02]506            </and>
507        </not>
508    </condition>
[fcbee9d9]509
[7527a02]510    <!-- this makes an empty build/launchi2p.jar and the build/i2p.exe for the no-wrapper windows startup, if possible -->
511    <target name="buildexe" depends="buildProperties, launch4j" unless="noExe">
[224405d7]512        <echo message="See the file &quot;build.properties&quot; if this step fails." />
[d89f589f]513        <jar destfile="./build/launchi2p.jar">
514            <manifest>
[7527a02]515                <attribute name="Main-Class" value="net.i2p.router.RouterLaunch" />
[3063e37]516                <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/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]517                <attribute name="Built-By" value="${build.built-by}" />
518                <attribute name="Build-Date" value="${build.timestamp}" />
519                <attribute name="Base-Revision" value="${workspace.version}" />
[f5838ff]520            </manifest>
[d89f589f]521        </jar>
[7527a02]522        <!-- now the standalone launcher exe -->
[d89f589f]523        <launch4j configFile="./installer/i2pstandalone.xml" />
[7527a02]524        <!-- thazzit -->
[d89f589f]525    </target>
[18119890]526
[7527a02]527    <target name="launch4j">
528        <taskdef name="launch4j"
529                 classname="net.sf.launch4j.ant.Launch4jTask"
530                 classpath="${basedir}/installer/lib/launch4j/launch4j.jar:${basedir}/installer/lib/launch4j/lib/xstream.jar" />
531     </target>
532
[4407373]533     <!--
534          the files are now copied to the build directory
535          in the build* targets
536      -->
537     <target name="jar" depends="jarSmall" />
[78acf70]538     <target name="jarSmall" depends="builddepSmall" />
[18119890]539
[f191e50]540    <!-- Custom target to collect the jars that I2P-Bote needs to compile, so it can compile from source. -->
541    <target name="jarBote" depends="buildRouter, buildStreaming, buildJetty" >
[094cf14]542        <copy file="apps/susidns/src/lib/jstl.jar" todir="build/" />
543        <copy file="apps/susidns/src/lib/standard.jar" todir="build/" />
[f191e50]544    </target>
545
[653ffbc]546    <target name="jbigi-list-changes" depends="checkForMtn" if="mtn.available">
[b03f7536]547        <exec executable="mtn" outputproperty="workspace.changes.jbigi" errorproperty="mtn.error.jbigi" failifexecutionfails="false" >
548            <arg value="list" />
549            <arg value="changed" />
550            <arg value="installer/lib/jbigi" />
551        </exec>
552        <!-- \n in an attribute value generates an invalid manifest -->
553        <exec executable="tr" inputstring="${workspace.changes.jbigi}" outputproperty="workspace.changes.jbigi.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
554            <arg value="-s" />
[f8a3afd]555            <arg value="&quot;[:space:]&quot;" />
[b03f7536]556            <arg value="," />
557        </exec>
558    </target>
559
[653ffbc]560    <target name="jbigi" depends="buildProperties, jbigi-list-changes">
[c5f04ee]561        <!-- set if unset -->
562        <property name="workspace.changes.jbigi.tr" value="" />
[8b1ab4b8]563        <mkdir dir="./build" />
[18119890]564        <jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
565            <fileset dir="installer/lib/jbigi" includes="*.so *.dll *.jnilib" />
[b03f7536]566            <manifest>
[cadedeb0]567                <attribute name="Built-By" value="${build.built-by}" />
[b03f7536]568                <attribute name="Build-Date" value="${build.timestamp}" />
569                <attribute name="Base-Revision" value="${workspace.version}" />
570                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
571            </manifest>
[18119890]572        </jar>
573    </target>
[e407c04]574
[653ffbc]575    <target name="jbigi-nowindows" depends="buildProperties, jbigi-list-changes">
[e407c04]576        <!-- set if unset -->
577        <property name="workspace.changes.jbigi.tr" value="" />
[a7870bb]578        <delete file="build/jbigi.jar" failonerror="false" quiet="true" />
[e407c04]579        <jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
580            <fileset dir="installer/lib/jbigi" includes="*.so *.jnilib" />
581            <manifest>
[cadedeb0]582                <attribute name="Built-By" value="${build.built-by}" />
[e407c04]583                <attribute name="Build-Date" value="${build.timestamp}" />
584                <attribute name="Base-Revision" value="${workspace.version}" />
585                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
586            </manifest>
587        </jar>
588    </target>
589
[a29fd1e]590    <!-- Now system-specific jbigis in alphabetical order -->
[653ffbc]591    <target name="jbigi-freebsd-only"  depends="buildProperties, jbigi-list-changes">
[c5f04ee]592        <!-- set if unset -->
593        <property name="workspace.changes.jbigi.tr" value="" />
[a29fd1e]594        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
[a8926da]595            <fileset dir="installer/lib/jbigi" includes="*bsd*.so" />
[b03f7536]596            <manifest>
[cadedeb0]597                <attribute name="Built-By" value="${build.built-by}" />
[b03f7536]598                <attribute name="Build-Date" value="${build.timestamp}" />
599                <attribute name="Base-Revision" value="${workspace.version}" />
600                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
601            </manifest>
[18119890]602        </jar>
603    </target>
604
[653ffbc]605    <target name="jbigi-linux-only"  depends="buildProperties, jbigi-list-changes">
[c5f04ee]606        <!-- set if unset -->
607        <property name="workspace.changes.jbigi.tr" value="" />
[18119890]608        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
609            <fileset dir="installer/lib/jbigi" includes="*linux*.so" />
[b03f7536]610            <manifest>
[cadedeb0]611                <attribute name="Built-By" value="${build.built-by}" />
[b03f7536]612                <attribute name="Build-Date" value="${build.timestamp}" />
613                <attribute name="Base-Revision" value="${workspace.version}" />
614                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
615            </manifest>
[18119890]616        </jar>
617    </target>
618
[653ffbc]619    <target name="jbigi-linux-x86-only"  depends="buildProperties, jbigi-list-changes">
620        <!-- set if unset -->
621        <property name="workspace.changes.jbigi.tr" value="" />
622        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
623            <fileset dir="installer/lib/jbigi" includes="*linux*.so" excludes="*linux-arm*.so,*linux-ppc*.so" />
624            <manifest>
625                <attribute name="Built-By" value="${build.built-by}" />
626                <attribute name="Build-Date" value="${build.timestamp}" />
627                <attribute name="Base-Revision" value="${workspace.version}" />
628                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
629            </manifest>
630        </jar>
631    </target>
632
633
634    <target name="jbigi-linux-nonx86-only"  depends="buildProperties, jbigi-list-changes">
[a29fd1e]635        <!-- set if unset -->
636        <property name="workspace.changes.jbigi.tr" value="" />
637        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
638            <fileset dir="installer/lib/jbigi" includes="*linux-arm*.so,*linux-ppc*.so" />
639            <manifest>
[cadedeb0]640                <attribute name="Built-By" value="${build.built-by}" />
[a29fd1e]641                <attribute name="Build-Date" value="${build.timestamp}" />
642                <attribute name="Base-Revision" value="${workspace.version}" />
643                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
644            </manifest>
645        </jar>
646    </target>
647
[3a70a5a6]648    <target name="jbigi-osx-only"  depends="buildProperties, jbigi-list-changes" >
649        <!-- set if unset -->
650        <property name="workspace.changes.jbigi.tr" value="" />
651        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
652            <fileset dir="installer/lib/jbigi" includes="*.jnilib" />
653            <manifest>
[cadedeb0]654                <attribute name="Built-By" value="${build.built-by}" />
[3a70a5a6]655                <attribute name="Build-Date" value="${build.timestamp}" />
656                <attribute name="Base-Revision" value="${workspace.version}" />
657                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
658            </manifest>
659        </jar>
660    </target>
661
[a29fd1e]662    <target name="jbigi-windows-only" depends="buildProperties, jbigi-list-changes" >
663        <!-- set if unset -->
664        <property name="workspace.changes.jbigi.tr" value="" />
[a7870bb]665        <delete file="build/jbigi.jar" failonerror="false" quiet="true" />
[a29fd1e]666        <jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
667            <fileset dir="installer/lib/jbigi" includes="*windows*.dll" />
668            <manifest>
[cadedeb0]669                <attribute name="Built-By" value="${build.built-by}" />
[a29fd1e]670                <attribute name="Build-Date" value="${build.timestamp}" />
671                <attribute name="Base-Revision" value="${workspace.version}" />
672                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
673            </manifest>
674        </jar>
675    </target>
[3a70a5a6]676
[10f674a]677    <!-- the apps need to compile the jsps to poupdate -->
[17b781c1]678    <target name="poupdate" depends="buildRouter, buildStreaming, buildSystray, buildJetty, buildDesktopGui, buildJrobin" >
[5beb739]679        <echo message="Setting environment variable LG2 to a lang code (eg: de,zh,nl etc)" />
680        <echo message=" will restrict language update to the language you specified, leaving other language untact." />
[c1210b1]681        <ant dir="apps/routerconsole/java/" >
682            <target name="poupdate" />
683            <target name="poupdate-news" />
[3ec6028]684            <target name="poupdate-countries" />
[c1210b1]685        </ant>
[df7029d]686        <ant dir="apps/i2psnark/java/" target="poupdate" />
[71038c3]687        <ant dir="apps/i2ptunnel/java/" >
688            <target name="poupdate" />
689            <target name="poupdate-proxy" />
690        </ant>
[1436263]691        <ant dir="apps/susidns/src/" target="poupdate" />
[a5b5572]692        <ant dir="apps/susimail/" target="poupdate" />
[84d8683]693        <ant dir="apps/desktopgui" target="poupdate" />
[ba5be74]694        <ant dir="installer/resources/locale" target="poupdate" />
[c7c087d]695        <ant dir="apps/ministreaming/java" target="poupdate" />
[ba5be74]696    </target>
697
[7c00a51]698    <condition property="no.bundle">
699        <isfalse value="${require.gettext}" />
700    </condition>
701
702    <target name="prep-script-translation" unless="no.bundle" >
[9a241af]703        <!-- script translation added in 0.8.13, enabled in 0.9.5. -->
[ba5be74]704        <ant dir="installer/resources/locale" target="bundle" />
705        <copy todir="pkg-temp/locale/">
706            <fileset dir="installer/resources/locale/mo/" />
707        </copy>
[56e0c3e0]708    </target>
[c655d23]709
710    <target name="javadoc" depends="getReleaseNumber, getBuildNumber" >
[635b53c]711        <ant dir="apps/jetty" target="ensureJettylib" />
[77bd69c]712        <mkdir dir="./build" />
713        <mkdir dir="./build/javadoc" />
[370be48]714        <javadoc access="package"
715            destdir="./build/javadoc"
716            packagenames="*"
717            use="true"
718            splitindex="true"
[49104134]719            failonerror="true"
[51c73fa]720            doctitle="I2P Javadocs for Release ${release.number} Build ${i2p.build.number}${build.extra}"
[31ff9b2]721            windowtitle="I2P Anonymous Network - Java Documentation - Version ${release.number}">
[40c4a42]722            <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.*:org.apache.http.conn.ssl:org.apache.http.conn.util:org.apache.http.util" />
[4dc1241d]723            <group title="Streaming Library" packages="net.i2p.client.streaming:net.i2p.client.streaming.impl" />
[169fd56]724            <group title="Router" packages="net.i2p.router:net.i2p.router.*:net.i2p.data.i2np:net.i2p.data.router:org.cybergarage:org.cybergarage.*:org.freenetproject:org.xlattice.crypto.filters:com.maxmind.geoip" />
[239fe51]725            <group title="Router Console" packages="net.i2p.router.web:net.i2p.router.update:net.i2p.router.news" />
[19fd865]726            <!-- apps and bridges starting here, alphabetical please -->
[895c9a33]727            <group title="Addressbook Application" packages="net.i2p.addressbook" />
728            <group title="BOB Bridge" packages="net.i2p.BOB" />
[482a63c]729            <group title="BOB Demos" packages="net.i2p.BOB.Demos.echo.echoclient:net.i2p.BOB.Demos.echo.echoserver" />
[95eabfa]730            <group title="Desktopgui Application" packages="net.i2p.desktopgui:net.i2p.desktopgui.*" />
[796a231]731            <group title="I2PSnark Application" packages="org.klomp.snark:org.klomp.snark.*" />
[895c9a33]732            <group title="I2PTunnel Application" packages="net.i2p.i2ptunnel:net.i2p.i2ptunnel.*" />
[5004626]733            <group title="Imagegen Application" packages="com.docuverse.identicon:com.google.zxing:com.google.zxing.*:net.i2p.imagegen" />
[667393e]734            <group title="Installer Utilities" packages="net.i2p.installer" />
[7f472e4e]735            <group title="Jetty Utilities" packages="net.i2p.jetty:net.i2p.servlet:net.i2p.servlet.*:org.mortbay.servlet:org.mortbay.util" />
[0439206]736            <group title="JRobin Library" packages="org.jrobin:org.jrobin.*:engine.misc" />
[c902d4c]737            <group title="SAM Bridge" packages="net.i2p.sam" />
[482a63c]738            <group title="SAM Demos" packages="net.i2p.sam.client" />
[fda6730]739            <group title="SusiDNS Application" packages="i2p.susi.dns:net.i2p.addressbook.servlet" />
[7f472e4e]740            <group title="SusiMail Application" packages="i2p.susi.webmail:i2p.susi.webmail.*:i2p.susi.debug:i2p.susi.util" />
[895c9a33]741            <group title="Systray Application" packages="net.i2p.apps.systray" />
[44c54ec]742            <sourcepath>
743                <pathelement location="core/java/src" />
744                <pathelement location="router/java/src" />
745                <pathelement location="apps/ministreaming/java/src" />
[0c51f2b]746                <pathelement location="apps/streaming/java/src" />
[44c54ec]747                <pathelement location="apps/i2ptunnel/java/src" />
748                <pathelement location="apps/systray/java/src" />
[84d8683]749                <pathelement location="apps/desktopgui/src" />
[44c54ec]750                <pathelement location="apps/routerconsole/java/src" />
[093c696]751                <pathelement location="apps/addressbook/java/src" />
752                <pathelement location="apps/i2psnark/java/src" />
753                <pathelement location="apps/sam/java/src" />
[bb32672]754                <pathelement location="apps/BOB/src" />
[482a63c]755                <pathelement location="apps/BOB/Demos/echo/echoclient/src" />
756                <pathelement location="apps/BOB/Demos/echo/echoserver/src" />
[895c9a33]757                <pathelement location="apps/susidns/src/java/src" />
758                <pathelement location="apps/susimail/src/src" />
[92b9d0a]759                <pathelement location="apps/jetty/java/src" />
[5004626]760                <pathelement location="apps/imagegen/imagegen/webapp/src/main/java" />
761                <pathelement location="apps/imagegen/identicon/core/src/main/java" />
762                <pathelement location="apps/imagegen/zxing/core/src/main/java" />
763                <pathelement location="apps/imagegen/zxing/javase/src/main/java" />
[78acf70]764                <pathelement location="apps/jrobin/java/src" />
[667393e]765                <pathelement location="installer/java/src" />
[44c54ec]766            </sourcepath>
767            <classpath>
768                <pathelement location="apps/jetty/jettylib/org.mortbay.jetty.jar" />
[b57d7c6]769                <pathelement location="apps/jetty/jettylib/jasper-runtime.jar" />
[e103f33]770                <pathelement location="apps/jetty/jettylib/javax.servlet.jar" />
[f59ea79]771                <pathelement location="apps/jetty/jettylib/jetty-http.jar" />
772                <pathelement location="apps/jetty/jettylib/jetty-security.jar" />
773                <pathelement location="apps/jetty/jettylib/jetty-servlet.jar" />
[92b9d0a]774                <pathelement location="apps/jetty/jettylib/jetty-start.jar" />
775                <pathelement location="apps/jetty/jettylib/jetty-util.jar" />
[f59ea79]776                <pathelement location="apps/jetty/jettylib/jetty-webapp.jar" />
777                <pathelement location="apps/jetty/jettylib/jetty-xml.jar" />
[ef26acc]778                <pathelement location="apps/jrobin/jrobin-1.5.9.1.jar" />
[b2e8d3c]779                <pathelement location="installer/lib/wrapper/all/wrapper.jar" />
[bb468ad3]780                <!-- following are only for debian builds -->
781                <pathelement location="core/java/build/libintl.jar" />
782                <pathelement location="core/java/build/gnu-getopt.jar" />
[44c54ec]783            </classpath>
[58512b8]784            <!-- These variables are stored in build.properties.
785                  End-users can override by creating the file override.properties -->
[255ccdc]786            <link offline="true" href="${javasedocs.url}" packagelistLoc="installer/resources/package-lists/java/" />
[667393e]787            <link offline="true" href="${javaeedocs.url}" packagelistLoc="installer/resources/package-lists/javaee/" />
[255ccdc]788            <link offline="true" href="${jettydocs.url}" packagelistLoc="installer/resources/package-lists/jetty/" />
789            <link offline="true" href="${wrapperdocs.url}" packagelistLoc="installer/resources/package-lists/wrapper/" />
[44c54ec]790        </javadoc>
[19fd865]791        <echo message="Warning, javadoc embeds timestamps in the output, run with 'TZ=UTC ant javadoc' if you plan to distribute" />
[58512b8]792    </target>
[e2f048b]793
[58512b8]794    <target name="javadoc-zip" depends="javadoc">
795        <zip destfile="javadoc.zip" basedir="build" level="9" includes="javadoc\**" />
[482a63c]796    </target>
797
798    <target name="javadoc-test" depends="buildRouter, javadoc" >
799        <mkdir dir="./build" />
800        <mkdir dir="./build/javadoc-test" />
[a02f931]801
802        <!-- set junit home to the old default unless overridden elsewhere -->
803        <property name="junit.home" value="${ant.home}/lib/" />
[482a63c]804        <javadoc access="package"
805            destdir="./build/javadoc-test"
806            packagenames="*"
807            use="true"
808            splitindex="true"
[51c73fa]809            doctitle="I2P Unit Test Javadocs for Release ${release.number} Build ${i2p.build.number}${build.extra}"
[482a63c]810            windowtitle="I2P Anonymous Network - Java Documentation - Version ${release.number}">
[5ffefd2]811            <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]812            <group title="Router" packages="net.i2p.router:net.i2p.router.*:net.i2p.data.i2np:org.cybergarage.*:org.freenetproject:org.xlattice.crypto.filters" />
[482a63c]813            <sourcepath>
[e1525d9]814                <pathelement location="core/java/test/junit" />
815                <pathelement location="router/java/test/junit" />
[a02f931]816                <pathelement location="core/java/test/scalatest" />
[482a63c]817            </sourcepath>
818            <classpath>
819                <pathelement location="build/i2p.jar" />
820                <pathelement location="build/router.jar" />
[a02f931]821                <pathelement location="${junit.home}/junit4.jar" />
[0773a30]822                <pathelement location="${hamcrest.home}/hamcrest-all.jar" />
[482a63c]823            </classpath>
[58512b8]824            <!--
825                 These variables are stored in build.properties.
826                 End-users can override by creating the file override.properties
827            -->
[482a63c]828            <link offline="true" href="${javasedocs.url}" packagelistLoc="installer/resources/package-lists/java/" />
829            <link offline="true" href="${junitdocs.url}" packagelistLoc="installer/resources/package-lists/junit/" />
830            <link offline="true" href="${i2pdocs.url}" packagelistLoc="build/javadoc/" />
831        </javadoc>
832        <echo message="Warning, javadoc embeds timestamps in the output, run with 'TZ=UTC ant javadoc' if you plan to distribute" />
[77bd69c]833    </target>
[19fd865]834
[406bcbe]835    <target name="getReleaseNumber">
836        <loadfile srcfile="core/java/src/net/i2p/CoreVersion.java" property="release.number">
837            <filterchain>
838                <linecontains>
839                    <contains value="public final static String VERSION"/>
840                </linecontains>
841                <tokenfilter>
[16be8deb]842                    <replaceregex pattern='.*"([^"]+)";' replace="\1" flags="gi" />
[406bcbe]843                </tokenfilter>
[dfcf1c1]844                <striplinebreaks/>
[406bcbe]845                <trim/>
846            </filterchain>
847        </loadfile>
[256b0553]848        <property name="release.number" value="unknown" />
[c655d23]849        <echo message="Release number is ${release.number}" />
850    </target>
851
[406bcbe]852    <target name="getBuildNumber">
853        <loadfile srcfile="router/java/src/net/i2p/router/RouterVersion.java" property="i2p.build.number">
854            <filterchain>
855                <linecontains>
856                    <contains value="public final static long BUILD" />
857                </linecontains>
858                <tokenfilter>
[85fda3e]859                    <replaceregex pattern=".*=\s+([0-9]+);" replace="\1" flags="gi" />
[406bcbe]860                </tokenfilter>
861                <trim/>
[16be8deb]862                <striplinebreaks/>
[406bcbe]863            </filterchain>
864        </loadfile>
865        <loadfile srcfile="router/java/src/net/i2p/router/RouterVersion.java" property="build.extra">
866            <filterchain>
867                <linecontains>
868                    <contains value="public final static String EXTRA" />
869                </linecontains>
870                <tokenfilter>
[16be8deb]871                    <replaceregex pattern='.*"(.*)";' replace="\1" flags="gi" />
[406bcbe]872                </tokenfilter>
873                <trim/>
[16be8deb]874                <striplinebreaks/>
[406bcbe]875            </filterchain>
876        </loadfile>
[51c73fa]877        <property name="i2p.build.number" value="??" />
[256b0553]878        <property name="build.extra" value="" />
[51c73fa]879        <echo message="Build number is ${i2p.build.number}${build.extra}" />
[c655d23]880    </target>
881
[256b0553]882    <target name="verifyReleaseBuildNumbers" depends="getReleaseNumber, getBuildNumber" >
[cf41068]883        <echo message="SDK: ${java.vendor} ${java.version} (${java.runtime.name} ${java.runtime.version})" />
[256b0553]884        <fail message="Bad release number: ${release.number}" >
885            <condition>
886                <or>
887                    <equals arg1="${release.number}" arg2="unknown"/>
888                    <equals arg1="${release.number}" arg2=""/>
889                </or>
890            </condition>
891        </fail>
[51c73fa]892        <fail message="Non-zero build number: ${i2p.build.number}" >
[256b0553]893            <condition>
894                <not>
[51c73fa]895                    <equals arg1="${i2p.build.number}" arg2="0"/>
[256b0553]896                </not>
897            </condition>
898        </fail>
899        <fail message="Non-empty extra build: ${build.extra}" >
900            <condition>
901                <not>
902                    <equals arg1="${build.extra}" arg2=""/>
903                </not>
904            </condition>
905        </fail>
906    </target>
907
[34e3909]908    <target name="-pre-sign">
909            <!-- if you're distributing su3 files to others, at a minimum you should set these -->
[679fe9b]910            <fail message="javac.compilerargs must contain a -bootclasspath option in override.properties">
911                <condition>
912                    <not><contains string="${javac.compilerargs}" substring="-bootclasspath"/></not>
913                </condition>
914            </fail>
[df0aceb]915            <fail message="javac.compilerargs7 must contain a -bootclasspath option in override.properties">
916                <condition>
917                    <not><contains string="${javac.compilerargs7}" substring="-bootclasspath"/></not>
[679fe9b]918                </condition>
919            </fail>
920            <fail message="build.built-by must be set in override.properties">
921                <condition>
922                    <equals arg1="${build.built-by}" arg2="unknown"/>
923                </condition>
924            </fail>
925            <fail message="require.gettext must be true">
926                <condition>
927                    <not><equals arg1="${require.gettext}" arg2="true"/></not>
928                </condition>
929            </fail>
[34e3909]930    </target>
931
932    <target name="-pre-release" depends="-pre-sign">
[4f12e81]933            <echo message="================================================================" />
934            <echo message="Did you update these files?" />
935            <exec executable="ls" failonerror="true">
936                    <arg value="-l" />
937                    <arg value="history.txt" />
938                    <arg value="installer/install.xml" />
939                    <arg value="core/java/src/net/i2p/CoreVersion.java" />
940                    <arg value="router/java/src/net/i2p/router/RouterVersion.java" />
941            </exec>
942            <echo message="Everything is checked in, right? Let's be sure:" />
943            <exec executable="mtn" failonerror="true">
944                    <arg value="st" />
945            </exec>
946            <echo message="If there are any modified files above, stop now!" />
947            <echo message="================================================================" />
948            <sleep seconds="3"/>
949    </target>
950
[62d6709]951    <target name="clean" depends="pkgclean" >
[77bd69c]952        <delete dir="./build" />
[b7c10d2]953        <delete dir="./reports" />
954        <delete file="installer/lib/izpack/patches.jar" failonerror="false" quiet="true" />
[c96965d]955        <delete file="syndie-standalone.zip" failonerror="false" quiet="true" />
[c287bace]956        <delete file="i2psnark-standalone.zip" failonerror="false" quiet="true" />
[b7c10d2]957        <delete file="BOB-one.jar" failonerror="false" quiet="true" />
[f788ef9]958        <delete file="core/java/cobertura.ser"/>
[ab612d0]959        <delete file="javadoc.zip" />
960        <delete file="i2p.fba" />
961        <delete file="${sloccount.report.file}" />
[9a91443]962        <delete file="mavencentral-i2p.jar" />
[e744793]963        <delete file="mavencentral-router.jar" />
[9a91443]964        <delete file="mavencentral-mstreaming.jar" />
965        <delete file="mavencentral-streaming.jar" />
[f1e36f7]966    </target>
[fcbee9d9]967
[f1e36f7]968    <target name="distclean" depends="clean">
[ab612d0]969        <delete failonerror="false" quiet="true">
[58512b8]970            <fileset dir="." includes="i2pinstall* *.deb i2p_*.bz2 i2pupdate* i2psource* *.sig *.torrent" />
[d64a2b0]971        </delete>
[77bd69c]972        <ant dir="core/java/" target="distclean" />
973        <ant dir="router/java/" target="distclean" />
[4389f27]974        <ant dir="installer/java" target="distclean" />
[77bd69c]975        <ant dir="apps/ministreaming/java/" target="distclean" />
[0c51f2b]976        <ant dir="apps/streaming/java/" target="distclean" />
[77bd69c]977        <ant dir="apps/i2ptunnel/java/" target="distclean" />
[4d0b3b2]978        <ant dir="apps/sam/java/" target="distclean" />
[bb32672]979        <ant dir="apps/BOB" target="clean" />
[84d8683]980        <ant dir="apps/desktopgui" target="clean" />
[bd78a66]981        <ant dir="apps/routerconsole/java/" target="distclean" />
[099f6a8]982        <ant dir="apps/addressbook/" target="distclean" />
[aa3a44c4]983        <ant dir="apps/susimail/" target="distclean" />
[d89f589f]984        <ant dir="apps/susidns/src/" target="distclean" />
[d70c22d7]985        <ant dir="apps/systray/java/" target="distclean" />
[aa5f1cb]986        <ant dir="apps/i2psnark/java/" target="distclean" />
[1e32170]987        <ant dir="apps/jetty/" target="distclean" />
[b95f30b]988        <ant dir="apps/imagegen/" target="distclean" />
[78acf70]989        <ant dir="apps/jrobin/java" target="distclean" />
[b7c10d2]990        <delete dir="core/c/jbigi/bin" />
991        <delete dir="core/c/jbigi/lib" />
992        <delete dir="core/c/jcpuid/lib" />
[ba5be74]993        <ant dir="installer/resources/locale" target="distclean" />
[b95f30b]994        <ant dir="installer/tools/java" target="distclean" />
[370be48]995        <!--
[25fc649]996                NOTE! We need to turn off the default excludes for these
[370be48]997                patterns to work.
[25fc649]998                These are the defaultexcludes in Ant as seen on
999                http://ant.apache.org/manual/CoreTasks/defaultexcludes.html
1000                     **/*~
1001                     **/#*#
1002                     **/.#*
1003                     **/%*%
1004                     **/._*
1005                     **/CVS
1006                     **/CVS/**
1007                     **/.cvsignore
1008                     **/SCCS
1009                     **/SCCS/**
1010                     **/vssver.scc
1011                     **/.svn
1012                     **/.svn/**
1013                     **/.DS_Store
1014                The only recourse is to remove the offending ones.
1015                We do this here, as we only need one change, and then put it
1016                back after we are done with it.
1017        -->
1018        <defaultexcludes remove="**/*~"/>
1019
[eec29f5]1020        <delete>
[b97197c]1021            <fileset dir="." includes="**/*.class **/*.java~ **/*.txt~ **/*.xml~ **/*.sh~ **/*.SlackBuild~" />
[370be48]1022            <!--
[25fc649]1023                Less common, but they pollute my workspace here, so we
1024                might as well nuke these as well. Are there any others?
1025               
1026                !!??? Why don't we just nuke "**/*~" ???!!
1027
1028                ++Sponge
1029            -->
[eec29f5]1030        </delete>
[25fc649]1031        <!--
1032                Now we put the defaults back
1033        -->
1034        <defaultexcludes default="true"/>
[77bd69c]1035    </target>
[a821ea2]1036
[3024b3f]1037    <target name="webappDistclean">
1038        <ant dir="apps/i2ptunnel/java/" target="distclean" />
1039        <ant dir="apps/routerconsole/java/" target="distclean" />
1040        <ant dir="apps/addressbook/" target="distclean" />
1041        <ant dir="apps/susimail/" target="distclean" />
1042        <ant dir="apps/susidns/src/" target="distclean" />
1043        <ant dir="apps/i2psnark/java/" target="distclean" />
[b95f30b]1044        <ant dir="apps/imagegen/" target="distclean" />
[3024b3f]1045    </target>
1046
[24264548]1047    <target name="pkg" depends="distclean, updater, preppkg, installer" />
[a821ea2]1048
[18f113d]1049    <target name="pkg200" depends="distclean, updater200, preppkg, installer" />
1050
[06a3417]1051    <target name="pkgclean" depends="deletepkg-temp">
[3cf3636]1052        <delete>
[ac79049]1053            <fileset dir="." includes="i2p.tar.bz2 install.jar i2pupdate.zip i2pupdate200.zip" />
[3cf3636]1054        </delete>
1055    </target>
[a821ea2]1056
[a29fd1e]1057    <target name="preppkg" depends="preppkg-linux, preppkg-freebsd, preppkg-osx, preppkg-windows, jbigi">
[a821ea2]1058        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
[8c880b2]1059        <copy todir="pkg-temp/lib/wrapper/solaris/">
[047c668]1060            <fileset dir="installer/lib/wrapper/solaris/" excludes="*.txt" />
[8c880b2]1061        </copy>
[cdafab27]1062     <!-- Force using the new wrapper.jar.
1063          The new jar with the old windows binaries will output a warning on windows.
1064          We do not generate release files from this target.
1065          See preppkg-windows-only target below.
1066      -->
1067        <copy overwrite="true" file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
[8c880b2]1068    </target>
1069
[e407c04]1070    <target name="preppkg-nowindows" depends="preppkg-linux, preppkg-freebsd, preppkg-osx, jbigi-nowindows">
1071        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
1072        <copy todir="pkg-temp/lib/wrapper/solaris/">
[047c668]1073            <fileset dir="installer/lib/wrapper/solaris/" excludes="*.txt" />
[e407c04]1074        </copy>
[c4a05ec4]1075        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
[e407c04]1076    </target>
1077
[65504e8]1078    <target name="preppkgRepack" depends="preppkg-linux, preppkg-freebsd, preppkg-osx, preppkg-windows, jbigi">
1079        <ant target="repack200" />
1080        <!-- no use doing repack200 on jbigi.jar -->
1081        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
1082        <copy todir="pkg-temp/lib/wrapper/solaris/">
[047c668]1083            <fileset dir="installer/lib/wrapper/solaris/" excludes="*.txt" />
[65504e8]1084        </copy>
1085    </target>
1086
[a29fd1e]1087    <target name="preppkg-freebsd" depends="preppkg-unix">
1088        <copy todir="pkg-temp/lib/wrapper/freebsd/">
[047c668]1089            <fileset dir="installer/lib/wrapper/freebsd/" excludes="*.txt" />
[a821ea2]1090        </copy>
[a29fd1e]1091        <copy todir="pkg-temp/lib/wrapper/freebsd64/">
[047c668]1092            <fileset dir="installer/lib/wrapper/freebsd64" excludes="*.txt" />
[162c5bc]1093        </copy>
[a821ea2]1094    </target>
1095
[a29fd1e]1096    <target name="preppkg-freebsd-only" depends="preppkg-freebsd, jbigi-freebsd-only" >
1097        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
1098        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
1099    </target>
1100
[d608f45]1101    <!-- only what is needed for debian, etc. -->
[18119890]1102    <target name="preppkg-linux-only" depends="preppkg-linux, jbigi-linux-only" >
1103        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
[b03f7536]1104        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
[d608f45]1105    </target>
1106
[e2f048b]1107    <!-- This is the target called by debian/rules -->
[ba5be74]1108    <target name="preppkg-unix" depends="preppkg-base, prep-script-translation" >
[8c880b2]1109        <copy file="installer/resources/runplain.sh" todir="pkg-temp/" />
1110        <copy file="installer/resources/eepget" todir="pkg-temp/" />
1111        <copy file="installer/resources/i2prouter" todir="pkg-temp/" />
1112        <copy file="installer/resources/osid" todir="pkg-temp/" />
1113        <copy file="installer/resources/postinstall.sh" todir="pkg-temp/" />
[ff828e6]1114        <copy todir="pkg-temp/man/">
1115            <fileset dir="installer/resources/man/" />
1116        </copy>
[a29fd1e]1117    </target>
1118
[9c0c733]1119    <target name="preppkg-linux" depends="preppkg-linux-x86,preppkg-linux-nonx86" />
1120
1121    <target name="preppkg-linux-x86" depends="preppkg-unix">
[8c880b2]1122        <copy todir="pkg-temp/lib/wrapper/linux/">
[047c668]1123            <fileset dir="installer/lib/wrapper/linux/" excludes="*.txt" />
[8c880b2]1124        </copy>
1125        <copy todir="pkg-temp/lib/wrapper/linux64/">
[047c668]1126            <fileset dir="installer/lib/wrapper/linux64/" excludes="*.txt" />
[8c880b2]1127        </copy>
1128    </target>
1129
[9c0c733]1130    <target name="preppkg-linux-nonx86" depends="preppkg-unix">
[b435857]1131        <copy todir="pkg-temp/lib/wrapper/linux-ppc/">
1132            <fileset dir="installer/lib/wrapper/linux-ppc/" excludes="*.txt" />
[9c0c733]1133        </copy>
1134        <copy todir="pkg-temp/lib/wrapper/linux-armv5/">
[047c668]1135            <fileset dir="installer/lib/wrapper/linux-armv5/" excludes="*.txt" />
[9c0c733]1136        </copy>
[ec22a6ec]1137        <copy todir="pkg-temp/lib/wrapper/linux-armv6/">
1138            <fileset dir="installer/lib/wrapper/linux-armv6/" excludes="*.txt" />
1139        </copy>
[9c0c733]1140    </target>
1141
[a29fd1e]1142    <target name="preppkg-osx" depends="preppkg-unix">
[5a64a86]1143        <!--<copy file="installer/resources/I2P Router Console.webloc" todir="pkg-temp/" />-->
1144        <copy todir="pkg-temp/Start I2P Router.app">
1145            <fileset dir="installer/resources/Start I2P Router.app" />
1146        </copy>
[a29fd1e]1147        <copy todir="pkg-temp/lib/wrapper/macosx/">
[047c668]1148            <fileset dir="installer/lib/wrapper/macosx/" excludes="*.txt" />
[a29fd1e]1149        </copy>
[5056706]1150        <copy file="installer/resources/net.i2p.router.plist.template" todir="pkg-temp/" />
1151        <copy file="installer/resources/install_i2p_service_osx.command" todir="pkg-temp/" />
1152        <copy file="installer/resources/uninstall_i2p_service_osx.command" todir="pkg-temp/" />
[5a64a86]1153    </target>
1154
[a29fd1e]1155    <target name="preppkg-osx-only" depends="preppkg-osx, jbigi-osx-only" >
1156        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
[b7c10d2]1157        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
[a29fd1e]1158    </target>
[b7c10d2]1159
[ee138a2]1160    <target name="preppkg-windows" depends="preppkg-base, preplicenses-windows, buildUtilityJar, buildexe">
[6ebd1f1]1161        <copy file="build/i2p.exe" todir="pkg-temp/" failonerror="false" />
[a29fd1e]1162        <copy file="installer/resources/eepget.bat" todir="pkg-temp/" />
1163        <copy file="installer/resources/i2prouter.bat" todir="pkg-temp/" />
1164        <copy file="installer/resources/fixperms.bat" todir="pkg-temp/" />
1165        <copy file="installer/resources/install_i2p_service_winnt.bat" todir="pkg-temp/" />
1166        <copy file="installer/resources/set_config_dir_for_nt_service.bat" todir="pkg-temp/" />
1167        <copy file="installer/resources/uninstall_i2p_service_winnt.bat" todir="pkg-temp/" />
[44498ca8]1168        <copy file="build/utility.jar" todir="pkg-temp" />
[a29fd1e]1169        <copy todir="pkg-temp/lib/wrapper/win32/">
[047c668]1170            <fileset dir="installer/lib/wrapper/win32/" excludes="*.txt" />
[a29fd1e]1171        </copy>
[44498ca8]1172        <copy todir="pkg-temp/lib/wrapper/win64/">
1173            <fileset dir="installer/lib/wrapper/win64/" excludes="*.txt" />
[a29fd1e]1174        </copy>
1175    </target>
1176
1177    <target name="preppkg-windows-only" depends="preppkg-windows, jbigi-windows-only">
1178        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
[cdafab27]1179     <!-- Win binaries are down-rev from the others, so use the old jar.
1180          This will not overwrite, so preppkg (for all OSes) will get the new jar with
1181          the old binaries, which will probably work but will output a warning.
1182          The windows-only installer will get the correct jar.
[44498ca8]1183        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
[cdafab27]1184      -->
1185        <copy overwrite="true" file="installer/lib/wrapper/win-all/wrapper.jar" todir="pkg-temp/lib" />
[a29fd1e]1186    </target>
[b7c10d2]1187
[e2f048b]1188    <!-- see targets below for conditional copying -->
[aeeee0e]1189    <target name="preppkg-base" depends="build, preplicenses, prepConsoleDocs, prepthemeupdates, prepCertificates, prepRouterInfos, copyjetty, copytomcat-unlesspkg, copyjstl-unlesspkg, copystandard-unlesspkg, truncatehistory">
[ac79049]1190        <!-- if updater200 was run previously, it left *.pack files in pkg-temp -->
[bf461ee]1191        <!-- Also remove deletelist.txt used for updater only -->
[ac79049]1192        <delete>
[bf461ee]1193            <fileset dir="pkg-temp" includes="**/*.jar.pack **/*.war.pack deletelist.txt" />
[ac79049]1194        </delete>
[3cf3636]1195        <copy file="build/i2p.jar" todir="pkg-temp/lib/" />
1196        <copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
1197        <copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
[0c51f2b]1198        <copy file="build/streaming.jar" todir="pkg-temp/lib/" />
[3cf3636]1199        <copy file="build/router.jar" todir="pkg-temp/lib/" />
[84d8683]1200        <copy file="build/desktopgui.jar" todir="pkg-temp/lib/" />
[3cf3636]1201        <copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
[78acf70]1202        <!-- Updated in 0.9.28; name without version so we can overwrite if we upgrade  -->
[ef26acc]1203        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
[3cf3636]1204        <copy file="build/sam.jar" todir="pkg-temp/lib/" />
[bb32672]1205        <copy file="build/BOB.jar" todir="pkg-temp/lib/" />
[d70c22d7]1206        <copy file="build/systray.jar" todir="pkg-temp/lib" />
[aa5f1cb]1207        <copy file="build/i2psnark.jar" todir="pkg-temp/lib/" />
[3cf3636]1208        <copy file="build/i2ptunnel.war" todir="pkg-temp/webapps/" />
1209        <copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
[fda6730]1210        <copy file="build/addressbook.jar" todir="pkg-temp/lib/" />
[aa3a44c4]1211        <copy file="build/susimail.war" todir="pkg-temp/webapps/" />
[d89f589f]1212        <copy file="build/susidns.war" todir="pkg-temp/webapps/" />
[5004626]1213        <copy file="build/imagegen.war" todir="pkg-temp/webapps/" />
[3ec92c8]1214        <copy file="build/i2psnark.war" todir="pkg-temp/webapps/" />
[b73b3fc]1215        <copy file="apps/i2psnark/i2psnark.config" todir="pkg-temp/" />
[f1fd352]1216        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
[62d6709]1217        <copy file="installer/resources/clients.config" todir="pkg-temp/" />
[c88c2450]1218        <copy file="installer/resources/i2ptunnel.config" todir="pkg-temp/" />
1219        <copy file="installer/resources/systray.config" todir="pkg-temp/" />
[58461ff]1220        <copy file="installer/resources/wrapper.config" todir="pkg-temp/" />
[1e32170]1221        <copy file="installer/resources/hosts.txt" todir="pkg-temp/" />
[0bc67f5a]1222        <copy file="INSTALL-headless.txt" todir="pkg-temp/" />
[382cbb1]1223        <mkdir dir="pkg-temp/scripts" />
1224        <copy file="apps/proxyscript/i2pProxy.pac" todir="pkg-temp/scripts/" />
[bb9cef1]1225        <copy file="apps/apparmor/home.i2p.i2prouter" todir="pkg-temp/scripts/" />
[8bd99f6]1226        <copy file="installer/resources/startconsole.html" todir="pkg-temp/docs/" />
1227        <copy file="installer/resources/start.ico" todir="pkg-temp/docs/" />
1228        <copy file="installer/resources/console.ico" todir="pkg-temp/docs/" />
1229        <copy file="installer/resources/uninstall.ico" todir="pkg-temp/docs/" />
[6c25f0f]1230        <!-- Eepsite stuff here -->
[6eb7ecc]1231        <mkdir dir="pkg-temp/eepsite" />
[92b9d0a]1232        <copy todir="pkg-temp/eepsite/" >
[c9b6a3f0]1233            <fileset dir="installer/resources/eepsite/" excludes="**/.placeholder" />
[b8ab14b]1234        </copy>
1235        <copy todir="pkg-temp/eepsite/docroot/help/lib/" >
1236            <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]1237        </copy>
[85adfc4]1238        <copy file="installer/resources/themes/console/images/favicon.ico" tofile="pkg-temp/eepsite/docroot/favicon.ico" />
[629eff2]1239        <copy todir="pkg-temp/docs/icons/flags" >
1240          <fileset dir="installer/resources/icons/flags" />
1241        </copy>
[06a3417]1242    </target>
[a821ea2]1243
[d6b1f81]1244    <target name="copyjetty" depends="copyjetty-unlesspkg" >
[d940aa5]1245        <copy file="build/jetty-i2p.jar" todir="pkg-temp/lib" />
[d6b1f81]1246    </target>
1247
[b72085bc]1248    <target name="copyjetty-unlesspkg" unless="${with-libjetty9-java}" >
[e2f048b]1249        <copy todir="pkg-temp/lib" >
[d6b1f81]1250            <fileset dir="build" includes="javax.servlet.jar jetty*.jar org.mortbay.*.jar" excludes="jetty-i2p.jar" />
[e2f048b]1251        </copy>
1252    </target>
1253
[11e8611]1254    <target name="settomcatprop" >
1255        <condition property="with-libtomcat-java" >
1256            <or>
1257                <istrue value="${with-libtomcat6-java}" />
1258                <istrue value="${with-libtomcat7-java}" />
1259                <istrue value="${with-libtomcat8-java}" />
1260            </or>
1261        </condition>
1262    </target>
1263
1264    <target name="copytomcat-unlesspkg" depends="settomcatprop" unless="${with-libtomcat-java}" >
[e2f048b]1265        <copy todir="pkg-temp/lib" >
1266            <fileset dir="build" includes="commons*.jar jasper*.jar javax*.jar" />
1267        </copy>
1268    </target>
1269
[094cf14]1270    <!-- todo handle alt package too -->
[1af23a4]1271    <!--
1272       glassfish-javaee.jar has ancient and conflicting classes, e.g. javax.mail
[5c8eab9]1273    <target name="copyjstl-unlesspkg" unless="${with-glassfish-javaee}" >
[1af23a4]1274    -->
1275    <target name="copyjstl-unlesspkg" >
[094cf14]1276        <copy file="apps/susidns/src/lib/jstl.jar" todir="pkg-temp/lib/" />
[e2f048b]1277    </target>
1278
[094cf14]1279    <!-- todo handle alt package too -->
[5c8eab9]1280    <target name="copystandard-unlesspkg" unless="${with-glassfish-javaee}" >
[094cf14]1281        <copy file="apps/susidns/src/lib/standard.jar" todir="pkg-temp/lib/" />
[e2f048b]1282    </target>
1283
[ee138a2]1284    <!-- does NOT include launch4j licenses for Windows builds -->
[e2f048b]1285    <target name="preplicenses" depends="preplicenses-unlesspkg" >
[6b0a2464]1286        <copy file="LICENSE.txt" todir="pkg-temp/" />
1287        <copy todir="pkg-temp/licenses/" >
1288          <fileset dir="licenses/" />
1289        </copy>
[ee138a2]1290        <copy file="apps/imagegen/identicon/README.md" tofile="pkg-temp/licenses/LICENSE-Identicon.txt" />
[70f9cb1]1291        <copy file="apps/desktopgui/LICENSE" tofile="pkg-temp/licenses/LICENSE-DesktopGUI.txt" />
[ee138a2]1292    </target>
1293
[11e8611]1294    <target name="preplicenses-unlesspkg" depends="settomcatprop" unless="${with-libtomcat-java}" >
[b72085bc]1295<!--  replacement?
[e2f048b]1296        <copy file="apps/jetty/apache-tomcat-deployer/NOTICE" tofile="pkg-temp/licenses/NOTICE-Tomcat.txt" />
[b72085bc]1297-->
[e2f048b]1298    </target>
[ee138a2]1299
1300    <!-- DOES include launch4j licenses for Windows builds -->
1301    <target name="preplicenses-windows" depends="preplicenses">
[7212f85]1302        <!--
1303              The license in launch4j/ is a BSD license for launch4j
1304              The license in launch4j/head is a MIT license for the code that is actually wrapped around the jars
1305              So we include the MIT one in our binary package
1306         -->
1307        <copy file="installer/lib/launch4j/head/LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-Launch4j.txt" />
1308        <!--  Not sure if these are used or should be included -->
[06a3417]1309        <copy file="installer/lib/launch4j/lib/foxtrot.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-Foxtrot.txt" />
1310        <copy file="installer/lib/launch4j/lib/JGoodies.Forms.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-JGoodies-Forms.txt" />
1311        <copy file="installer/lib/launch4j/lib/JGoodies.Looks.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-JGoodies-Looks.txt" />
1312        <copy file="installer/lib/launch4j/lib/XStream.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-XStream.txt" />
[3cf3636]1313    </target>
[106af99]1314
[5906fb7]1315    <target name="prepthemeupdates">
[106af99]1316        <copy todir="pkg-temp/docs/themes/" >
1317            <fileset dir="installer/resources/themes/" />
[e60e29b]1318        </copy>
[106af99]1319    </target>
1320
1321    <!-- SSL Certs -->
1322    <target name="prepCertificates">
1323        <copy todir="pkg-temp/certificates/" >
1324          <fileset dir="installer/resources/certificates/" />
[5c20574]1325        </copy>
[5906fb7]1326    </target>
1327
[0c5c18a]1328    <condition property="no.bundle.routerInfos">
1329        <isfalse value="${bundle.routerInfos}" />
1330    </condition>
1331
[73256f6]1332    <target name="prepRouterInfos" depends="buildrouter, buildTools" unless="no.bundle.routerInfos">
[6dc3cd9]1333        <delete dir="pkg-temp/netDb" />
[0c5c18a]1334        <mkdir dir="pkg-temp/netDb" />
[d510aad]1335        <java classname="net.i2p.router.networkdb.kademlia.BundleRouterInfos" fork="true" failonerror="true">
[0c5c18a]1336            <classpath>
1337                <pathelement location="build/i2p.jar" />
[7ae1483]1338                <pathelement location="core/java/build/gnu-getopt.jar" />
[0c5c18a]1339                <pathelement location="build/router.jar" />
[73256f6]1340                <pathelement location="build/tools.jar" />
[0c5c18a]1341            </classpath>
1342            <arg value="-i" />
1343            <arg value="${bundle.routerInfos.i2pConfigDir}" />
1344            <arg value="-o" />
1345            <arg value="pkg-temp/netDb" />
1346            <arg value="-c" />
1347            <arg value="${bundle.routerInfos.count}" />
1348        </java>
1349    </target>
1350
[6dc3cd9]1351    <target name="-areRouterInfosEnabled">
1352        <fail message="Option requires &quot;bundle.routerInfos&quot; to be configured. Please read &quot;build.properties&quot; for more info." >
1353            <condition>
1354                <isfalse value="${bundle.routerInfos}" />
1355            </condition>
1356        </fail>
1357    </target>
1358
[9f3d5bf]1359    <target name="i2pseeds" depends="-setepoch, -areRouterInfosEnabled, prepRouterInfos">
[6dc3cd9]1360        <delete file="i2pseeds.zip" />
1361        <delete file="i2pseeds.su3" />
1362        <zip destfile="i2pseeds.zip" basedir="pkg-temp/netDb" whenempty="fail" />
[9f3d5bf]1363        <su3sign infile="i2pseeds.zip" sigtype="RESEED" outfile="i2pseeds.su3" su3.ver="${epoch}" />
[6dc3cd9]1364    </target>
1365
[ce50a9ca]1366    <!-- this is no longer required, izpack 4.3.0 supports headless installs with java -jar i2pinstall.exe -console -->
[b611d023]1367    <!-- and this is no longer used by the SlackBuild -->
[3cf3636]1368    <target name="tarball" depends="preppkg">
1369        <tar compression="bzip2" destfile="i2p.tar.bz2">
1370            <tarfileset dir="pkg-temp" includes="**/*" prefix="i2p" />
1371        </tar>
1372    </target>
[106af99]1373
[06a3417]1374    <target name="deletepkg-temp">
[9ae4fce]1375        <delete dir="pkg-temp" />
[9a91443]1376        <delete dir="./pkg-mavencentral" />
[06a3417]1377    </target>
[106af99]1378
[ec51ea6]1379    <!-- readme and proxy error page files, initialNews.xml files, GeoIP files, and flag icons -->
1380    <target name="prepConsoleDocs" depends="prepConsoleDocUpdates, prepgeoupdate" >
[f02a0d9]1381        <copy todir="pkg-temp/docs/initialNews/">
[ec51ea6]1382          <fileset dir="installer/resources/initialNews/" />
1383        </copy>
[73e25aa]1384        <!-- ensure the proxy files have the correct line endings -->
1385        <fixcrlf srcdir="pkg-temp/docs" includes="*.ht" encoding="utf8" eol="crlf" />
[ec51ea6]1386    </target>
[106af99]1387
1388    <!-- readme and proxy error page files -->
1389    <target name="prepConsoleDocUpdates">
[9ae4fce]1390        <copy todir="pkg-temp/docs/" >
[0e853a31]1391          <fileset dir="installer/resources/readme/" includes="readme*.html" />
[106af99]1392          <fileset dir="installer/resources/proxy/" includes="*.ht" />
[af394e13]1393          <!-- 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;
[06a599b]1394               im.png added in 0.8.12; cw.png added in 0.9.5; ap,bl,bq,ss,sx added in 0.9.21;
1395               lang_gl added in 0.9.28 -->
1396          <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 icons/flags/ap.png icons/flags/bl.png icons/flags/bq.png icons/flags/ss.png icons/flags/sx.png icons/flags/lang_gl.png" />
[9ae4fce]1397        </copy>
1398    </target>
[106af99]1399
1400    <target name="consoleDocs" depends="deletepkg-temp, prepConsoleDocs">
[06a3417]1401        <zip destfile="docs.zip" basedir="pkg-temp" whenempty="fail" />
1402    </target>
[87fcaf2]1403
[ff828e6]1404    <target name="copyJavadoc" depends="javadoc">
1405        <copy todir="pkg-temp/docs/javadoc" >
1406          <fileset dir="build/javadoc/" />
1407        </copy>
1408    </target>
1409
[ac79049]1410    <target name="updater200" depends="prepupdate, preplicenses, pack200, zipit200" />
[2db086e]1411    <target name="updater200WithJetty" depends="prepjupdate, preplicenses, pack200, zipit200" />
[f592f22]1412    <target name="updater200WithJettyAndJbigi" depends="prepjupdate, prepjbigiupdate, preplicenses, pack200, zipit200" />
[41672dde]1413    <target name="updater200WithJettyAndGeoIP" depends="prepjupdate, prepgeoupdate, preplicenses, pack200, zipit200" />
[ac79049]1414    <target name="updater200WithJettyFixes" depends="prepjupdatefixes, preplicenses, pack200, zipit200" />
[19fd865]1415    <target name="updater200WithJettyFixesAndJbigi" depends="prepjupdatefixes, prepjbigiupdate, preplicenses, pack200, zipit200" />
[13d3730]1416    <target name="updater200WithJbigi" depends="prepupdate, prepjbigiupdate, preplicenses, pack200, zipit200" />
[06a3417]1417    <target name="updater" depends="prepupdate, preplicenses, zipit" />
[65504e8]1418    <target name="updaterRepack" depends="prepupdate, preplicenses, repack200, zipit" />
[ff828e6]1419    <target name="updaterWithJavadoc" depends="prepupdate, preplicenses, copyJavadoc, zipit" />
[0874b3e]1420    <target name="updater200WithJavadoc" depends="prepupdate, preplicenses, copyJavadoc, pack200, zipit200" />
[5376858]1421    <target name="updaterWithJavadocAndJetty" depends="prepjupdate, preplicenses, copyJavadoc, zipit" />
1422    <target name="updater200WithJavadocAndJetty" depends="prepjupdate, preplicenses, copyJavadoc, pack200, zipit200" />
[dcaa059]1423    <target name="updaterWithGeoIP" depends="prepupdate, prepgeoupdate, preplicenses, zipit" />
[06a3417]1424    <target name="updaterWithJetty" depends="prepjupdate, preplicenses, zipit" />
[65504e8]1425    <target name="updaterWithJettyRepack" depends="prepjupdate, preplicenses, repack200, zipit" />
[f592f22]1426    <target name="updaterWithJettyAndJbigiRepack" depends="prepjupdate, prepjbigiupdate, preplicenses, repack200, zipit" />
[41672dde]1427    <target name="updaterWithJettyAndGeoIPRepack" depends="prepjupdate, prepgeoupdate, preplicenses, repack200, zipit" />
[06a3417]1428    <target name="updaterWithJettyFixes" depends="prepjupdatefixes, preplicenses, zipit" />
[19fd865]1429    <target name="updaterWithJettyFixesAndJbigi" depends="prepjupdatefixes, prepjbigiupdate, preplicenses, zipit" />
[dcaa059]1430    <target name="updaterWithJettyFixesAndGeoIP" depends="prepjupdatefixes, prepgeoupdate, preplicenses, zipit" />
[13d3730]1431    <target name="updaterWithJbigi" depends="prepupdate, prepjbigiupdate, preplicenses, zipit" />
[3ba43a77]1432    <target name="updaterSmall" depends="prepupdateSmall, zipit" />
1433    <target name="updaterRouter" depends="prepupdateRouter, zipit" />
[c655d23]1434
[6dc3cd9]1435    <target name="-sign-update" depends="buildrouter">
[9f3d5bf]1436        <su3sign infile="i2pupdate200.zip" sigtype="ROUTER" outfile="i2pupdate.su3" su3.ver="${full.version}" />
[6dc3cd9]1437    </target>
1438
[34e3909]1439    <target name="signed-updater200" depends="-pre-sign, updater200, -sign-update" />
1440    <target name="signed-updater200WithJetty" depends="-pre-sign, updater200WithJetty, -sign-update" />
1441    <target name="signed-updater200WithJettyAndGeoIP" depends="-pre-sign, updater200WithJettyAndGeoIP, -sign-update" />
1442    <target name="signed-updater200WithJavadoc" depends="-pre-sign, updater200WithJavadoc, -sign-update" />
1443    <target name="signed-updater200WithJavadocAndJetty" depends="-pre-sign, updater200WithJavadocAndJetty, -sign-update" />
[6dc3cd9]1444
1445    <target name="zipit" depends="getReleaseNumber">
[c655d23]1446        <!--
1447             As of release 0.8.8, the router will enforce a zipfile comment equal to the
1448             version number in the sud/su2 header, since the version in the header is NOT
1449             covered by the signature.
1450         -->
1451        <zip destfile="i2pupdate.zip" basedir="pkg-temp" whenempty="fail" comment="${release.number}" />
[87fcaf2]1452       <!-- just a test, makes almost no difference
1453        <tar destfile="i2pupdate.tgz" basedir="pkg-temp" compression="gzip" />
1454        <tar destfile="i2pupdate.tbz" basedir="pkg-temp" compression="bzip2" />
1455       -->
1456    </target>
[c655d23]1457
1458    <target name="zipit200" depends="getReleaseNumber" >
1459        <zip destfile="i2pupdate200.zip" basedir="pkg-temp" whenempty="fail" comment="${release.number}" />
[ac79049]1460    </target>
[afb3c76]1461
[87fcaf2]1462    <target name="pack200">
[65504e8]1463        <!-- pack200 will only pack to a .pack file, and only from a .jar file, so we put another .jar on the end -->
[ccb8483]1464        <!-- can't pack an empty jar or one without classes, it will fail to unpack on Java 5;
1465          -  see http://bugs.sun.com/view_bug.do?bug_id=6712743
1466          -->
[65504e8]1467        <!-- *nix here -->
[ac79049]1468        <exec executable="sh" osfamily="unix" failonerror="true">
[afb3c76]1469            <arg value="-c" />
[fda6730]1470            <arg value="for i in pkg-temp/lib/*.jar pkg-temp/webapps/*war; do if [ $i = pkg-temp/lib/commons-logging.jar -o $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 -o $i = pkg-temp/webapps/addressbook.war ]; then continue; fi; echo pack200 $i; mv $i $i.jar; pack200 -g $i.pack $i.jar; rm -f $i.jar; done" />
[afb3c76]1471        </exec>
[ac79049]1472        <exec executable="sh" osfamily="mac" failonerror="true">
[87fcaf2]1473            <arg value="-c" />
[fda6730]1474            <arg value="for i in pkg-temp/lib/*.jar pkg-temp/webapps/*war; do if [ $i = pkg-temp/lib/commons-logging.jar -o $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 -o $i = pkg-temp/webapps/addressbook.war ]; then continue; fi; echo pack200 $i; mv $i $i.jar; pack200 -g $i.pack $i.jar; rm -f $i.jar; done" />
[87fcaf2]1475        </exec>
[65504e8]1476        <!-- windoz here : i admit, i hate escaped symbols in xml, indeed = =! -->
1477        <exec executable="cmd" osfamily="windows" failonerror="true">
1478            <arg value="/c" />
[ccb8483]1479            <!-- TODO implement fix above -->
[65504e8]1480            <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" />
1481        </exec>
1482        <exec executable="cmd" osfamily="windows" failonerror="true">
1483                <arg value="/c" />
1484                <arg value="for %i in (pkg-temp\lib\*.jar) do pack200 -g %i.pack %i &amp;&amp; del %i" />
1485        </exec>
1486    </target>
1487
1488    <!-- saves about 1% on average (more on jars with multiple compiled po files since they have lots of common strings) -->
1489    <target name="repack200">
1490        <!-- pack200 will only repack a .jar file, so we put another .jar on the end -->
1491        <!-- *nix here -->
1492        <exec executable="sh" osfamily="unix" failonerror="true">
1493            <arg value="-c" />
1494            <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" />
1495        </exec>
1496        <exec executable="sh" osfamily="mac" failonerror="true">
1497            <arg value="-c" />
1498            <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" />
1499        </exec>
1500        <!-- windoz here : i admit, i hate escaped symbols in xml, indeed = =! -->
1501        <exec executable="cmd" osfamily="windows" failonerror="true">
1502            <arg value="/c" />
1503            <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]1504        </exec>
[65504e8]1505        <exec executable="cmd" osfamily="windows" failonerror="true">
1506                <arg value="/c" />
1507                <arg value="for %i in (pkg-temp\lib\*.jar) do pack200 -r %i" />
[afb3c76]1508        </exec>
[ffc67d1]1509    </target>
[87fcaf2]1510
[aeeee0e]1511    <target name="prepupdate" depends="build2, prepupdateSmall, prepConsoleDocUpdates, prepCertificates, prep-script-translation, truncatehistory">
[bb32672]1512        <copy file="build/BOB.jar" todir="pkg-temp/lib/" />
[2f72f5c]1513        <copy file="build/sam.jar" todir="pkg-temp/lib/" />
1514        <copy file="build/i2psnark.jar" todir="pkg-temp/lib" />
[fd4e57aa]1515        <!-- include systray changes in 0.7.5 -->
[daac598b]1516        <copy file="build/systray.jar" todir="pkg-temp/lib/" />
[70f9cb1]1517       <!-- removed from updater in 0.9, added back in 0.9.26 -->
[84d8683]1518        <copy file="build/desktopgui.jar" todir="pkg-temp/lib/" />
[2f72f5c]1519        <copy file="build/susimail.war" todir="pkg-temp/webapps/" />
1520        <copy file="build/susidns.war" todir="pkg-temp/webapps/" />
[5004626]1521        <copy file="build/imagegen.war" todir="pkg-temp/webapps/" />
[70f9cb1]1522        <!-- as of 0.7.12; last changed in 0.9; removed from update in 0.9.26 -->
1523      <!--
[094cf14]1524        <copy file="apps/susidns/src/lib/jstl.jar" todir="pkg-temp/lib/" />
1525        <copy file="apps/susidns/src/lib/standard.jar" todir="pkg-temp/lib/" />
[70f9cb1]1526       -->
[2f72f5c]1527        <copy file="build/i2psnark.war" todir="pkg-temp/webapps/" />
[aeeee0e]1528        <copy file="installer/resources/deletelist.txt" todir="pkg-temp/" />
1529        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
1530        <copy todir="pkg-temp/man/">
1531            <fileset dir="installer/resources/man/" />
1532        </copy>
1533    </target>
1534
1535    <target name="truncatehistory">
[2f72f5c]1536        <copy file="history.txt" todir="pkg-temp/" />
[deae0e8]1537        <!-- the following overwrites history.txt on unix to shrink the update file -->
[8998bde]1538        <copy file="history.txt" tofile="pkg-temp/history.txt" overwrite="true">
1539            <filterchain>
1540                <headfilter lines="1500" />
1541            </filterchain>
1542        </copy>
[aeeee0e]1543        <concat append="true" destfile="pkg-temp/history.txt">&#10;&#10;----------------&#10;&#10;EARLIER HISTORY IS AVAILABLE IN THE SOURCE PACKAGE</concat>
[2f72f5c]1544    </target>
[106af99]1545
[cbc9165]1546    <target name="prepupdateSmall" depends="buildSmall, prepupdateRouter, prepjupdatefixes, prepthemeupdates">
[44c54ec]1547        <copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
1548        <copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
[0c51f2b]1549        <copy file="build/streaming.jar" todir="pkg-temp/lib/" />
[44c54ec]1550        <copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
[78acf70]1551        <!-- Updated in 0.9.28 -->
[880f186]1552        <!-- name without version so we can overwrite if we upgrade  -->
[ef26acc]1553        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
[44c54ec]1554        <copy file="build/i2ptunnel.war" todir="pkg-temp/webapps/" />
1555        <copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
[fda6730]1556        <copy file="build/addressbook.jar" todir="pkg-temp/lib/" />
[099f6a8]1557        <copy file="build/addressbook.war" todir="pkg-temp/webapps/" />
[a0b4b7db]1558        <!-- decapitalized the file in 0.7.8 -->
[3daf287]1559        <copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
1560        <!-- small enough to include for now -->
1561        <copy file="installer/resources/geoipv6.dat.gz" todir="pkg-temp/geoip/" />
[1caf3e7]1562        <copy file="installer/resources/continents.txt" todir="pkg-temp/geoip/" />
[40c4a42]1563      <!--
1564        <copy file="installer/resources/public-suffix-list.txt" todir="pkg-temp/geoip/" />
1565       -->
[44c54ec]1566    </target>
[106af99]1567
[06a3417]1568    <target name="prepupdateRouter" depends="buildrouter, deletepkg-temp">
[ffc67d1]1569        <copy file="build/i2p.jar" todir="pkg-temp/lib/" />
1570        <copy file="build/router.jar" todir="pkg-temp/lib/" />
1571    </target>
[106af99]1572
[19fd865]1573    <!-- jbigi.jar -->
1574    <target name="prepjbigiupdate" depends="jbigi">
1575        <copy file="build/jbigi.jar" todir="pkg-temp/lib/" />
1576    </target>
1577
[169fd56]1578    <!-- GeoIP files -->
[e69f39f6]1579    <target name="prepgeoupdate" depends="prepgeoupdate-unlesspkg" >
[3ba43a77]1580        <copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
[1caf3e7]1581        <copy file="installer/resources/continents.txt" todir="pkg-temp/geoip/" />
[40c4a42]1582      <!--
1583        <copy file="installer/resources/public-suffix-list.txt" todir="pkg-temp/geoip/" />
1584       -->
[3ba43a77]1585    </target>
[106af99]1586
[e69f39f6]1587    <!-- GeoIP files, set withGeoIPDatabase=true in override.properties to prevent -->
1588    <!-- As of 0.9.26, the files are not included in Debian/Ubuntu builds. -->
1589    <target name="prepgeoupdate-unlesspkg" unless="${with-geoip-database}" >
1590        <copy file="installer/resources/geoip.txt" todir="pkg-temp/geoip/" />
1591        <copy file="installer/resources/geoipv6.dat.gz" todir="pkg-temp/geoip/" />
1592    </target>
[106af99]1593
[92b9d0a]1594    <!-- All jetty jars required for update.
1595         TODO do we need to bother updating jasper?
1596      -->
[a5c4ba3]1597    <target name="prepjupdate" depends="prepupdate, buildWEB">
[2083d8c6]1598        <copy todir="pkg-temp/lib" >
[4045785]1599            <fileset dir="build" includes="commons*.jar jasper*.jar javax*.jar jetty*.jar jsp*.jar org.mortbay.*.jar" />
[2083d8c6]1600        </copy>
[b5f97d0]1601        <!--  We have to package the new eepsite files for MigrateJetty.java, but we
1602              can't overwrite an existing eepsite dir in a non-split configuration.
1603          -->
[4e236fc]1604        <copy todir="pkg-temp/eepsite-jetty9" >
[33b25b57]1605            <fileset dir="installer/resources/eepsite" includes="*.xml contexts/* etc/*" />
[92b9d0a]1606        </copy>
[a5c4ba3]1607    </target>
[92b9d0a]1608
[ed92411]1609    <target name="delete-j6-update">
[4e236fc]1610        <delete dir="pkg-temp/eepsite-jetty9" />
[ed92411]1611    </target>
1612
[327f38b5]1613    <!-- Jetty 6 I2P logging addons, not really fixes -->
[cbc9165]1614    <target name="prepjupdatefixes" depends="buildWEB">
[327f38b5]1615        <copy file="build/jetty-i2p.jar" todir="pkg-temp/lib/" />
[89f0f09]1616    </target>
[c5f04ee]1617
1618    <target name="util-list-changes" depends="checkForMtn" if="mtn.available" >
[fd91927c]1619        <exec executable="mtn" outputproperty="workspace.changes.util" errorproperty="mtn.error.util" failifexecutionfails="false" >
1620            <arg value="list" />
1621            <arg value="changed" />
1622            <arg value="core/java/src/net/i2p/util" />
1623        </exec>
1624        <!-- \n in an attribute value generates an invalid manifest -->
1625        <exec executable="tr" inputstring="${workspace.changes.util}" outputproperty="workspace.changes.util.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
1626            <arg value="-s" />
1627            <arg value="[:space:]" />
1628            <arg value="," />
1629        </exec>
[c5f04ee]1630    </target>
1631
[fcbee9d9]1632    <target name="izpack-patches" >
[166e36a]1633            <taskdef name="izpack"
1634                     classpath="${basedir}/installer/lib/izpack/patches.jar:${basedir}/installer/lib/izpack/standalone-compiler.jar"
1635                     classname="com.izforge.izpack.ant.IzPackTask" />
[fcbee9d9]1636        <jar destfile="${basedir}/installer/lib/izpack/patches.jar"
1637             basedir="${basedir}/installer/lib/izpack/patches" />
1638    </target>
1639
[4389f27]1640    <target name="buildUtilityJar" depends="buildCore">
1641        <ant dir="installer/java" target="build" />
[3240dac]1642    </target>
1643
[4389f27]1644    <target name="installer" depends="preppkg, buildProperties, util-list-changes, izpack-patches, buildUtilityJar" >
[24264548]1645        <!--
1646          Force 1.5 pack200 output
1647          Doesnt work!
1648          http://jira.codehaus.org/browse/IZPACK-404
1649          http://forums.sun.com/thread.jspa?threadID=773439
1650          http://bfo.co.uk/blog/2010/05/13/combining_ant_jar_signatures_and_pack200.html
1651        <property name="com.sun.java.util.jar.pack.package.majver" value="150" />
1652        <property name="com.sun.java.util.jar.pack.package.minver" value="7" />
1653        -->
[6e295a7a]1654        <izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
[d89f589f]1655
1656        <ant target="installerexe" />
1657    </target>
[fcbee9d9]1658
[6ebd1f1]1659    <!-- this makes i2pinstall.exe from install.jar -->
[7527a02]1660    <target name="installerexe" depends="launch4j" unless="noExe">
[224405d7]1661        <echo message="See the file &quot;build.properties&quot; if this step fails." />
[91c9bfe]1662        <!-- now the installer exe -->
[d89f589f]1663        <launch4j configFile="./installer/i2pinstaller.xml" />
[91c9bfe]1664        <!-- thazzit -->
[6e295a7a]1665    </target>
[b208295]1666
[a29fd1e]1667    <!-- Custom installers -->
[6ebd1f1]1668    <target name="installer-nowindows" depends="clean, preppkg-nowindows, izpack-patches" >
[73e25aa]1669        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
[91c9bfe]1670        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}.jar" installerType="standard" basedir="${basedir}" />
[e407c04]1671    </target>
[a29fd1e]1672
1673
[6ebd1f1]1674    <target name="installer-freebsd" depends="clean, preppkg-freebsd-only, izpack-patches" >
[73e25aa]1675        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
[91c9bfe]1676        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_freebsd-only.jar" installerType="standard" basedir="${basedir}" />
[a29fd1e]1677    </target>
1678
[6ebd1f1]1679    <target name="installer-linux" depends="clean, preppkg-linux-only, izpack-patches" >
[73e25aa]1680        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
[91c9bfe]1681        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_linux-only.jar" installerType="standard" basedir="${basedir}" />
[a29fd1e]1682    </target>
1683
1684
[6ebd1f1]1685    <target name="installer-osx" depends="clean, checkForIzpack2App, preppkg-osx-only, izpack-patches">
[73e25aa]1686        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
1687        <mkdir dir="pkg-temp/osx" />
1688        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_osx-only.jar" installerType="standard" basedir="${basedir}" />
1689        <ant target="installer2app" />
1690        <delete dir="pkg-temp/osx" />
[a29fd1e]1691    </target>
1692
1693    <target name="checkForIzpack2App">
[f3f4529]1694        <!-- we'll set the izpack2app binary name if it's not been set elsewhere yet -->
1695        <property name="izpack2app.binary" value="${user.home}/IzPack/utils/wrappers/izpack2app/izpack2app.py" />
1696        <available property="izpack2app.available" file="${izpack2app.binary}" />
[a29fd1e]1697    </target>
1698
1699    <target name="installer2app" if="izpack2app.available">
[f3f4529]1700        <mkdir dir="pkg-temp/osx" />
1701        <exec executable="python" failonerror="true">
1702            <arg value="${izpack2app.binary}" />
1703            <arg value="${basedir}/i2pinstall_${full.version}_osx-only.jar" />
1704            <arg value="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" />
1705        </exec>
1706
1707        <tar longfile="gnu" destfile="${basedir}/i2pinstall_${full.version}_osx.tar.bz2" compression="bzip2">
1708            <tarfileset dir="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" prefix="/i2p-${full.version}_osx-install.app" filemode="644">
1709                <include name="**/**" />
1710                <exclude name="Contents/MacOS/*" />
1711            </tarfileset>
1712            <tarfileset dir="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" prefix="/i2p-${full.version}_osx-install.app" filemode="755">
1713                <include name="Contents/MacOS/*" />
1714            </tarfileset>
1715        </tar>
[a29fd1e]1716    </target>
1717
[ed92411]1718    <!-- call between installer-xxx and installer-windows -->
1719    <target name="delete-nonwindows">
1720        <delete dir="pkg-temp/lib/wrapper/" />
1721        <delete dir="pkg-temp/locale/" />
1722        <delete dir="pkg-temp/man/" />
1723        <delete dir="pkg-temp/Start I2P Router.app/" />
1724        <delete dir="pkg-temp" includes="eepget i2prouter INSTALL-headless.txt osid postinstall.sh runplain.sh" />
1725    </target>
1726
[4389f27]1727    <target name="installer-windows" depends="clean, preppkg-windows-only, util-list-changes, izpack-patches, buildUtilityJar" >
[73e25aa]1728        <fixcrlf srcdir="pkg-temp" includes="*.config *.bat *.cmd **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="crlf"/>
1729        <izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
[6ebd1f1]1730        <ant target="installerexe" />
1731        <delete file="${basedir}/install.jar" />
[58512b8]1732        <move file="${basedir}/i2pinstall.exe" tofile="${basedir}/i2pinstall_${full.version}_windows.exe" />
[a29fd1e]1733    </target>
1734
[ed92411]1735    <!-- this is broken as installer-xxx targets may delete (or not delete) things in pkg-temp -->
[6a103a1]1736    <target name="installer-all" depends="installer-freebsd, installer-linux, installer-osx, installer-windows, installer-nowindows, installer" >
[a29fd1e]1737    </target>
1738    <!-- end custom installers -->
[2654ada]1739
[8a32aad]1740    <!-- unit tests -->
[fcdf837]1741    <target name="buildTest">
[8a32aad]1742        <ant dir="core/java/" target="jarTest" />
[fcdf837]1743        <ant dir="router/java/" target="jarTest" />
1744        <copy file="core/java/build/i2ptest.jar" todir="build" />
1745        <copy file="router/java/build/routertest.jar" todir="build" />
[f85d0308]1746        <!-- broken -->
1747      <!--
1748        <ant dir="apps/ministreaming/java/" target="junit.compileTest" />
1749        <ant dir="apps/streaming/java/" target="junit.compileTest" />
1750       -->
[8a32aad]1751    </target>
[fcdf837]1752    <target name="prepTest" depends="prepupdate, buildTest">
1753        <!-- overwrite i2p.jar and router.jar with the test versions -->
1754        <copy file="build/i2ptest.jar" tofile="pkg-temp/lib/i2p.jar" overwrite="true" />
1755        <copy file="build/routertest.jar" tofile="pkg-temp/lib/router.jar" overwrite="true" />
[8a32aad]1756    </target>
[fcdf837]1757    <target name="updateTest" depends="prepTest, zipit" />
[e4ec046]1758    <target name="junit.test" depends="buildProperties, jbigi" >
1759        <ant dir="core/java/" target="junit.test" />
1760        <ant dir="router/java/" target="junit.test" />
[8d3fb0c]1761        <ant dir="apps/ministreaming/java/" target="junit.test" />
[10bf74e]1762        <ant dir="apps/streaming/java/" target="junit.test" />
[e4ec046]1763    </target>
1764    <target name="scalatest.test" depends="buildProperties, jbigi" >
1765        <ant dir="core/java/" target="scalatest.test" />
[fcdf837]1766        <!-- note there are no router scala tests yet -->
[e4ec046]1767        <ant dir="router/java/" target="scalatest.test" />
1768    </target>
[219d7fd]1769    <target name="test" depends="buildProperties, jbigi" >
[fcdf837]1770        <!-- both junit and scala -->
[440cf2c]1771        <ant dir="core/java/" target="test" />
[e4ec046]1772        <ant dir="router/java/" target="test" />
[8d3fb0c]1773        <ant dir="apps/ministreaming/java/" target="test" />
[10bf74e]1774        <ant dir="apps/streaming/java/" target="test" />
[440cf2c]1775    </target>
[d6d1b51]1776    <target name="scalatest.report" depends="buildProperties" >
1777        <ant dir="core/java/" target="scalatest.report" />
1778        <ant dir="router/java/" target="scalatest.report" />
1779    </target>
[b208295]1780    <target name="junit.report" depends="buildProperties" >
[440cf2c]1781        <ant dir="core/java/" target="junit.report" />
[d6d1b51]1782        <ant dir="router/java/" target="junit.report" />
[8d3fb0c]1783        <ant dir="apps/ministreaming/java/" target="junit.report" />
[10bf74e]1784        <ant dir="apps/streaming/java/" target="junit.report" />
[440cf2c]1785    </target>
[c955adf]1786    <target name="clover.report" depends="buildProperties" if="with.clover">
[440cf2c]1787        <ant dir="core/java/" target="clover.report" />
[d6d1b51]1788        <ant dir="router/java/" target="clover.report" />
[8d3fb0c]1789        <ant dir="apps/ministreaming/java" target="clover.report" />
[b611d023]1790        <ant dir="apps/streaming/java" target="clover.report" />
[440cf2c]1791    </target>
[c955adf]1792    <target name="cobertura.report" depends="buildProperties" if="with.cobertura">
1793        <ant dir="core/java/" target="cobertura.report" />
[d6d1b51]1794        <ant dir="router/java/" target="cobertura.report" />
[8d3fb0c]1795        <ant dir="apps/ministreaming/java" target="cobertura.report" />
[b611d023]1796        <ant dir="apps/streaming/java" target="cobertura.report" />
[c955adf]1797    </target>
[d6d1b51]1798    <target name="test.report" depends="junit.report, scalatest.report, clover.report, cobertura.report"/>
1799    <target name="fulltest" depends="buildProperties, jbigi" >
1800        <ant dir="core/java/" target="fulltest" />
1801        <ant dir="router/java/" target="fulltest" />
[8d3fb0c]1802        <ant dir="apps/ministreaming/java" target="fulltest" />
[98d932a]1803        <ant dir="apps/streaming/java" target="fulltest" />
[440cf2c]1804    </target>
[e7d48f1]1805    <target name="jenkins.cobertura.report" depends="cobertura.report">
1806        <!--
1807             The jenkins cobertura plugin couldn't find the source files.
1808         -->
1809        <replaceregexp byline="true" file="reports/core/cobertura/coverage.xml"
1810            match='filename="net' replace='filename="core/java/src/net'/>
1811        <replaceregexp byline="true" file="reports/core/cobertura/coverage.xml"
1812            match="&lt;source&gt;./src" replace='&lt;source&gt;./core/java/src'/>
[98d932a]1813
[e7d48f1]1814        <replaceregexp byline="true" file="reports/router/cobertura/coverage.xml"
1815            match='filename="net' replace='filename="router/java/src/net'/>
1816        <replaceregexp byline="true" file="reports/router/cobertura/coverage.xml"
1817            match="&lt;source&gt;./src" replace="&lt;source&gt;router/java/src"/>
[98d932a]1818
[8d3fb0c]1819        <replaceregexp byline="true" file="reports/ministreaming/cobertura/coverage.xml"
1820            match='filename="net' replace='filename="apps/ministreaming/java/src/net'/>
1821        <replaceregexp byline="true" file="reports/ministreaming/cobertura/coverage.xml"
1822            match="&lt;source&gt;./src" replace="&lt;source&gt;apps/ministreaming/java/src"/>
1823
[10bf74e]1824        <replaceregexp byline="true" file="reports/streaming/cobertura/coverage.xml"
[98d932a]1825            match='filename="net' replace='filename="apps/streaming/java/src/net'/>
[10bf74e]1826        <replaceregexp byline="true" file="reports/streaming/cobertura/coverage.xml"
[98d932a]1827            match="&lt;source&gt;./src" replace="&lt;source&gt;apps/streaming/java/src"/>
[e7d48f1]1828    </target>
[8a32aad]1829    <!-- end unit tests -->
[b208295]1830
[0018ac0]1831    <target name="testscripts" >
1832        <exec executable="tests/scripts/checkcerts.sh" failonerror="true" />
1833        <exec executable="tests/scripts/checkpo.sh" failonerror="true" />
1834        <exec executable="tests/scripts/checkutf8.sh" failonerror="true" />
1835        <exec executable="tests/scripts/checkxml.sh" failonerror="true" />
[683ce32]1836        <exec executable="tests/scripts/checkscripts.sh" failonerror="true" />
[0018ac0]1837    </target>
1838
1839
[c161649]1840    <target name="testscripts-net" >
1841        <exec executable="tests/scripts/checkremotecerts.sh" failonerror="true" />
1842    </target>
1843
1844    <target name="testscripts-all" depends="testscripts,testscripts-net" />
1845
[313ee79b]1846    <!-- <target name="syndie" >
[c96965d]1847        <ant dir="apps/syndie/java/" target="standalone" />
1848        <copy file="apps/syndie/java/syndie-standalone.zip" todir="." />
[313ee79b]1849    </target> -->
[e27af37]1850
1851    <!-- standalone i2psnark zip -->
[4ee66c82]1852    <target name="i2psnark" depends="buildStreaming, buildJetty, buildSystray" >
[c287bace]1853        <ant dir="apps/i2psnark/java" target="standalone" />
1854        <copy file="apps/i2psnark/java/i2psnark-standalone.zip" todir="." />
1855    </target>
[e27af37]1856
[b6b1491]1857    <target name="slackpkg">
1858        <ant dir="Slackware/i2p/" target="slackpkg" />
1859    </target>
[cf10cb1c]1860    <target name="justBOB" depends="builddepSmall, jbigi">
[4f548b7]1861        <ant dir="apps/BOB/" target="onejar" />
1862        <copy file="apps/BOB/dist/BOB-one.jar" todir="." />
1863    </target>
[9eb25f6]1864
1865    <target name="sloccount.report">
[7fd59c4]1866        <property name="sloccount.report.file" value="sloccount.sc" />
1867        <echo message="Generating sloccount report (this will take awhile)" />
[9eb25f6]1868        <exec executable="sloccount" failonerror="true">
1869            <arg value="--details"/>
1870            <arg value="--wide"/>
[8998bde]1871            <arg value="${basedir}"/>
[7fd59c4]1872            <redirector output="${sloccount.report.file}">
[9eb25f6]1873                <outputfilterchain>
1874                    <linecontainsregexp negate="true">
[7fd59c4]1875                        <regexp pattern="(Warning: |lib/launch4j|_MTN|reports|pkg-temp|licenses|i2p\.fba|gmp-|WEB-INF)" />
[9eb25f6]1876                    </linecontainsregexp>
[8998bde]1877                    <linecontains negate="true">
1878                        <contains value="${sloccount.report.file}" />
1879                    </linecontains>
[9eb25f6]1880                </outputfilterchain>
1881            </redirector>
1882        </exec>
[7fd59c4]1883        <echo message="sloccount report saved to the file &quot;${sloccount.report.file}&quot;" />
[9eb25f6]1884    </target>
1885
[44498ca8]1886    <target name="findbugs" depends="build2, buildUtilityJar">
[bd6c63cc]1887        <echo message="Starting findbugs, this will take a while..." />
[a51ae64e]1888        <exec executable="nice" failonerror="true">
[bd6c63cc]1889            <arg value="findbugs"/>
1890            <arg value="-textui"/>
1891            <arg value="-projectName"/>
1892            <arg value="i2p"/>
1893            <arg value="-sortByClass"/>
1894            <arg value="-xml"/>
1895            <arg value="-output"/>
[2e51577f]1896            <arg value="i2p.fba"/>
[bd6c63cc]1897            <arg value="-auxclasspath"/>
[3063e37]1898            <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:installer/lib/wrapper/all/wrapper.jar:apps/susidns/src/lib/standard.jar:apps/susidns/src/lib/jstl.jar:apps/jrobin/jrobin-1.5.9.1.jar"/>
[bd6c63cc]1899            <arg value="-sourcepath"/>
[44498ca8]1900            <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]1901            <!-- start of the files to be analyzed -->
1902            <arg value="build/BOB.jar"/>
[1f9bb04]1903            <arg value="build/addressbook.jar"/>
[bd6c63cc]1904            <arg value="build/i2p.jar"/>
1905            <arg value="build/i2psnark.jar"/>
1906            <arg value="build/i2psnark.war"/>
1907            <arg value="build/i2ptunnel.jar"/>
1908            <arg value="build/i2ptunnel.war"/>
[5004626]1909            <arg value="build/imagegen.war"/>
[8845ce6]1910            <arg value="build/jetty-i2p.jar"/>
[bd6c63cc]1911            <arg value="build/mstreaming.jar"/>
1912            <arg value="build/router.jar/"/>
[84d8683]1913            <arg value="build/desktopgui.jar"/>
[2e51577f]1914            <arg value="build/routerconsole.jar"/>
1915            <arg value="build/routerconsole.war"/>
[bd6c63cc]1916            <arg value="build/sam.jar"/>
1917            <arg value="build/streaming.jar"/>
1918            <arg value="build/susidns.war"/>
1919            <arg value="build/susimail.war"/>
1920            <arg value="build/systray.jar"/>
[44498ca8]1921            <arg value="build/utility.jar"/>
[bd6c63cc]1922        </exec>
[2e51577f]1923        <echo message="Findbugs output stored in i2p.fba" />
1924        <echo message="Now run: findbugs i2p.fba" />
[bd6c63cc]1925    </target>
[ac79049]1926
1927    <!-- this is the same dependency as pkg, but with updater200 in the middle,
1928         since preppkg puts too much stuff in pkg-temp -->
[6b923c7]1929<!--
[c655d23]1930    <target name="release" depends="distclean, updaterWithJettyFixesAndJbigi , updater200WithJettyFixes, preppkg, installer, getReleaseNumber" >
[37597b8]1931    <target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyAndGeoIPRepack, updater200WithJettyAndGeoIP, delete-j6-update, installer-nowindows, delete-nonwindows, installer-windows">
[f592f22]1932    <target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyAndJbigiRepack, updater200WithJettyAndJbigi, delete-j6-update, installer-nowindows, delete-nonwindows, installer-windows">
[022479a]1933-->
1934    <target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyRepack, updater200WithJetty, delete-j6-update, installer-nowindows, delete-nonwindows, installer-windows">
[960cd18]1935        <echo message="New version number is ${release.number}" />
[0bef852]1936        <copy file="i2pupdate.zip" tofile="i2pupdate_${release.number}.zip" />
[3240dac]1937        <copy file="i2pinstall_${full.version}.jar" tofile="i2pinstall_${release.number}.jar" />
[58512b8]1938        <copy file="i2pinstall_${full.version}_windows.exe" tofile="i2pinstall_${release.number}_windows.exe" />
[9483e09]1939        <!-- remove these, we don't build them anymore -->
[d0dca20]1940        <delete file="i2pupdate.sud" />
1941        <delete file="i2pupdate.su2" />
[9483e09]1942        <!-- make this a lot easier by putting release.privkey.su3=/path/to/su3keystore.ks in override.properties -->
[6dc3cd9]1943
[e004b0e]1944        <!-- now build and verify the packed su3 from the packed zip -->
[9f3d5bf]1945        <su3sign infile="i2pupdate200.zip" sigtype="ROUTER" outfile="i2pupdate.su3" su3.ver="${release.number}" />
[b611d023]1946        <!-- this will use the monotonerc file in the current workspace -->
[fdfbab8]1947        <echo message="Checking out fresh copy into ../i2p-${release.number} for tarballing:" />
[960cd18]1948        <delete dir="../i2p-${release.number}" />
[7efab75]1949        <exec executable="mtn" failonerror="true">
[0bef852]1950            <arg value="co" />
[7efab75]1951            <!-- w: is the revision of the current workspace -->
1952            <arg value="-r" />
1953            <arg value="w:" />
[0bef852]1954            <arg value="../i2p-${release.number}/" />
1955        </exec>
[7efab75]1956        <exec executable="tar" failonerror="true">
[0bef852]1957            <arg value="cjf" />
1958            <arg value="i2psource_${release.number}.tar.bz2" />
1959            <arg value="-C" />
1960            <arg value=".." />
1961            <arg value="--exclude" />
[960cd18]1962            <arg value="i2p-${release.number}/_MTN*" />
[0bef852]1963            <arg value="i2p-${release.number}/" />
1964        </exec>
1965        <echo message="Sign the files:" />
[cfdbef0]1966        <input message="Enter GPG key ID (e.g. 0x12345678) for signing:" addproperty="release.gpg.keyid" />
1967        <fail message="You must enter a key ID." >
1968            <condition>
1969                <equals arg1="${release.gpg.keyid}" arg2=""/>
1970            </condition>
1971        </fail>
[58512b8]1972
1973        <!-- the gpgsign macro sets the permission of signed files and the sigs themselves to 444 -->
1974        <gpgsign file="i2pinstall_${release.number}_windows.exe" />
1975        <gpgsign file="i2pinstall_${release.number}.jar" />
1976        <gpgsign file="i2psource_${release.number}.tar.bz2" />
1977        <gpgsign file="i2pupdate_${release.number}.zip" />
1978
1979        <chmod perm="444" type="file">
1980            <fileset dir="${basedir}">
1981                <include name="i2pupdate.su3" />
1982            </fileset>
1983        </chmod>
[0bef852]1984        <echo message="File sizes:" />
[7efab75]1985        <exec executable="ls" failonerror="true">
[0bef852]1986            <arg value="-l" />
[7a690b24]1987            <arg value="i2pinstall_${release.number}_windows.exe" />
[3240dac]1988            <arg value="i2pinstall_${release.number}.jar" />
[0bef852]1989            <arg value="i2psource_${release.number}.tar.bz2" />
1990            <arg value="i2pupdate_${release.number}.zip" />
[e004b0e]1991            <arg value="i2pupdate.su3" />
[7a690b24]1992            <arg value="i2pinstall_${release.number}_windows.exe.sig" />
[3240dac]1993            <arg value="i2pinstall_${release.number}.jar.sig" />
[0bef852]1994            <arg value="i2psource_${release.number}.tar.bz2.sig" />
1995            <arg value="i2pupdate_${release.number}.zip.sig" />
1996        </exec>
1997        <echo message="SHA256 sums:" />
[58512b8]1998        <sha256sum file="i2pinstall_${release.number}_windows.exe" />
1999        <sha256sum file="i2pinstall_${release.number}.jar" />
2000        <sha256sum file="i2psource_${release.number}.tar.bz2" />
2001        <sha256sum file="i2pupdate_${release.number}.zip" />
2002        <sha256sum file="i2pupdate.su3" />
[efb986f]2003        <!-- make torrent files -->
[e004b0e]2004        <copy file="i2pupdate.su3" tofile="i2pupdate-${release.number}.su3" />
[58512b8]2005        <mktorrent file="i2pupdate-${release.number}.su3" />
[fdfbab8]2006        <echo message="Don't forget to mtn tag w: i2p-${release.number}" />
[7efab75]2007        <echo message="... and mtn cert t:i2p-${release.number} branch i2p.i2p.release" />
[0bef852]2008    </target>
[ac79049]2009
[e744793]2010    <target name="mavenCentral.deps" depends="buildRouter, buildStreaming">
[9a91443]2011        <ant dir="core/java/" target="javadocJar" />
2012        <ant dir="core/java/" target="sourcesJar" />
[e744793]2013        <ant dir="router/java/" target="javadocJar" />
2014        <ant dir="router/java/" target="sourcesJar" />
[9a91443]2015        <ant dir="apps/ministreaming/java/" target="javadocJar" />
2016        <ant dir="apps/ministreaming/java/" target="sourcesJar" />
2017        <ant dir="apps/streaming/java/" target="javadocJar" />
2018        <ant dir="apps/streaming/java/" target="sourcesJar" />
2019    </target>
2020
2021    <target name="mavenCentral" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, mavenCentral.deps">
2022        <mkdir dir="./pkg-mavencentral" />
2023        <!-- Libraries -->
2024        <copy file="build/i2p.jar" tofile="pkg-mavencentral/i2p-${release.number}.jar" />
[e744793]2025        <copy file="build/router.jar" tofile="pkg-mavencentral/router-${release.number}.jar" />
[9a91443]2026        <copy file="build/mstreaming.jar" tofile="pkg-mavencentral/mstreaming-${release.number}.jar" />
2027        <copy file="build/streaming.jar" tofile="pkg-mavencentral/streaming-${release.number}.jar" />
2028        <!-- JavaDocs -->
2029        <copy file="core/java/build/i2p-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
[e744793]2030        <copy file="router/java/build/router-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
[9a91443]2031        <copy file="apps/ministreaming/java/build/mstreaming-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
2032        <copy file="apps/streaming/java/build/streaming-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
2033        <!-- Sources -->
2034        <copy file="core/java/build/i2p-${release.number}-sources.jar" todir="pkg-mavencentral/" />
[e744793]2035        <copy file="router/java/build/router-${release.number}-sources.jar" todir="pkg-mavencentral/" />
[9a91443]2036        <copy file="apps/ministreaming/java/build/mstreaming-${release.number}-sources.jar" todir="pkg-mavencentral/" />
2037        <copy file="apps/streaming/java/build/streaming-${release.number}-sources.jar" todir="pkg-mavencentral/" />
2038        <!-- POMs -->
2039        <artifact:pom id="i2ppom" groupId="net.i2p" artifactId="i2p" version="${release.number}"
2040                name="I2P Core"
2041                description="The core I2P APIs"
2042                url="https://geti2p.net/">
2043            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
2044            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
2045            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/"/>
2046            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
2047                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
2048                 url="git@github.com:i2p/i2p.i2p.git" />
2049        </artifact:pom>
[e744793]2050        <artifact:pom id="routerpom" groupId="net.i2p" artifactId="router" version="${release.number}"
2051                name="I2P Router"
2052                description="The I2P router"
2053                url="https://geti2p.net/">
2054            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
2055            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
2056            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/"/>
2057            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
2058                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
2059                 url="git@github.com:i2p/i2p.i2p.git" />
2060            <dependency groupId="net.i2p" artifactId="i2p" version="${release.number}" />
2061        </artifact:pom>
[9a91443]2062        <artifact:pom id="mstreamingpom" groupId="net.i2p.client" artifactId="mstreaming" version="${release.number}"
2063                name="I2P Ministreaming"
2064                description="API, interfaces, and factory for a TCP-like set of sockets for communicating over I2P."
2065                url="https://geti2p.net/en/docs/api/streaming">
2066            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
2067            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
2068            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/" />
2069            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
2070                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
2071                 url="git@github.com:i2p/i2p.i2p.git" />
2072            <dependency groupId="net.i2p" artifactId="i2p" version="${release.number}" />
2073        </artifact:pom>
2074        <artifact:pom id="streamingpom" groupId="net.i2p.client" artifactId="streaming" version="${release.number}"
2075                name="I2P Streaming"
2076                description="Implementation of a TCP-like set of sockets for communicating over I2P."
2077                url="https://geti2p.net/en/docs/api/streaming">
2078            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
2079            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
2080            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/" />
2081            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
2082                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
2083                 url="git@github.com:i2p/i2p.i2p.git" />
2084            <dependency groupId="net.i2p" artifactId="i2p" version="${release.number}" />
2085            <dependency groupId="net.i2p.client" artifactId="mstreaming" version="${release.number}" />
2086        </artifact:pom>
2087        <artifact:writepom pomRefId="i2ppom" file="pkg-mavencentral/i2p-${release.number}.pom"/>
[e744793]2088        <artifact:writepom pomRefId="routerpom" file="pkg-mavencentral/router-${release.number}.pom"/>
[9a91443]2089        <artifact:writepom pomRefId="mstreamingpom" file="pkg-mavencentral/mstreaming-${release.number}.pom" />
2090        <artifact:writepom pomRefId="streamingpom" file="pkg-mavencentral/streaming-${release.number}.pom" />
2091        <!-- Signatures -->
2092        <echo message="Sign the files:" />
2093        <input message="Enter GPG key ID (e.g. 0x12345678) for signing:" addproperty="release.gpg.keyid" />
2094        <fail message="You must enter a key ID." >
2095            <condition>
2096                <equals arg1="${release.gpg.keyid}" arg2=""/>
2097            </condition>
2098        </fail>
2099        <!-- the gpgsign macro sets the permission of signed files and the sigs themselves to 444 -->
2100        <gpgsignasc file="pkg-mavencentral/i2p-${release.number}.jar" />
2101        <gpgsignasc file="pkg-mavencentral/i2p-${release.number}.pom" />
2102        <gpgsignasc file="pkg-mavencentral/i2p-${release.number}-javadoc.jar" />
2103        <gpgsignasc file="pkg-mavencentral/i2p-${release.number}-sources.jar" />
[e744793]2104        <gpgsignasc file="pkg-mavencentral/router-${release.number}.jar" />
2105        <gpgsignasc file="pkg-mavencentral/router-${release.number}.pom" />
2106        <gpgsignasc file="pkg-mavencentral/router-${release.number}-javadoc.jar" />
2107        <gpgsignasc file="pkg-mavencentral/router-${release.number}-sources.jar" />
[9a91443]2108        <gpgsignasc file="pkg-mavencentral/mstreaming-${release.number}.jar" />
2109        <gpgsignasc file="pkg-mavencentral/mstreaming-${release.number}.pom" />
2110        <gpgsignasc file="pkg-mavencentral/mstreaming-${release.number}-javadoc.jar" />
2111        <gpgsignasc file="pkg-mavencentral/mstreaming-${release.number}-sources.jar" />
2112        <gpgsignasc file="pkg-mavencentral/streaming-${release.number}.jar" />
2113        <gpgsignasc file="pkg-mavencentral/streaming-${release.number}.pom" />
2114        <gpgsignasc file="pkg-mavencentral/streaming-${release.number}-javadoc.jar" />
2115        <gpgsignasc file="pkg-mavencentral/streaming-${release.number}-sources.jar" />
2116        <!-- Bundle -->
2117        <jar destfile="mavencentral-i2p.jar">
2118            <fileset dir="./pkg-mavencentral">
2119                <include name="i2p-*" />
2120            </fileset>
2121        </jar>
[e744793]2122        <jar destfile="mavencentral-router.jar">
2123            <fileset dir="./pkg-mavencentral">
2124                <include name="router-*" />
2125            </fileset>
2126        </jar>
[9a91443]2127        <jar destfile="mavencentral-mstreaming.jar">
2128            <fileset dir="./pkg-mavencentral">
2129                <include name="mstreaming-*" />
2130            </fileset>
2131        </jar>
2132        <jar destfile="mavencentral-streaming.jar">
2133            <fileset dir="./pkg-mavencentral">
2134                <include name="streaming-*" />
2135            </fileset>
2136        </jar>
2137        <echo message="Now upload mavencentral-*.jar to Maven Central." />
2138    </target>
2139
[3396626a]2140    <target name="debian" depends="debian-clean, debchange, debian-binary" />
[f1e36f7]2141
[3396626a]2142    <target name="getExtendedVersion" depends="buildProperties, trimMtnRev">
2143        <property name="MtnShortHash" value="unknown" />
2144        <condition property="Extended.Version" value="${full.version}-${MtnShortHash}">
2145            <not>
2146                <or>
2147                    <equals arg1="${MtnShortHash}" arg2="" />
2148                    <equals arg1="${MtnShortHash}" arg2="unknown" />
2149                </or>
2150            </not>
2151        </condition>
2152        <!-- if not set above we'll set it here -->
2153        <property name="Extended.Version" value="${full.version}" />
2154    </target>
2155
2156    <target name="debchange" depends="getExtendedVersion" unless="noAutoDebchange">
2157        <echo message= "Debian version is ${Extended.Version}-1" />
2158        <exec executable="dch" failonerror="true">
2159            <arg value="-b" />
2160            <arg value="--check-dirname-level" />
2161            <arg value="0" />
2162            <arg value="-v" />
2163            <arg value="${Extended.Version}-1" />
2164            <arg value="Unofficial Debian package built using &quot;ant debian&quot;" />
[84e4558]2165        </exec>
[3396626a]2166    </target>
[84e4558]2167
[3396626a]2168    <target name="debian-binary" depends="getExtendedVersion">
[84e4558]2169        <exec executable="fakeroot" failonerror="true">
2170            <arg value="debian/rules" />
2171            <arg value="patch" />
2172            <arg value="binary" />
2173            <arg value="clean" />
[b4524c6]2174        </exec>
[84e4558]2175        <delete dir=".pc" />
[3396626a]2176        <move todir=".">
[5dbe629]2177            <fileset dir=".." includes="libjbigi*${release.number}*.deb i2p*${release.number}*.deb" />
[3396626a]2178        </move>
2179        <echo message="" />
2180        <echo message="====================" />
2181        <echo message="Packages have been built and moved to ${basedir}" />
2182        <echo message="====================" />
[b6fab82]2183    </target>
[84e4558]2184
[3396626a]2185    <target name="debian-clean" depends="getExtendedVersion" >
[b6fab82]2186        <exec executable="fakeroot" failonerror="true">
[84e4558]2187            <arg value="debian/rules" />
2188            <arg value="clean" />
[b97197c]2189        </exec>
[84e4558]2190        <delete dir="./.pc" />
[b97197c]2191    </target>
[84e4558]2192
[3396626a]2193    <target name="debian-tarball" depends="getExtendedVersion">
[b611d023]2194        <!-- this will use the monotonerc file in the current workspace -->
[3396626a]2195        <fail message="This target cannot be used without Monotone! Use &quot;fakeroot debian/rules get-orig-source&quot; instead.">
2196            <condition>
2197                <not>
2198                    <isset property="mtn.available" />
2199                </not>
2200            </condition>
2201        </fail>
2202        <property name="debian.tarball.name" value="i2p_${Extended.Version}.orig.tar.bz2" />
2203        <echo message="Checking out fresh copy into ../i2p-${Extended.Version} for tarballing:" />
2204        <delete dir="../i2p-${Extended.Version}" />
2205        <exec executable="mtn" failonerror="true">
2206            <arg value="co" />
2207            <!-- w: is the revision of the current workspace -->
2208            <arg value="-r" />
2209            <arg value="w:" />
2210            <arg value="../i2p-${Extended.Version}" />
2211        </exec>
[ec6c244]2212        <delete includeemptydirs="true" quiet="false" failonerror="false">
[17b1d524]2213            <fileset dir="../i2p-${Extended.Version}/debian-alt/" />
[3396626a]2214            <fileset dir="../i2p-${Extended.Version}/installer/lib/" />
2215            <fileset dir="../i2p-${Extended.Version}/Slackware" />
2216            <fileset dir="../i2p-${Extended.Version}/_MTN" />
[f2239ba]2217            <!-- gettext-base -->
2218            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/gettext" />
[2e15488]2219            <!-- libgetopt-java -->
[c3f5c04]2220            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/getopt" />
[2fe1f97]2221            <!-- libhttpclient-java and libhttpcore-java -->
[1754240]2222          <!--
[2fe1f97]2223            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/apache/http" />
[1754240]2224           -->
[094cf14]2225            <!-- geoip-database -->
[e2f048b]2226            <file name="../i2p-${Extended.Version}/installer/resources/geoip.txt" />
2227            <file name="../i2p-${Extended.Version}/installer/resources/geoipv6.dat.gz" />
[b72085bc]2228            <!-- libjetty9-java -->
2229            <fileset dir="../i2p-${Extended.Version}/apps/jetty/jetty-distribution-9.2.21.v20170120" />
[094cf14]2230            <!-- libjstl1.1-java or glassfish-javaee -->
[1af23a4]2231          <!--
[094cf14]2232            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/jstl.jar" />
[1af23a4]2233           -->
[094cf14]2234            <!-- libjakarta-taglibs-standard-java or glassfish-javaee -->
2235            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/standard.jar" />
[e2f048b]2236            <!-- anything added above, add in debian-release-tarball also -->
[3396626a]2237        </delete>
2238        <tar longfile="gnu" destfile="../${debian.tarball.name}" compression="bzip2">
2239            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${Extended.Version}">
2240                <include name="**/**" />
2241                <exclude name="debian/**"/>
[66be140]2242                <exclude name="debian-alt/**"/>
[3be5002]2243                <exclude name="**/*.sh"/>
[169fd56]2244                <exclude name="installer/resources/geoip.txt"/>
2245                <exclude name="installer/resources/geoipv6.dat.gz"/>
[d6b1f81]2246                <exclude name="apps/jetty/jetty-distribution-*/**"/>
[d8d0414]2247          <!--
[094cf14]2248                <exclude name="apps/susidns/src/lib/jstl.jar" />
[d8d0414]2249           -->
[094cf14]2250                <exclude name="apps/susidns/src/lib/standard.jar" />
[e2f048b]2251                <!-- anything added above, add in debian-release-tarball also -->
[3be5002]2252            </tarfileset>
2253            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${Extended.Version}" filemode="755">
2254                <exclude name="debian/**" />
2255                <include name="**/*.sh" />
[3396626a]2256            </tarfileset>
[f653b03]2257        </tar>
2258    </target>
2259
[bfbd159]2260    <!-- same as debian-release-tarball but with bundled jetty
2261      -  We add a 'p' to the release name and tarball since the source package is different;
2262      -  Launchpad does not allow different source packages with the same name.
2263      -->
2264    <target name="precise-release-tarball" depends="getExtendedVersion">
[f653b03]2265        <!-- this will use the monotonerc file in the current workspace -->
2266        <fail message="This target cannot be used without Monotone! Use &quot;fakeroot debian/rules get-orig-source&quot; instead.">
2267            <condition>
2268                <not>
2269                    <isset property="mtn.available" />
2270                </not>
2271            </condition>
2272        </fail>
[bfbd159]2273        <property name="debian.tarball.name" value="i2p_${release.number}p.orig.tar.bz2" />
[f653b03]2274        <echo message="Checking out fresh copy into ../i2p-${Extended.Version} for tarballing:" />
2275        <delete dir="../i2p-${Extended.Version}" />
2276        <exec executable="mtn" failonerror="true">
2277            <arg value="co" />
2278            <!-- w: is the revision of the current workspace -->
2279            <arg value="-r" />
2280            <arg value="w:" />
[bfbd159]2281            <arg value="-b" />
2282            <arg value="i2p.i2p" />
[f653b03]2283            <arg value="../i2p-${Extended.Version}" />
2284        </exec>
[ec6c244]2285        <delete includeemptydirs="true" quiet="false" failonerror="false">
[f653b03]2286            <fileset dir="../i2p-${Extended.Version}/debian-alt/" />
2287            <fileset dir="../i2p-${Extended.Version}/installer/lib/" />
2288            <fileset dir="../i2p-${Extended.Version}/Slackware" />
2289            <fileset dir="../i2p-${Extended.Version}/_MTN" />
2290            <!-- gettext-base -->
2291            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/gettext" />
2292            <!-- libgetopt-java -->
2293            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/getopt" />
2294            <!-- libhttpclient-java and libhttpcore-java -->
2295          <!--
2296            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/apache/http" />
2297           -->
2298            <!-- geoip-database -->
2299            <file name="../i2p-${Extended.Version}/installer/resources/geoip.txt" />
2300            <file name="../i2p-${Extended.Version}/installer/resources/geoipv6.dat.gz" />
[b72085bc]2301            <!-- libjetty9-java -->
[f653b03]2302          <!--
[b72085bc]2303            <fileset dir="../i2p-${Extended.Version}/apps/jetty/jetty-distribution-9.2.21.v20170120" />
[f653b03]2304           -->
2305            <!-- libjstl1.1-java or glassfish-javaee -->
[1af23a4]2306          <!--
[f653b03]2307            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/jstl.jar" />
[1af23a4]2308           -->
[f653b03]2309            <!-- libjakarta-taglibs-standard-java or glassfish-javaee -->
2310            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/standard.jar" />
2311            <!-- anything added above, add in debian-release-tarball also -->
2312        </delete>
2313        <tar longfile="gnu" destfile="../${debian.tarball.name}" compression="bzip2">
2314            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${Extended.Version}">
2315                <include name="**/**" />
2316                <exclude name="debian/**"/>
2317                <exclude name="debian-alt/**"/>
2318                <exclude name="**/*.sh"/>
2319                <exclude name="installer/resources/geoip.txt"/>
2320                <exclude name="installer/resources/geoipv6.dat.gz"/>
2321          <!--
2322                <exclude name="apps/jetty/jetty-distribution-*/**"/>
2323           -->
[d8d0414]2324          <!--
[f653b03]2325                <exclude name="apps/susidns/src/lib/jstl.jar" />
[d8d0414]2326           -->
[f653b03]2327                <exclude name="apps/susidns/src/lib/standard.jar" />
2328                <!-- anything added above, add in debian-release-tarball also -->
2329            </tarfileset>
2330            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${Extended.Version}" filemode="755">
2331                <exclude name="debian/**" />
2332                <include name="**/*.sh" />
2333            </tarfileset>
[3396626a]2334        </tar>
2335    </target>
2336
[17b1d524]2337    <!-- same as debian-tarball but with a release tar.bz2 file name and tar prefix -->
2338    <target name="debian-release-tarball" depends="getExtendedVersion">
2339        <!-- this will use the monotonerc file in the current workspace -->
2340        <fail message="This target cannot be used without Monotone! Use &quot;fakeroot debian/rules get-orig-source&quot; instead.">
2341            <condition>
2342                <not>
2343                    <isset property="mtn.available" />
2344                </not>
2345            </condition>
2346        </fail>
2347        <property name="debian.tarball.name" value="i2p_${release.number}.orig.tar.bz2" />
2348        <echo message="Checking out fresh copy into ../i2p-${Extended.Version} for tarballing:" />
2349        <delete dir="../i2p-${Extended.Version}" />
2350        <exec executable="mtn" failonerror="true">
2351            <arg value="co" />
2352            <!-- w: is the revision of the current workspace -->
2353            <arg value="-r" />
2354            <arg value="w:" />
[bfbd159]2355            <arg value="-b" />
2356            <arg value="i2p.i2p" />
[17b1d524]2357            <arg value="../i2p-${Extended.Version}" />
2358        </exec>
[ec6c244]2359        <delete includeemptydirs="true" quiet="false" failonerror="false">ilonerror="false">
[17b1d524]2360            <fileset dir="../i2p-${Extended.Version}/debian-alt/" />
2361            <fileset dir="../i2p-${Extended.Version}/installer/lib/" />
2362            <fileset dir="../i2p-${Extended.Version}/Slackware" />
2363            <fileset dir="../i2p-${Extended.Version}/_MTN" />
[f2239ba]2364            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/gettext" />
[c3f5c04]2365            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/getopt" />
[1754240]2366          <!--
[2fe1f97]2367            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/apache/http" />
[1754240]2368           -->
[e2f048b]2369            <file name="../i2p-${Extended.Version}/installer/resources/geoip.txt" />
2370            <file name="../i2p-${Extended.Version}/installer/resources/geoipv6.dat.gz" />
[b72085bc]2371            <fileset dir="../i2p-${Extended.Version}/apps/jetty/jetty-distribution-9.2.21.v20170120" />
[d8d0414]2372          <!--
[094cf14]2373            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/jstl.jar" />
[d8d0414]2374           -->
[094cf14]2375            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/standard.jar" />
[e2f048b]2376            <!-- anything added above, add in debian-tarball also -->
[17b1d524]2377        </delete>
2378        <tar longfile="gnu" destfile="../${debian.tarball.name}" compression="bzip2">
2379            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${release.number}">
2380                <include name="**/**" />
2381                <exclude name="debian/**"/>
2382                <exclude name="debian-alt/**"/>
2383                <exclude name="**/*.sh"/>
[e2f048b]2384                <exclude name="installer/resources/geoip.txt"/>
2385                <exclude name="installer/resources/geoipv6.dat.gz"/>
[d6b1f81]2386                <exclude name="apps/jetty/jetty-distribution-*/**"/>
[d8d0414]2387          <!--
[094cf14]2388                <exclude name="apps/susidns/src/lib/jstl.jar" />
[d8d0414]2389           -->
[094cf14]2390                <exclude name="apps/susidns/src/lib/standard.jar" />
[e2f048b]2391                <!-- anything added above, add in debian-tarball also -->
[17b1d524]2392            </tarfileset>
2393            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${release.number}" filemode="755">
2394                <exclude name="debian/**" />
2395                <include name="**/*.sh" />
2396            </tarfileset>
2397        </tar>
2398    </target>
2399
[3396626a]2400    <target name="debian-patch" depends="getExtendedVersion" >
[b6fab82]2401        <exec executable="quilt" failonerror="true">
2402            <arg value="-a" />
2403            <arg value="push" />
[4186894]2404        </exec>
2405        <echo message="====================" />
[b6fab82]2406    </target>
2407    <target name="debian-unpatch" depends="buildProperties">
2408        <exec executable="quilt" failonerror="false">
[84e4558]2409            <arg value="-a" />
2410            <arg value="pop" />
[4186894]2411        </exec>
2412    </target>
[b6fab82]2413
[d64a2b0]2414    <target name="debianrepo" depends="debian">
[ab432e1]2415        <exec dir="debian" executable="./makerepo.sh" failonerror="true"/>
[d64a2b0]2416    </target>
[ac79049]2417
[370be48]2418<!-- the following are appened to help build barebone portable version,
[c212eac]2419     none of the above is modified for this purpose -->
2420        <target name = "pkg-portable-clean">
2421                <delete dir="build/" />
[afb3c76]2422                <delete dir="pkg-temp/" />
[c212eac]2423                <delete>
2424                        <fileset dir="." includes="portable-**.zip**" />
2425                </delete>
2426        </target>
2427<!-- build a portable archive -->
[afb3c76]2428
[370be48]2429<!-- *0* Since we simply pack all files in folder "build/" into our archieve,
[afb3c76]2430                we need to make sure its small, with NO redundent jars or wars.
2431                thus cleaning is required before each build-->
2432        <target name="buildSmallOnly" depends="pkg-portable-clean,buildSmall"/>
[18119890]2433
[c212eac]2434<!-- *1* preparing the jars by OS dependent de-bloating -->
[18119890]2435        <target name="preppkg-portable-win32-jbigi" depends="buildSmallOnly, jbigi-windows-only" />
2436
2437        <target name="preppkg-portable-linux-jbigi"  depends="buildSmallOnly, jbigi-linux-only" />
[afb3c76]2438
2439<!-- *2* os independent procedure  -->
[c212eac]2440        <target name="preppkg-portable-basic" >
[afb3c76]2441                <mkdir dir="pkg-temp" />
[c212eac]2442                        <!-- non OS dependent configurations only, dont add *nux/win stuff here -->
[afb3c76]2443                        <copy todir="pkg-temp">
[c212eac]2444                                <fileset dir="installer/resources/portable/configs/" />
2445                        </copy>
[afb3c76]2446                        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
2447                        <copy file="installer/resources/hosts.txt" todir="pkg-temp/" />
2448                        <copy file="installer/resources/readme.license.txt" todir="pkg-temp/" />
2449                <mkdir dir="pkg-temp/addressbook" />
2450                        <copy file="apps/addressbook/subscriptions.txt" todir="pkg-temp/addressbook/" />
2451                        <copy file="apps/addressbook/myhosts.txt"  todir="pkg-temp/addressbook/" />
[c212eac]2452                        <!-- config.txt is in installer/resources/portable -->
[afb3c76]2453                <mkdir dir="pkg-temp/docs" />
[2fc09679]2454                        <copy file="installer/resources/initialNews/initialNews.xml" tofile="pkg-temp/docs/news.xml" overwrite="true" />
[afb3c76]2455                        <copy file="installer/resources/readme/readme.html" tofile="pkg-temp/docs/readme.html" />
2456                        <copy file="installer/resources/startconsole.html" todir="pkg-temp/docs/" />
2457                        <copy file="installer/resources/start.ico" todir="pkg-temp/docs/" />
2458                        <copy file="installer/resources/console.ico" todir="pkg-temp/docs/" />
2459                        <!-- HTTP Header files, english only,
[9f3bcc2]2460                                if you need a different lang do it in a seperate target -->
[afb3c76]2461                        <copy todir="pkg-temp/docs/" >
[c212eac]2462                                <fileset dir="installer/resources/proxy/"  includes="**-header.ht" />
2463                        </copy>
[afb3c76]2464                        <!-- Theme light only -->
2465                        <copy todir="pkg-temp/docs/themes/console/light/" overwrite="true" >
[c212eac]2466                                <fileset dir="installer/resources/themes/console/light/" includes="**.css" />
2467                        </copy>
[a2a406f]2468                        <copy file="installer/resources/themes/console/light/console_big.css" todir="portable/docs/themes/console/light/" />
[afb3c76]2469                        <copy todir="pkg-temp/docs/themes/console/images/" >
[c212eac]2470                                <fileset dir="installer/resources/themes/console/images/" />
2471                        </copy>
[afb3c76]2472                        <!-- FLAGs for language icon (not for ip)-->
2473                        <copy todir="pkg-temp/docs/icons/flags" >
[c212eac]2474                                <fileset dir="installer/resources/icons/flags/" includes="cn.png,de.png,fr.png,nl.png,ru.png,se.png,us.png" />
2475                        </copy>
[afb3c76]2476                <mkdir dir="pkg-temp/webapps" />
2477                        <copy todir="pkg-temp/webapps/">
[c212eac]2478                                <fileset dir="build/" includes="**.war" />
2479                        </copy>
[afb3c76]2480                <mkdir dir="pkg-temp/lib" />
2481                        <copy todir ="pkg-temp/lib/" >
2482                                <fileset dir="build/" includes="**.jar" />
2483                        </copy>
2484                        <!-- 3rd party jars from apps/  -->
2485                                <!-- jrobin - without jobin , you lost graph and get a lot error entry in logs -->
[ef26acc]2486                        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
[c212eac]2487        </target>
2488<!-- *3* os dependent procedure/commands -->
[afb3c76]2489        <target name = "preppkg-portable-win32" depends="preppkg-portable-win32-jbigi,preppkg-portable-basic">
[c212eac]2490                        <!--wrapper - dont even think about it. i2p cosumes appreantly more mem without it on win32-->
[afb3c76]2491                <copy file="installer/lib/wrapper/win32/wrapper.dll" todir="pkg-temp/lib" />
[b2e8d3c]2492                <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
[afb3c76]2493                <copy file="installer/lib/wrapper/win32/I2Psvc.exe" tofile="pkg-temp/i2psvc.ex_" />
2494                        <!--  copy the unpack/start batchfiles -->
2495                <copy todir="pkg-temp">
[c212eac]2496                        <fileset dir="installer/resources/portable/win32/" />
2497                </copy>
2498        </target>
[afb3c76]2499<!-- *4* command for windows package -->
2500        <target name = "pkg-portable-win32"     depends="preppkg-portable-win32, pack200" >
2501                <!-- i need the portable\ folder in .zip so basedir is set to . -->
2502                <move file="pkg-temp" tofile="portable"/>
2503                <zip destfile="portable-win32.zip" basedir="." level="9" includes="portable\**" />
2504                <checksum file="portable-win32.zip" forceOverwrite="yes"/>
2505                <move file="portable" tofile="pkg-temp"/>
2506        </target>
[77bd69c]2507</project>
Note: See TracBrowser for help on using the repository browser.