Newer
Older
<equals arg1="${release.number}" arg2=""/>
</or>
</condition>
</fail>
<fail message="Non-zero build number: ${i2p.build.number}" >
<equals arg1="${i2p.build.number}" arg2="0"/>
</not>
</condition>
</fail>
<fail message="Non-empty extra build: ${build.extra}" >
<condition>
<not>
<equals arg1="${build.extra}" arg2=""/>
</not>
</condition>
</fail>
</target>
<target name="-pre-sign">
<!-- if you're distributing su3 files to others, at a minimum you should set these -->
<fail message="javac.compilerargs must contain a -bootclasspath option in override.properties">
<condition>
<not><contains string="${javac.compilerargs}" substring="-bootclasspath"/></not>
</condition>
</fail>
<fail message="javac.compilerargs7 must contain a -bootclasspath option in override.properties">
<condition>
<not><contains string="${javac.compilerargs7}" substring="-bootclasspath"/></not>
</condition>
</fail>
<fail message="build.built-by must be set in override.properties">
<condition>
<equals arg1="${build.built-by}" arg2="unknown"/>
</condition>
</fail>
<fail message="require.gettext must be true">
<condition>
<not><equals arg1="${require.gettext}" arg2="true"/></not>
</condition>
</fail>
<target name="-pre-release" depends="-pre-sign, failIfNoMtn">
<echo message="================================================================" />
<echo message="Did you update these files?" />
<exec executable="ls" failonerror="true">
<arg value="-l" />
<arg value="history.txt" />
<arg value="installer/install.xml" />
<arg value="core/java/src/net/i2p/CoreVersion.java" />
<arg value="router/java/src/net/i2p/router/RouterVersion.java" />
</exec>
<echo message="Everything is checked in, right? Let's be sure:" />
<exec executable="mtn" failonerror="true">
<arg value="st" />
</exec>
<echo message="If there are any modified files above, stop now!" />
<echo message="================================================================" />
<sleep seconds="3"/>
</target>

jrandom
committed
<target name="clean" depends="pkgclean" >
<delete dir="./reports" />
<delete file="installer/lib/izpack/patches.jar" failonerror="false" quiet="true" />
<delete dir="installer/lib/izpack5/patches/java/build" quiet="true" />
<delete file="syndie-standalone.zip" failonerror="false" quiet="true" />
<delete file="i2psnark-standalone.zip" failonerror="false" quiet="true" />
<delete file="BOB-one.jar" failonerror="false" quiet="true" />
<delete file="core/java/cobertura.ser"/>
<delete file="javadoc.zip" />
<delete file="i2p.fba" />
<delete file="${sloccount.report.file}" />
<delete file="mavencentral-router.jar" />
<delete file="mavencentral-mstreaming.jar" />
<delete file="mavencentral-streaming.jar" />
<delete file="mavencentral-servlet-i2p.jar" />
<target name="distclean" depends="clean">
<delete failonerror="false" quiet="true">
<fileset dir="." includes="i2pinstall* *.deb i2p_*.bz2 i2pupdate* i2psource* *.sig *.torrent" />
<ant dir="core/java/" target="distclean" />
<ant dir="router/java/" target="distclean" />
<ant dir="installer/java" target="distclean" />
<ant dir="apps/ministreaming/java/" target="distclean" />
<ant dir="apps/i2ptunnel/java/" target="distclean" />
<ant dir="apps/sam/java/" target="distclean" />

sponge
committed
<ant dir="apps/BOB" target="clean" />
<ant dir="apps/desktopgui" target="clean" />

jrandom
committed
<ant dir="apps/routerconsole/java/" target="distclean" />
<ant dir="apps/systray/java/" target="distclean" />
<ant dir="apps/jetty/" target="distclean" />
<ant dir="apps/imagegen/" target="distclean" />
<ant dir="apps/jrobin/java" target="distclean" />
<delete dir="core/c/jbigi/bin" />
<delete dir="core/c/jbigi/lib" />
<delete dir="core/c/jcpuid/lib" />
<ant dir="installer/resources/locale" target="distclean" />
<ant dir="installer/tools/java" target="distclean" />
<delete dir="installer/lib/izpack5/patches/java/build" quiet="true" />
NOTE! We need to turn off the default excludes for these
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
These are the defaultexcludes in Ant as seen on
http://ant.apache.org/manual/CoreTasks/defaultexcludes.html
**/*~
**/#*#
**/.#*
**/%*%
**/._*
**/CVS
**/CVS/**
**/.cvsignore
**/SCCS
**/SCCS/**
**/vssver.scc
**/.svn
**/.svn/**
**/.DS_Store
The only recourse is to remove the offending ones.
We do this here, as we only need one change, and then put it
back after we are done with it.
-->
<defaultexcludes remove="**/*~"/>
<fileset dir="." includes="**/*.class **/*.java~ **/*.txt~ **/*.xml~ **/*.sh~ **/*.SlackBuild~" />
Less common, but they pollute my workspace here, so we
might as well nuke these as well. Are there any others?
!!??? Why don't we just nuke "**/*~" ???!!
++Sponge
-->
<!--
Now we put the defaults back
-->
<defaultexcludes default="true"/>
<target name="webappDistclean">
<ant dir="apps/i2ptunnel/java/" target="distclean" />
<ant dir="apps/routerconsole/java/" target="distclean" />
<ant dir="apps/addressbook/" target="distclean" />
<ant dir="apps/susimail/" target="distclean" />
<ant dir="apps/susidns/src/" target="distclean" />
<ant dir="apps/i2psnark/java/" target="distclean" />
<ant dir="apps/imagegen/" target="distclean" />
<target name="pkg" depends="distclean, updater, preppkg, installer" />
<target name="pkg200" depends="distclean, updater200, preppkg, installer" />
<target name="pkgclean" depends="deletepkg-temp">
<fileset dir="." includes="i2p.tar.bz2 install.jar i2pupdate.zip i2pupdate200.zip" />
<target name="preppkg" depends="preppkg-linux, preppkg-freebsd, preppkg-osx, preppkg-windows, jbigi">
<copy file="build/jbigi.jar" todir="pkg-temp/lib" />
<fileset dir="installer/lib/wrapper/solaris/" excludes="*.txt" />
<!-- Force using the new wrapper.jar.
The new jar with the old windows binaries will output a warning on windows.
We do not generate release files from this target.
See preppkg-windows-only target below.
-->
<copy overwrite="true" file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
<target name="preppkg-nowindows" depends="preppkg-linux, preppkg-freebsd, preppkg-osx, jbigi-nowindows">
<copy file="build/jbigi.jar" todir="pkg-temp/lib" />
<copy todir="pkg-temp/lib/wrapper/solaris/">
<fileset dir="installer/lib/wrapper/solaris/" excludes="*.txt" />
<copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
<target name="preppkgRepack" depends="preppkg-linux, preppkg-freebsd, preppkg-osx, preppkg-windows, jbigi">
<ant target="repack200" />
<!-- no use doing repack200 on jbigi.jar -->
<copy file="build/jbigi.jar" todir="pkg-temp/lib" />
<copy todir="pkg-temp/lib/wrapper/solaris/">
<fileset dir="installer/lib/wrapper/solaris/" excludes="*.txt" />
</copy>
</target>
<target name="preppkg-freebsd" depends="preppkg-unix">
<copy todir="pkg-temp/lib/wrapper/freebsd/">
<fileset dir="installer/lib/wrapper/freebsd/" excludes="*.txt" />
<copy todir="pkg-temp/lib/wrapper/freebsd64/">
<fileset dir="installer/lib/wrapper/freebsd64" excludes="*.txt" />
<target name="preppkg-freebsd-only" depends="preppkg-freebsd, jbigi-freebsd-only" >
<copy file="build/jbigi.jar" todir="pkg-temp/lib" />
<copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
</target>
<target name="preppkg-linux-only" depends="preppkg-linux, jbigi-linux-only" >
<copy file="build/jbigi.jar" todir="pkg-temp/lib" />
<copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
<target name="preppkg-unix" depends="preppkg-base, prep-script-translation" >
<copy file="installer/resources/runplain.sh" todir="pkg-temp/" />
<copy file="installer/resources/eepget" todir="pkg-temp/" />
<copy file="installer/resources/i2prouter" todir="pkg-temp/" />
<copy file="installer/resources/osid" todir="pkg-temp/" />
<copy file="installer/resources/postinstall.sh" todir="pkg-temp/" />
<copy todir="pkg-temp/man/">
<fileset dir="installer/resources/man/" />
</copy>
</target>
<target name="preppkg-linux" depends="preppkg-linux-x86,preppkg-linux-nonx86" />
<target name="preppkg-linux-x86" depends="preppkg-unix">
<fileset dir="installer/lib/wrapper/linux/" excludes="*.txt" />
</copy>
<copy todir="pkg-temp/lib/wrapper/linux64/">
<fileset dir="installer/lib/wrapper/linux64/" excludes="*.txt" />
<target name="preppkg-linux-nonx86" depends="preppkg-unix">
<copy todir="pkg-temp/lib/wrapper/linux-ppc/">
<fileset dir="installer/lib/wrapper/linux-ppc/" excludes="*.txt" />
</copy>
<copy todir="pkg-temp/lib/wrapper/linux-armv5/">
<fileset dir="installer/lib/wrapper/linux-armv5/" excludes="*.txt" />
<copy todir="pkg-temp/lib/wrapper/linux-armv6/">
<fileset dir="installer/lib/wrapper/linux-armv6/" excludes="*.txt" />
</copy>
<target name="preppkg-osx" depends="preppkg-unix">
<!--<copy file="installer/resources/I2P Router Console.webloc" todir="pkg-temp/" />-->
<copy todir="pkg-temp/Start I2P Router.app">
<fileset dir="installer/resources/Start I2P Router.app" />
</copy>
<copy todir="pkg-temp/lib/wrapper/macosx/">
<fileset dir="installer/lib/wrapper/macosx/" excludes="*.txt" />
<copy file="installer/resources/net.i2p.router.plist.template" todir="pkg-temp/" />
<copy file="installer/resources/install_i2p_service_osx.command" todir="pkg-temp/" />
<copy file="installer/resources/uninstall_i2p_service_osx.command" todir="pkg-temp/" />
<target name="preppkg-osx-only" depends="preppkg-osx, jbigi-osx-only" >
<copy file="build/jbigi.jar" todir="pkg-temp/lib" />
<copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
<target name="preppkg-windows" depends="preppkg-base, preplicenses-windows, buildUtilityJar, buildexe">
<copy file="build/i2p.exe" todir="pkg-temp/" failonerror="false" />
<copy file="installer/resources/eepget.bat" todir="pkg-temp/" />
<copy file="installer/resources/i2prouter.bat" todir="pkg-temp/" />
<copy file="installer/resources/fixperms.bat" todir="pkg-temp/" />
<copy file="installer/resources/install_i2p_service_winnt.bat" todir="pkg-temp/" />
<copy file="installer/resources/set_config_dir_for_nt_service.bat" todir="pkg-temp/" />
<copy file="installer/resources/uninstall_i2p_service_winnt.bat" todir="pkg-temp/" />
<copy file="build/utility.jar" todir="pkg-temp" />
<copy todir="pkg-temp/lib/wrapper/win32/">
<fileset dir="installer/lib/wrapper/win32/" excludes="*.txt" />
<copy todir="pkg-temp/lib/wrapper/win64/">
<fileset dir="installer/lib/wrapper/win64/" excludes="*.txt" />
</copy>
</target>
<target name="preppkg-windows-only" depends="preppkg-windows, jbigi-windows-only">
<copy file="build/jbigi.jar" todir="pkg-temp/lib" />
<!-- Win binaries are down-rev from the others, so use the old jar.
This will not overwrite, so preppkg (for all OSes) will get the new jar with
the old binaries, which will probably work but will output a warning.
The windows-only installer will get the correct jar.
<copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
-->
<copy overwrite="true" file="installer/lib/wrapper/win-all/wrapper.jar" todir="pkg-temp/lib" />
<target name="preppkg-base" depends="build, preplicenses, prepConsoleDocs, prepthemeupdates, prepCertificates, prepRouterInfos, copyjetty, copytomcat-unlesspkg, copyjstl-unlesspkg, copystandard-unlesspkg, copyflags, truncatehistory">
<!-- if updater200 was run previously, it left *.pack files in pkg-temp -->
<!-- Also remove deletelist.txt used for updater only -->
<fileset dir="pkg-temp" includes="**/*.jar.pack **/*.war.pack deletelist.txt" />
<copy file="build/i2p.jar" todir="pkg-temp/lib/" />
<copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
<copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
<copy file="build/router.jar" todir="pkg-temp/lib/" />
<copy file="build/desktopgui.jar" todir="pkg-temp/lib/" />
<copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
<!-- Updated in 0.9.28; name without version so we can overwrite if we upgrade -->
<copy file="build/sam.jar" todir="pkg-temp/lib/" />

sponge
committed
<copy file="build/BOB.jar" todir="pkg-temp/lib/" />
<copy file="build/systray.jar" todir="pkg-temp/lib" />
<copy file="build/i2ptunnel.war" todir="pkg-temp/webapps/" />
<copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
<copy file="build/addressbook.jar" todir="pkg-temp/lib/" />
<copy file="build/susimail.war" todir="pkg-temp/webapps/" />
<copy file="build/susidns.war" todir="pkg-temp/webapps/" />
<copy file="build/imagegen.war" todir="pkg-temp/webapps/" />
<copy file="build/jsonrpc.war" todir="pkg-temp/webapps/" />
<copy file="build/i2psnark.war" todir="pkg-temp/webapps/" />
<copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />

jrandom
committed
<copy file="installer/resources/clients.config" todir="pkg-temp/" />
<copy file="installer/resources/i2ptunnel.config" todir="pkg-temp/" />
<copy file="installer/resources/wrapper.config" todir="pkg-temp/" />
<copy file="installer/resources/hosts.txt" todir="pkg-temp/" />
<mkdir dir="pkg-temp/scripts" />
<copy file="apps/proxyscript/i2pProxy.pac" todir="pkg-temp/scripts/" />
<copy file="installer/resources/startconsole.html" todir="pkg-temp/docs/" />
<copy file="installer/resources/start.ico" todir="pkg-temp/docs/" />
<copy file="installer/resources/console.ico" todir="pkg-temp/docs/" />
<copy file="installer/resources/uninstall.ico" todir="pkg-temp/docs/" />
<copy todir="pkg-temp/eepsite/" >
<fileset dir="installer/resources/eepsite/" excludes="**/.placeholder" />
<copy file="installer/resources/themes/console/images/favicon.ico" tofile="pkg-temp/eepsite/docroot/favicon.ico" />
</target>
<target name="copyflags" depends="copyflags-unlesspkg" >
<copy todir="pkg-temp/eepsite/docroot/help/lib/" >
<fileset dir="installer/resources/icons/flags16x11" includes="lang_ar.png" />
</copy>
</target>
<target name="copyflags-unlesspkg" unless="${with-famfamfam-flag-png}" >
<fileset dir="installer/resources/icons/flags/" includes="az.png cn.png de.png es.png fr.png hu.png id.png ir.png it.png jp.png nl.png pl.png pt.png ro.png ru.png se.png tr.png us.png" />
<copy todir="pkg-temp/docs/icons/flags" >
<!-- base flags/ dir only. flags16x11/ dir already copied by prepConsoleDocs target -->
<fileset dir="installer/resources/icons/flags" />
</copy>
<target name="copyjetty" depends="copyjetty-unlesspkg" >
<target name="copyjetty-unlesspkg" unless="${with-libjetty9-java}" >
<fileset dir="build" includes="javax.servlet.jar jetty*.jar org.mortbay.*.jar" excludes="jetty-i2p.jar" />
<target name="settomcatprop" >
<condition property="with-libtomcat-java" >
<or>
<istrue value="${with-libtomcat6-java}" />
<istrue value="${with-libtomcat7-java}" />
<istrue value="${with-libtomcat8-java}" />
<istrue value="${with-libtomcat9-java}" />
</or>
</condition>
</target>
<target name="copytomcat-unlesspkg" depends="settomcatprop" unless="${with-libtomcat-java}" >
<copy todir="pkg-temp/lib" >
<fileset dir="build" includes="commons*.jar jasper*.jar javax*.jar" />
</copy>
</target>
jstl.jar
glassfish-javaee.jar has ancient and conflicting classes, e.g. javax.mail,
and libjstl1.1-java isn't sufficient,
so we only skip it with libtaglibs-standard
<target name="copyjstl-unlesspkg" unless="${with-libtaglibs-standard}" >
<!-- standard.jar -->
<target name="copystandard-unlesspkg" depends="copystandard-unlesspkg1, copystandard-unlesspkg2" />
<target name="copystandard-unlesspkg1" >
<condition property="with-any-standard-pkg" >
<or>
<istrue value="${with-libtaglibs-standard}" />
<istrue value="${with-glassfish-javaee}" />
<istrue value="${libjakarta-taglibs-standard-java}" />
</or>
</condition>
</target>
<target name="copystandard-unlesspkg2" unless="${with-any-standard-pkg}" >
<copy file="LICENSE.txt" todir="pkg-temp/" />
<copy todir="pkg-temp/licenses/" >
<fileset dir="licenses/" />
</copy>
<copy file="apps/imagegen/identicon/README.md" tofile="pkg-temp/licenses/LICENSE-Identicon.txt" />
<copy file="apps/desktopgui/LICENSE" tofile="pkg-temp/licenses/LICENSE-DesktopGUI.txt" />
<target name="preplicenses-unlesspkg" depends="settomcatprop" unless="${with-libtomcat-java}" >
<copy file="apps/jetty/apache-tomcat-${tomcat.ver}/NOTICE" tofile="pkg-temp/licenses/NOTICE-Tomcat.txt" />
<!-- DOES include launch4j licenses for Windows builds -->
<target name="preplicenses-windows" depends="preplicenses">
<!--
The license in launch4j/ is a BSD license for launch4j
The license in launch4j/head is a MIT license for the code that is actually wrapped around the jars
So we include the MIT one in our binary package
-->
<copy file="installer/lib/launch4j/head/LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-Launch4j.txt" />
<!-- Not sure if these are used or should be included -->
<copy file="installer/lib/launch4j/lib/foxtrot.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-Foxtrot.txt" />
<copy file="installer/lib/launch4j/lib/JGoodies.Forms.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-JGoodies-Forms.txt" />
<copy file="installer/lib/launch4j/lib/JGoodies.Looks.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-JGoodies-Looks.txt" />
<copy file="installer/lib/launch4j/lib/XStream.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-XStream.txt" />
<target name="prepthemeupdates">
<copy todir="pkg-temp/docs/themes/" >
<fileset dir="installer/resources/themes/" />
<copy todir="pkg-temp/certificates/" >
<fileset dir="installer/resources/certificates/" />
<java classname="net.i2p.crypto.CertUtil" fork="true" failonerror="true">
<classpath>
<pathelement location="build/i2p.jar" />
</classpath>
<arg value="checkall" />
<arg value="pkg-temp/certificates" />
</java>
</target>
<condition property="no.bundle.routerInfos">
<isfalse value="${bundle.routerInfos}" />
</condition>
<target name="prepRouterInfos" depends="buildrouter, buildTools" unless="no.bundle.routerInfos">
<mkdir dir="pkg-temp/netDb" />
<java classname="net.i2p.router.networkdb.kademlia.BundleRouterInfos" fork="true" failonerror="true">
<classpath>
<pathelement location="build/i2p.jar" />
<pathelement location="core/java/build/gnu-getopt.jar" />
<pathelement location="build/router.jar" />
<pathelement location="build/tools.jar" />
</classpath>
<arg value="-i" />
<arg value="${bundle.routerInfos.i2pConfigDir}" />
<arg value="-o" />
<arg value="pkg-temp/netDb" />
<arg value="-c" />
<arg value="${bundle.routerInfos.count}" />
</java>
</target>
<target name="-areRouterInfosEnabled">
<fail message="Option requires "bundle.routerInfos" to be configured. Please read "build.properties" for more info." >
<condition>
<isfalse value="${bundle.routerInfos}" />
</condition>
</fail>
</target>
<target name="i2pseeds" depends="-setepoch, -areRouterInfosEnabled, prepRouterInfos">
<delete file="i2pseeds.zip" />
<delete file="i2pseeds.su3" />
<zip destfile="i2pseeds.zip" basedir="pkg-temp/netDb" whenempty="fail" />
<su3sign infile="i2pseeds.zip" sigtype="RESEED" outfile="i2pseeds.su3" su3.ver="${epoch}" />
<!-- this is no longer required, izpack 4.3.0 supports headless installs with java -jar i2pinstall.exe -console -->
<!-- and this is no longer used by the SlackBuild -->
<target name="tarball" depends="preppkg">
<tar compression="bzip2" destfile="i2p.tar.bz2">
<tarfileset dir="pkg-temp" includes="**/*" prefix="i2p" />
</tar>
</target>
<target name="deletepkg-temp">
<!-- readme and proxy error page files, initialNews.xml files, GeoIP files, and flag icons -->
<target name="prepConsoleDocs" depends="prepConsoleDocUpdates, prepgeoupdate" >
<copy todir="pkg-temp/docs/initialNews/">
<fileset dir="installer/resources/initialNews/" />
</copy>
<!-- ensure the proxy files have the correct line endings -->
<fixcrlf srcdir="pkg-temp/docs" includes="*.ht" encoding="utf8" eol="crlf" />
<!-- readme and proxy error page files -->
<target name="prepConsoleDocUpdates">
<fileset dir="installer/resources/readme/" includes="readme*.html" />
<fileset dir="installer/resources/proxy/" includes="*.ht" />
<!--
As of 0.9.36:
All new and changed flags must go in the flags16x11/ dir,
which will be checked first by flags.jsp.
The flags/ dir is the original set from famfamfam,
which may be symlinked in package installs.
-->
<fileset dir="installer/resources/" includes="icons/flags16x11/*" />
<target name="consoleDocs" depends="deletepkg-temp, prepConsoleDocs">
<zip destfile="docs.zip" basedir="pkg-temp" whenempty="fail" />
</target>
<target name="copyJavadoc" depends="javadoc">
<copy todir="pkg-temp/docs/javadoc" >
<fileset dir="build/javadoc/" />
</copy>
</target>
<target name="updater200" depends="prepupdate, preplicenses, pack200, zipit200" />
<target name="updater200WithJetty" depends="prepjupdate, preplicenses, pack200, zipit200" />
<target name="updater200WithJettyAndJbigi" depends="prepjupdate, prepjbigiupdate, preplicenses, pack200, zipit200" />
<target name="updater200WithJettyAndGeoIP" depends="prepjupdate, prepgeoupdate, preplicenses, pack200, zipit200" />
<target name="updater200WithJettyFixes" depends="prepjupdatefixes, preplicenses, pack200, zipit200" />
<target name="updater200WithJettyFixesAndJbigi" depends="prepjupdatefixes, prepjbigiupdate, preplicenses, pack200, zipit200" />
<target name="updater200WithJbigi" depends="prepupdate, prepjbigiupdate, preplicenses, pack200, zipit200" />
<target name="updater" depends="prepupdate, preplicenses, zipit" />
<target name="updaterRepack" depends="prepupdate, preplicenses, repack200, zipit" />
<target name="updaterWithJavadoc" depends="prepupdate, preplicenses, copyJavadoc, zipit" />
<target name="updater200WithJavadoc" depends="prepupdate, preplicenses, copyJavadoc, pack200, zipit200" />
<target name="updaterWithJavadocAndJetty" depends="prepjupdate, preplicenses, copyJavadoc, zipit" />
<target name="updater200WithJavadocAndJetty" depends="prepjupdate, preplicenses, copyJavadoc, pack200, zipit200" />
<target name="updaterWithGeoIP" depends="prepupdate, prepgeoupdate, preplicenses, zipit" />
<target name="updaterWithJetty" depends="prepjupdate, preplicenses, zipit" />
<target name="updaterWithJettyAndGeoIP" depends="prepjupdate, prepgeoupdate, preplicenses, zipit" />
<target name="updaterWithJettyAndJbigi" depends="prepjupdate, prepjbigiupdate, preplicenses, zipit" />
<target name="updaterWithJettyRepack" depends="prepjupdate, preplicenses, repack200, zipit" />
<target name="updaterWithJettyAndJbigiRepack" depends="prepjupdate, prepjbigiupdate, preplicenses, repack200, zipit" />
<target name="updaterWithJettyAndGeoIPRepack" depends="prepjupdate, prepgeoupdate, preplicenses, repack200, zipit" />
<target name="updaterWithJettyFixes" depends="prepjupdatefixes, preplicenses, zipit" />
<target name="updaterWithJettyFixesAndJbigi" depends="prepjupdatefixes, prepjbigiupdate, preplicenses, zipit" />
<target name="updaterWithJettyFixesAndGeoIP" depends="prepjupdatefixes, prepgeoupdate, preplicenses, zipit" />
<target name="updaterWithJbigi" depends="prepupdate, prepjbigiupdate, preplicenses, zipit" />
<target name="updaterSmall" depends="prepupdateSmall, zipit" />
<target name="updaterRouter" depends="prepupdateRouter, zipit" />
<su3sign infile="i2pupdate200.zip" sigtype="ROUTER" outfile="i2pupdate.su3" su3.ver="${full.version}" />
<target name="signed-updater200" depends="-pre-sign, updater200, -sign-update" />
<target name="signed-updater200WithJetty" depends="-pre-sign, updater200WithJetty, -sign-update" />
<target name="signed-updater200WithJettyAndGeoIP" depends="-pre-sign, updater200WithJettyAndGeoIP, -sign-update" />
<target name="signed-updater200WithJavadoc" depends="-pre-sign, updater200WithJavadoc, -sign-update" />
<target name="signed-updater200WithJavadocAndJetty" depends="-pre-sign, updater200WithJavadocAndJetty, -sign-update" />
<!--
As of release 0.8.8, the router will enforce a zipfile comment equal to the
version number in the sud/su2 header, since the version in the header is NOT
covered by the signature.
-->
<zip destfile="i2pupdate.zip" basedir="pkg-temp" whenempty="fail" comment="${release.number}" />
<!-- just a test, makes almost no difference
<tar destfile="i2pupdate.tgz" basedir="pkg-temp" compression="gzip" />
<tar destfile="i2pupdate.tbz" basedir="pkg-temp" compression="bzip2" />
-->
</target>
<target name="zipit200" depends="getReleaseNumber" >
<zip destfile="i2pupdate200.zip" basedir="pkg-temp" whenempty="fail" comment="${release.number}" />
<target name="pack200">
<!-- pack200 will only pack to a .pack file, and only from a .jar file, so we put another .jar on the end -->
<!-- can't pack an empty jar or one without classes, it will fail to unpack on Java 5;
- see http://bugs.sun.com/view_bug.do?bug_id=6712743
-->
<!-- *nix here -->
<exec executable="sh" osfamily="unix" failonerror="true">
<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" />
<exec executable="sh" osfamily="mac" failonerror="true">
<arg value="-c" />
<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" />
<!-- windoz here : i admit, i hate escaped symbols in xml, indeed = =! -->
<exec executable="cmd" osfamily="windows" failonerror="true">
<arg value="/c" />
<!-- TODO implement fix above -->
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
<arg value="for %i in (pkg-temp\webapps\*.war) do move %i %i.jar && pack200 -g pkg-temp\webapps\%~ni.war.pack %i.jar && del %i.jar" />
</exec>
<exec executable="cmd" osfamily="windows" failonerror="true">
<arg value="/c" />
<arg value="for %i in (pkg-temp\lib\*.jar) do pack200 -g %i.pack %i && del %i" />
</exec>
</target>
<!-- saves about 1% on average (more on jars with multiple compiled po files since they have lots of common strings) -->
<target name="repack200">
<!-- pack200 will only repack a .jar file, so we put another .jar on the end -->
<!-- *nix here -->
<exec executable="sh" osfamily="unix" failonerror="true">
<arg value="-c" />
<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" />
</exec>
<exec executable="sh" osfamily="mac" failonerror="true">
<arg value="-c" />
<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" />
</exec>
<!-- windoz here : i admit, i hate escaped symbols in xml, indeed = =! -->
<exec executable="cmd" osfamily="windows" failonerror="true">
<arg value="/c" />
<arg value="for %i in (pkg-temp\webapps\*.war) do move %i %i.jar && pack200 -r %i.jar && move %i.jar %i" />
<exec executable="cmd" osfamily="windows" failonerror="true">
<arg value="/c" />
<arg value="for %i in (pkg-temp\lib\*.jar) do pack200 -r %i" />
<target name="prepupdate" depends="build2, prepupdateSmall, prepConsoleDocUpdates, prepCertificates, prep-script-translation, truncatehistory">

sponge
committed
<copy file="build/BOB.jar" todir="pkg-temp/lib/" />
<copy file="build/sam.jar" todir="pkg-temp/lib/" />
<copy file="build/i2psnark.jar" todir="pkg-temp/lib" />
<copy file="build/desktopgui.jar" todir="pkg-temp/lib/" />
<copy file="build/susimail.war" todir="pkg-temp/webapps/" />
<copy file="build/susidns.war" todir="pkg-temp/webapps/" />
<copy file="build/imagegen.war" todir="pkg-temp/webapps/" />
<copy file="build/jsonrpc.war" todir="pkg-temp/webapps/" />
<!-- as of 0.7.12; last changed in 0.9; removed from update in 0.9.26 -->
<!--
<copy file="apps/susidns/src/lib/jstl.jar" todir="pkg-temp/lib/" />
<copy file="apps/susidns/src/lib/standard.jar" todir="pkg-temp/lib/" />
<copy file="build/i2psnark.war" todir="pkg-temp/webapps/" />
<copy file="installer/resources/deletelist.txt" todir="pkg-temp/" />
<copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
<copy todir="pkg-temp/man/">
<fileset dir="installer/resources/man/" />
</copy>
</target>
<target name="truncatehistory">
<copy file="history.txt" todir="pkg-temp/" />
<!-- the following overwrites history.txt on unix to shrink the update file -->

kytv
committed
<copy file="history.txt" tofile="pkg-temp/history.txt" overwrite="true">
<filterchain>
<headfilter lines="1500" />
</filterchain>
</copy>
<concat append="true" destfile="pkg-temp/history.txt"> ---------------- EARLIER HISTORY IS AVAILABLE IN THE SOURCE PACKAGE</concat>
</target>
<target name="prepupdateSmall" depends="buildSmall, prepupdateRouter, prepjupdatefixes, prepthemeupdates">
<copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
<copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
<copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
<!-- name without version so we can overwrite if we upgrade -->
<copy file="build/i2ptunnel.war" todir="pkg-temp/webapps/" />
<copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
<copy file="build/addressbook.jar" todir="pkg-temp/lib/" />
<copy file="build/addressbook.war" todir="pkg-temp/webapps/" />
<copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
<copy file="installer/resources/continents.txt" todir="pkg-temp/geoip/" />
<!--
<copy file="installer/resources/public-suffix-list.txt" todir="pkg-temp/geoip/" />
-->
<target name="prepupdateRouter" depends="buildrouter, deletepkg-temp">
<copy file="build/i2p.jar" todir="pkg-temp/lib/" />
<copy file="build/router.jar" todir="pkg-temp/lib/" />
</target>
<!-- jbigi.jar -->
<target name="prepjbigiupdate" depends="jbigi">
<copy file="build/jbigi.jar" todir="pkg-temp/lib/" />
</target>
<copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
<copy file="installer/resources/continents.txt" todir="pkg-temp/geoip/" />
<!--
<copy file="installer/resources/public-suffix-list.txt" todir="pkg-temp/geoip/" />
-->
<!-- GeoIP files, set withGeoIPDatabase=true in override.properties to prevent -->
<!-- As of 0.9.26, the files are not included in Debian/Ubuntu builds. -->
<target name="prepgeoupdate-unlesspkg" unless="${with-geoip-database}" >
<mkdir dir="pkg-temp/geoip" />
<!--
<copy file="installer/resources/geoip.txt" todir="pkg-temp/geoip/" />
<copy file="installer/resources/geoipv6.dat.gz" todir="pkg-temp/geoip/" />
-->
<gunzip src="installer/resources/GeoLite2-Country.mmdb.gz" dest="pkg-temp/geoip/GeoLite2-Country.mmdb" />
<!-- All jetty jars required for update.
TODO do we need to bother updating jasper?
-->
<fileset dir="build" includes="commons*.jar jasper*.jar javax*.jar jetty*.jar jsp*.jar org.mortbay.*.jar" />
<!-- We have to package the new eepsite files for MigrateJetty.java, but we
can't overwrite an existing eepsite dir in a non-split configuration.
-->
<copy todir="pkg-temp/eepsite-jetty9" >
<fileset dir="installer/resources/eepsite" includes="*.xml contexts/* etc/*" />
<delete dir="pkg-temp/eepsite-jetty9" />
<target name="prepjupdatefixes" depends="buildWEB">
<target name="util-list-changes" depends="checkForMtn" if="mtn.available" >
<exec executable="mtn" outputproperty="workspace.changes.util" errorproperty="mtn.error.util" failifexecutionfails="false" >
<arg value="list" />
<arg value="changed" />
<arg value="core/java/src/net/i2p/util" />
</exec>
<!-- \n in an attribute value generates an invalid manifest -->
<exec executable="tr" inputstring="${workspace.changes.util}" outputproperty="workspace.changes.util.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
<arg value="-s" />
<arg value="[:space:]" />
<arg value="," />
</exec>
<target name="izpack-patches" >
<taskdef name="izpack"
classpath="${basedir}/installer/lib/izpack/patches.jar:${basedir}/installer/lib/izpack/standalone-compiler.jar"
classname="com.izforge.izpack.ant.IzPackTask" />
<jar destfile="${basedir}/installer/lib/izpack/patches.jar"
basedir="${basedir}/installer/lib/izpack/patches" />
</target>
<target name="buildUtilityJar" depends="buildCore">
<ant dir="installer/java" target="build" />
</target>
<target name="installer" depends="preppkg, buildProperties, util-list-changes, izpack-patches, buildUtilityJar" >
<izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
<ant target="installerexe" />
</target>
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
<!-- IzPack 5 -->
<target name="ensureIzpack5" >
<!-- set if unset -->
<property name="izpack5.home" value="${user.home}/IzPack" />
<condition property="izpack5.available" >
<available file="${izpack5.home}" type="dir" />
</condition>
<fail message="Error - IzPack 5.1.x must be installed at ${izpack5.home}, or set izpack5.home=/PATH/TO/IzPack in override.properties, or download from http://izpack.org/downloads/ and install" >
<condition>
<not>
<isset property="izpack5.available" />
</not>
</condition>
</fail>
<path id="izpack5.lib.path">
<fileset dir="${izpack5.home}/lib" includes="*.jar"/>
</path>
<taskdef name="izpack5"
classpathref="izpack5.lib.path"
classname="com.izforge.izpack.ant.IzPackTask" />
</target>
<target name="izpack5-patches" depends="ensureIzpack5, buildProperties" >
<ant dir="installer/lib/izpack5/patches/java/" target="jar" />
</target>
<target name="installer5" depends="izpack5-patches, preppkg, buildProperties, util-list-changes, buildUtilityJar" >
<izpack5 input="${basedir}/installer/install5.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
<!-- This makes i2pinstall.exe from install.jar using the bundled launch4j.
Warning: launch4j-created files CANNOT be Windows-signed.
They will be corrupted.
-->
<target name="installerexe" depends="launch4j" unless="noExe">
<echo message="See the file "build.properties" if this step fails." />
<!-- now the installer exe -->
<!-- thazzit -->
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
<!-- This makes i2pinstall.exe from install.jar using IzPack5's izpack2exe.py (not bundled)
izpack2exe-created files CAN be Windows-signed.
-->
<target name="installer5exe" unless="noExe">
<!-- You must have the optional IzPack utils installed for this -->
<!-- izpack doesn't come with +x permission when installed -->
<chmod type="file" file="${izpack5.home}/utils/wrappers/izpack2exe/7za" perm="+x" />
<chmod type="file" file="${izpack5.home}/utils/wrappers/izpack2exe/izpack2exe.py" perm="+x" />
<!--
Note that we must specify the 7za path to use the one from IzPack, which is very old.
Either 7zr (from Debian package p7zip) or 7za (from Debian package p7zip-full)
will work, but ONLY if the 7za/7zr command line is changed in izpack2exe.py
as follows, because their default is LZMA2, which dosn't work on Windows.
So we don't want any Debian 7za picked up in the PATH.
See /usr/share/doc/p7zip/DOC/MANUAL/cmdline/switches/method.htm
old:
p7zcmd = '"%s" a -mmt -t7z -mx=9 installer.7z "%s"' % (p7z, files)
new:
p7zcmd = '"%s" a -mmt -t7z -mx=9 -m0=LZMA installer.7z "%s"' % (p7z, files)
We also use IzPack's customized 7zS.sfx file, which uses a customized icon
(but not our icon, sadly)
More info: https://izpack.atlassian.net/wiki/spaces/IZPACK/pages/491541/IzPack+Utilities
-->
<exec executable="${izpack5.home}/utils/wrappers/izpack2exe/izpack2exe.py" failonerror="true">
<arg value="--file=${basedir}/install.jar" />
<arg value="--with-7z=${izpack5.home}/utils/wrappers/izpack2exe/7za" />
<arg value="--no-upx" />
<arg value="--output=${basedir}/i2pinstall.exe" />
</exec>
</target>
<!-- Custom installers -->
<!-- IzPack 4 -->
<target name="installer-nowindows" depends="clean, preppkg-nowindows, izpack-patches" >
<fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
<izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}.jar" installerType="standard" basedir="${basedir}" />
<!-- IzPack 5 -->
<target name="installer5-nowindows" depends="clean, izpack5-patches, preppkg-nowindows" >
<fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
<izpack5 input="${basedir}/installer/install5.xml" output="${basedir}/i2pinstall_${full.version}.jar" installerType="standard" basedir="${basedir}" />
</target>
<target name="installer-freebsd" depends="clean, preppkg-freebsd-only, izpack-patches" >
<fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
<izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_freebsd-only.jar" installerType="standard" basedir="${basedir}" />
</target>
<!-- IzPack 4 -->
<target name="installer-linux" depends="clean, preppkg-linux-only, izpack-patches" >
<fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
<izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_linux-only.jar" installerType="standard" basedir="${basedir}" />
</target>
<!-- IzPack 5 -->
<target name="installer5-linux" depends="clean, izpack5-patches, preppkg-linux-only" >
<fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
<izpack5 input="${basedir}/installer/install5.xml" output="${basedir}/i2pinstall_${full.version}_linux-only.jar" installerType="standard" basedir="${basedir}" />
</target>
<target name="installer-osx" depends="clean, checkForIzpack2App, preppkg-osx-only, izpack-patches">
<fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
<mkdir dir="pkg-temp/osx" />
<izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_osx-only.jar" installerType="standard" basedir="${basedir}" />
<ant target="installer2app" />
<delete dir="pkg-temp/osx" />
</target>
<target name="checkForIzpack2App">
<!-- we'll set the izpack2app binary name if it's not been set elsewhere yet -->
<property name="izpack2app.binary" value="${user.home}/IzPack/utils/wrappers/izpack2app/izpack2app.py" />
<available property="izpack2app.available" file="${izpack2app.binary}" />
</target>
<target name="installer2app" if="izpack2app.available">
<mkdir dir="pkg-temp/osx" />
<exec executable="python" failonerror="true">
<arg value="${izpack2app.binary}" />
<arg value="${basedir}/i2pinstall_${full.version}_osx-only.jar" />
<arg value="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" />
</exec>
<tar longfile="gnu" destfile="${basedir}/i2pinstall_${full.version}_osx.tar.bz2" compression="bzip2">
<tarfileset dir="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" prefix="/i2p-${full.version}_osx-install.app" filemode="644">
<include name="**/**" />
<exclude name="Contents/MacOS/*" />
</tarfileset>
<tarfileset dir="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" prefix="/i2p-${full.version}_osx-install.app" filemode="755">
<include name="Contents/MacOS/*" />
</tarfileset>
</tar>
</target>
<!-- call between installer-xxx and installer-windows -->
<target name="delete-nonwindows">
<delete dir="pkg-temp/lib/wrapper/" />
<delete dir="pkg-temp/locale/" />
<delete dir="pkg-temp/man/" />
<delete dir="pkg-temp/Start I2P Router.app/" />
<delete dir="pkg-temp" includes="eepget i2prouter INSTALL-headless.txt osid postinstall.sh runplain.sh" />
</target>
<target name="installer-windows" depends="clean, preppkg-windows-only, util-list-changes, izpack-patches, buildUtilityJar" >
<fixcrlf srcdir="pkg-temp" includes="*.config *.bat *.cmd **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="crlf"/>
<izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
<ant target="installerexe" />
<delete file="${basedir}/install.jar" />
<move file="${basedir}/i2pinstall.exe" tofile="${basedir}/i2pinstall_${full.version}_windows.exe" />
</target>
<target name="installer5-windows" depends="clean, izpack5-patches, preppkg-windows-only, util-list-changes, buildUtilityJar" >
<fixcrlf srcdir="pkg-temp" includes="*.config *.bat *.cmd **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="crlf"/>
<izpack5 input="${basedir}/installer/install5.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
<delete file="${basedir}/install.jar" />
<move file="${basedir}/i2pinstall.exe" tofile="${basedir}/i2pinstall_${full.version}_windows.exe" />
</target>
<!-- this is broken as installer-xxx targets may delete (or not delete) things in pkg-temp -->
<target name="installer-all" depends="installer-freebsd, installer-linux, installer-osx, installer-windows, installer-nowindows, installer" >
</target>
<!-- end custom installers -->
<!-- unit tests -->
<target name="buildCoreTest">
<ant dir="core/java/" target="jarTest" />
</target>
<target name="buildRouterTest" depends="buildCoreTest">
</target>
<target name="buildTest" depends="buildRouterTest">
<copy file="core/java/build/i2ptest.jar" todir="build" />
<copy file="router/java/build/routertest.jar" todir="build" />
<!-- broken -->
<!--
<ant dir="apps/ministreaming/java/" target="junit.compileTest" />
<ant dir="apps/streaming/java/" target="junit.compileTest" />
-->
</target>
<target name="prepTest" depends="prepupdate, buildTest">
<!-- overwrite i2p.jar and router.jar with the test versions -->
<copy file="build/i2ptest.jar" tofile="pkg-temp/lib/i2p.jar" overwrite="true" />
<copy file="build/routertest.jar" tofile="pkg-temp/lib/router.jar" overwrite="true" />
</target>
<target name="updateTest" depends="prepTest, zipit" />
<target name="junit.test" depends="buildProperties, jbigi" >
<ant dir="core/java/" target="junit.test" />
<ant dir="router/java/" target="junit.test" />
<ant dir="apps/ministreaming/java/" target="junit.test" />
<ant dir="apps/streaming/java/" target="junit.test" />