I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
build.xml 130 KiB
Newer Older
                     **/#*#
                     **/.#*
                     **/%*%
                     **/._*
                     **/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~" />
kytv's avatar
kytv committed
	    <!--
	    	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>
    <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" />
        </delete>
    </target>
    <target name="preppkg" depends="preppkg-linux, preppkg-freebsd, preppkg-osx, preppkg-windows, jbigi">
        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
zzz's avatar
zzz committed
        <copy todir="pkg-temp/lib/wrapper/solaris/">
            <fileset dir="installer/lib/wrapper/solaris/" excludes="*.txt" />
zzz's avatar
zzz committed
        </copy>
zzz's avatar
zzz committed
     <!-- 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" />
zzz's avatar
zzz committed
    </target>

    <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" />
    <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" />
kytv's avatar
kytv committed
        </copy>
    <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>

walking's avatar
walking committed
    <!-- only what is needed for debian, etc. -->
    <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" />
walking's avatar
walking committed
    </target>

zzz's avatar
zzz committed
    <!-- This is the target called by debian/rules -->
    <target name="preppkg-unix" depends="preppkg-base, prep-script-translation" >
zzz's avatar
zzz committed
        <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/" />
zzz's avatar
zzz committed
        <copy todir="pkg-temp/man/">
            <fileset dir="installer/resources/man/" />
        </copy>
kytv's avatar
kytv committed
    <target name="preppkg-linux" depends="preppkg-linux-x86,preppkg-linux-nonx86" />

    <target name="preppkg-linux-x86" depends="preppkg-unix">
zzz's avatar
zzz committed
        <copy todir="pkg-temp/lib/wrapper/linux/">
            <fileset dir="installer/lib/wrapper/linux/" excludes="*.txt" />
zzz's avatar
zzz committed
        </copy>
        <copy todir="pkg-temp/lib/wrapper/linux64/">
            <fileset dir="installer/lib/wrapper/linux64/" excludes="*.txt" />
zzz's avatar
zzz committed
        </copy>
    </target>

kytv's avatar
kytv committed
    <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" />
kytv's avatar
kytv committed
        </copy>
        <copy todir="pkg-temp/lib/wrapper/linux-armv5/">
            <fileset dir="installer/lib/wrapper/linux-armv5/" excludes="*.txt" />
kytv's avatar
kytv committed
        </copy>
        <copy todir="pkg-temp/lib/wrapper/linux-armv6/">
            <fileset dir="installer/lib/wrapper/linux-armv6/" excludes="*.txt" />
        </copy>
kytv's avatar
kytv committed
    </target>

    <target name="preppkg-osx" depends="preppkg-unix">
kytv's avatar
kytv committed
        <!--<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/" />
kytv's avatar
kytv committed
    </target>

    <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" />
zzz's avatar
zzz committed
    <target name="preppkg-windows" depends="preppkg-base, preplicenses-windows, buildUtilityJar, buildexe">
zzz's avatar
zzz committed
        <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" />
zzz's avatar
zzz committed
     <!-- 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" />
zzz's avatar
zzz committed
      -->
        <copy overwrite="true" file="installer/lib/wrapper/win-all/wrapper.jar" todir="pkg-temp/lib" />
zzz's avatar
zzz committed
    <!-- see targets below for conditional copying -->
    <target name="preppkg-base" depends="build, preplicenses, prepConsoleDocs, prepthemeupdates, prepCertificates, prepRouterInfos, copyjetty, copytomcat-unlesspkg, copyjstl-unlesspkg, copystandard-unlesspkg, 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/" />
jrandom's avatar
jrandom committed
        <copy file="build/streaming.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  -->
zzz's avatar
zzz committed
        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
        <copy file="build/sam.jar" todir="pkg-temp/lib/" />
        <copy file="build/BOB.jar" todir="pkg-temp/lib/" />
        <copy file="build/systray.jar" todir="pkg-temp/lib" />
jrandom's avatar
jrandom committed
        <copy file="build/i2psnark.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/" />
jrandom's avatar
jrandom committed
        <copy file="build/susimail.war" todir="pkg-temp/webapps/" />
jrandom's avatar
jrandom committed
        <copy file="build/susidns.war" todir="pkg-temp/webapps/" />
        <copy file="build/imagegen.war" todir="pkg-temp/webapps/" />
jrandom's avatar
jrandom committed
        <copy file="build/i2psnark.war" todir="pkg-temp/webapps/" />
zzz's avatar
zzz committed
        <copy file="apps/i2psnark/i2psnark.config" todir="pkg-temp/" />
zzz's avatar
zzz committed
        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
        <copy file="installer/resources/clients.config" todir="pkg-temp/" />
        <copy file="installer/resources/i2ptunnel.config" todir="pkg-temp/" />
        <copy file="installer/resources/systray.config" todir="pkg-temp/" />
        <copy file="installer/resources/wrapper.config" todir="pkg-temp/" />
        <copy file="installer/resources/hosts.txt" todir="pkg-temp/" />
zzz's avatar
zzz committed
        <copy file="INSTALL-headless.txt" todir="pkg-temp/" />
smeghead's avatar
smeghead committed
        <mkdir dir="pkg-temp/scripts" />
        <copy file="apps/proxyscript/i2pProxy.pac" todir="pkg-temp/scripts/" />
        <copy file="apps/apparmor/home.i2p.i2prouter" todir="pkg-temp/scripts/" />
jrandom's avatar
jrandom committed
        <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/" />
        <!-- Eepsite stuff here -->
jrandom's avatar
jrandom committed
        <mkdir dir="pkg-temp/eepsite" />
        <copy todir="pkg-temp/eepsite/" >
            <fileset dir="installer/resources/eepsite/" excludes="**/.placeholder" />
zzz's avatar
zzz committed
        </copy>
        <copy todir="pkg-temp/eepsite/docroot/help/lib/" >
            <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" />
        <copy file="installer/resources/themes/console/images/favicon.ico" tofile="pkg-temp/eepsite/docroot/favicon.ico" />
        <copy todir="pkg-temp/docs/icons/flags" >
          <fileset dir="installer/resources/icons/flags" />
        </copy>
    <target name="copyjetty" depends="copyjetty-unlesspkg" >
zzz's avatar
zzz committed
        <copy file="build/jetty-i2p.jar" todir="pkg-temp/lib" />
zzz's avatar
zzz committed
    <target name="copyjetty-unlesspkg" unless="${with-libjetty9-java}" >
zzz's avatar
zzz committed
        <copy todir="pkg-temp/lib" >
            <fileset dir="build" includes="javax.servlet.jar jetty*.jar org.mortbay.*.jar" excludes="jetty-i2p.jar" />
zzz's avatar
zzz committed
        </copy>
    </target>

    <target name="settomcatprop" >
        <condition property="with-libtomcat-java" >
            <or>
                <istrue value="${with-libtomcat6-java}" />
                <istrue value="${with-libtomcat7-java}" />
                <istrue value="${with-libtomcat8-java}" />
            </or>
        </condition>
    </target>

    <target name="copytomcat-unlesspkg" depends="settomcatprop" unless="${with-libtomcat-java}" >
zzz's avatar
zzz committed
        <copy todir="pkg-temp/lib" >
            <fileset dir="build" includes="commons*.jar jasper*.jar javax*.jar" />
        </copy>
    </target>

zzz's avatar
zzz committed
    <!-- todo handle alt package too -->
    <!--
       glassfish-javaee.jar has ancient and conflicting classes, e.g. javax.mail
    <target name="copyjstl-unlesspkg" unless="${with-glassfish-javaee}" >
    -->
    <target name="copyjstl-unlesspkg" >
zzz's avatar
zzz committed
        <copy file="apps/susidns/src/lib/jstl.jar" todir="pkg-temp/lib/" />
zzz's avatar
zzz committed
    </target>

zzz's avatar
zzz committed
    <!-- todo handle alt package too -->
    <target name="copystandard-unlesspkg" unless="${with-glassfish-javaee}" >
zzz's avatar
zzz committed
        <copy file="apps/susidns/src/lib/standard.jar" todir="pkg-temp/lib/" />
zzz's avatar
zzz committed
    </target>

zzz's avatar
zzz committed
    <!-- does NOT include launch4j licenses for Windows builds -->
zzz's avatar
zzz committed
    <target name="preplicenses" depends="preplicenses-unlesspkg" >
zzz's avatar
zzz committed
        <copy file="LICENSE.txt" todir="pkg-temp/" />
        <copy todir="pkg-temp/licenses/" >
          <fileset dir="licenses/" />
        </copy>
zzz's avatar
zzz committed
        <copy file="apps/imagegen/identicon/README.md" tofile="pkg-temp/licenses/LICENSE-Identicon.txt" />
zzz's avatar
zzz committed
        <copy file="apps/desktopgui/LICENSE" tofile="pkg-temp/licenses/LICENSE-DesktopGUI.txt" />
zzz's avatar
zzz committed
    </target>

    <target name="preplicenses-unlesspkg" depends="settomcatprop" unless="${with-libtomcat-java}" >
zzz's avatar
zzz committed
<!--  replacement?
zzz's avatar
zzz committed
        <copy file="apps/jetty/apache-tomcat-deployer/NOTICE" tofile="pkg-temp/licenses/NOTICE-Tomcat.txt" />
zzz's avatar
zzz committed
-->
zzz's avatar
zzz committed
    </target>
zzz's avatar
zzz committed

    <!-- 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" />
zzz's avatar
zzz committed

    <target name="prepthemeupdates">
zzz's avatar
zzz committed
        <copy todir="pkg-temp/docs/themes/" >
            <fileset dir="installer/resources/themes/" />
zzz's avatar
zzz committed
    </target>

    <!-- SSL Certs -->
    <target name="prepCertificates">
        <copy todir="pkg-temp/certificates/" >
          <fileset dir="installer/resources/certificates/" />
zzz's avatar
zzz committed
        </copy>
    <condition property="no.bundle.routerInfos">
        <isfalse value="${bundle.routerInfos}" />
    </condition>

    <target name="prepRouterInfos" depends="buildrouter, buildTools" unless="no.bundle.routerInfos">
kytv's avatar
kytv committed
        <delete dir="pkg-temp/netDb" />
        <mkdir dir="pkg-temp/netDb" />
zzz's avatar
zzz committed
        <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>

kytv's avatar
kytv committed
    <target name="-areRouterInfosEnabled">
        <fail message="Option requires &quot;bundle.routerInfos&quot; to be configured. Please read &quot;build.properties&quot; for more info." >
            <condition>
                <isfalse value="${bundle.routerInfos}" />
            </condition>
        </fail>
    </target>

    <target name="i2pseeds" depends="-setepoch, -areRouterInfosEnabled, prepRouterInfos">
kytv's avatar
kytv committed
        <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}" />
kytv's avatar
kytv committed
    </target>

    <!-- 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>
zzz's avatar
zzz committed

    <target name="deletepkg-temp">
zzz's avatar
zzz committed
        <delete dir="pkg-temp" />
        <delete dir="./pkg-mavencentral" />
zzz's avatar
zzz committed

    <!-- 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>
kytv's avatar
kytv committed
        <!-- ensure the proxy files have the correct line endings -->
        <fixcrlf srcdir="pkg-temp/docs" includes="*.ht" encoding="utf8" eol="crlf" />
zzz's avatar
zzz committed

    <!-- readme and proxy error page files -->
    <target name="prepConsoleDocUpdates">
zzz's avatar
zzz committed
        <copy todir="pkg-temp/docs/" >
zzz's avatar
zzz committed
          <fileset dir="installer/resources/readme/" includes="readme*.html" />
zzz's avatar
zzz committed
          <fileset dir="installer/resources/proxy/" includes="*.ht" />
          <!-- 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;
zzz's avatar
zzz committed
               im.png added in 0.8.12; cw.png added in 0.9.5; ap,bl,bq,ss,sx added in 0.9.21;
               lang_gl added in 0.9.28 -->
          <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" />
zzz's avatar
zzz committed
        </copy>
    </target>
zzz's avatar
zzz committed

    <target name="consoleDocs" depends="deletepkg-temp, prepConsoleDocs">
        <zip destfile="docs.zip" basedir="pkg-temp" whenempty="fail" />
    </target>
zzz's avatar
zzz committed
    <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" />
kytv's avatar
kytv committed
    <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" />
zzz's avatar
zzz committed
    <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="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" />
zzz's avatar
zzz committed
    <target name="updaterSmall" depends="prepupdateSmall, zipit" />
    <target name="updaterRouter" depends="prepupdateRouter, zipit" />
zzz's avatar
zzz committed

kytv's avatar
kytv committed
    <target name="-sign-update" depends="buildrouter">
        <su3sign infile="i2pupdate200.zip" sigtype="ROUTER" outfile="i2pupdate.su3" su3.ver="${full.version}" />
kytv's avatar
kytv committed
    </target>

    <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" />
kytv's avatar
kytv committed

    <target name="zipit" depends="getReleaseNumber">
zzz's avatar
zzz committed
        <!--
             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>
zzz's avatar
zzz committed

    <target name="zipit200" depends="getReleaseNumber" >
        <zip destfile="i2pupdate200.zip" basedir="pkg-temp" whenempty="fail" comment="${release.number}" />
        <!-- 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
          -->
        <exec executable="sh" osfamily="unix" failonerror="true">
walking's avatar
walking committed
            <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" />
walking's avatar
walking committed
        </exec>
        <exec executable="sh" osfamily="mac" 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" />
        <!-- 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 -->
            <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" />
        </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 &amp;&amp; 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 &amp;&amp; pack200 -r %i.jar &amp;&amp; move %i.jar %i" />
walking's avatar
walking committed
        </exec>
        <exec executable="cmd" osfamily="windows" failonerror="true">
                <arg value="/c" />
                <arg value="for %i in (pkg-temp\lib\*.jar) do pack200 -r %i" />
walking's avatar
walking committed
        </exec>
    <target name="prepupdate" depends="build2, prepupdateSmall, prepConsoleDocUpdates, prepCertificates, prep-script-translation, truncatehistory">
        <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" />
zzz's avatar
zzz committed
        <!-- include systray changes in 0.7.5 -->
zzz's avatar
zzz committed
        <copy file="build/systray.jar" todir="pkg-temp/lib/" />
zzz's avatar
zzz committed
       <!-- removed from updater in 0.9, added back in 0.9.26 -->
        <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/" />
zzz's avatar
zzz committed
        <!-- as of 0.7.12; last changed in 0.9; removed from update in 0.9.26 -->
      <!--
zzz's avatar
zzz committed
        <copy file="apps/susidns/src/lib/jstl.jar" todir="pkg-temp/lib/" />
        <copy file="apps/susidns/src/lib/standard.jar" todir="pkg-temp/lib/" />
zzz's avatar
zzz committed
       -->
        <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/" />
zzz's avatar
zzz committed
        <!-- the following overwrites history.txt on unix to shrink the update file -->
        <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">&#10;&#10;----------------&#10;&#10;EARLIER HISTORY IS AVAILABLE IN THE SOURCE PACKAGE</concat>
zzz's avatar
zzz committed

    <target name="prepupdateSmall" depends="buildSmall, prepupdateRouter, prepjupdatefixes, prepthemeupdates">
jrandom's avatar
jrandom committed
        <copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
        <copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
jrandom's avatar
jrandom committed
        <copy file="build/streaming.jar" todir="pkg-temp/lib/" />
jrandom's avatar
jrandom committed
        <copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
        <!-- Updated in 0.9.28 -->
        <!-- name without version so we can overwrite if we upgrade  -->
zzz's avatar
zzz committed
        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
jrandom's avatar
jrandom committed
        <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/" />
jrandom's avatar
jrandom committed
        <copy file="build/addressbook.war" todir="pkg-temp/webapps/" />
zzz's avatar
zzz committed
        <!-- decapitalized the file in 0.7.8 -->
zzz's avatar
zzz committed
        <copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
        <!-- small enough to include for now -->
        <copy file="installer/resources/geoipv6.dat.gz" todir="pkg-temp/geoip/" />
zzz's avatar
zzz committed
        <copy file="installer/resources/continents.txt" todir="pkg-temp/geoip/" />
zzz's avatar
zzz committed
      <!--
        <copy file="installer/resources/public-suffix-list.txt" todir="pkg-temp/geoip/" />
       -->
jrandom's avatar
jrandom committed
    </target>
zzz's avatar
zzz committed

    <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>
zzz's avatar
zzz committed

    <!-- jbigi.jar -->
    <target name="prepjbigiupdate" depends="jbigi">
        <copy file="build/jbigi.jar" todir="pkg-temp/lib/" />
    </target>

zzz's avatar
zzz committed
    <!-- GeoIP files -->
zzz's avatar
zzz committed
    <target name="prepgeoupdate" depends="prepgeoupdate-unlesspkg" >
zzz's avatar
zzz committed
        <copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
zzz's avatar
zzz committed
        <copy file="installer/resources/continents.txt" todir="pkg-temp/geoip/" />
zzz's avatar
zzz committed
      <!--
        <copy file="installer/resources/public-suffix-list.txt" todir="pkg-temp/geoip/" />
       -->
zzz's avatar
zzz committed
    </target>
zzz's avatar
zzz committed

zzz's avatar
zzz committed
    <!-- 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}" >
        <copy file="installer/resources/geoip.txt" todir="pkg-temp/geoip/" />
        <copy file="installer/resources/geoipv6.dat.gz" todir="pkg-temp/geoip/" />
    </target>
zzz's avatar
zzz committed

    <!-- All jetty jars required for update.
         TODO do we need to bother updating jasper?
      -->
zzz's avatar
zzz committed
    <target name="prepjupdate" depends="prepupdate, buildWEB">
zzz's avatar
zzz committed
        <copy todir="pkg-temp/lib" >
zzz's avatar
zzz committed
            <fileset dir="build" includes="commons*.jar jasper*.jar javax*.jar jetty*.jar jsp*.jar org.mortbay.*.jar" />
zzz's avatar
zzz committed
        </copy>
zzz's avatar
zzz committed
        <!--  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/*" />
zzz's avatar
zzz committed
    </target>
zzz's avatar
zzz committed
    <target name="delete-j6-update">
        <delete dir="pkg-temp/eepsite-jetty9" />
zzz's avatar
zzz committed
    </target>

zzz's avatar
zzz committed
    <!-- Jetty 6 I2P logging addons, not really fixes -->
    <target name="prepjupdatefixes" depends="buildWEB">
zzz's avatar
zzz committed
        <copy file="build/jetty-i2p.jar" todir="pkg-temp/lib/" />

    <target name="util-list-changes" depends="checkForMtn" if="mtn.available" >
zzz's avatar
zzz committed
        <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" >
kytv's avatar
kytv committed
            <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 name="installer" depends="preppkg, buildProperties, util-list-changes, izpack-patches, buildUtilityJar" >
        <!--
          Force 1.5 pack200 output
          Doesnt work!
          http://jira.codehaus.org/browse/IZPACK-404
          http://forums.sun.com/thread.jspa?threadID=773439
          http://bfo.co.uk/blog/2010/05/13/combining_ant_jar_signatures_and_pack200.html
        <property name="com.sun.java.util.jar.pack.package.majver" value="150" />
        <property name="com.sun.java.util.jar.pack.package.minver" value="7" />
        -->
        <izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
jrandom's avatar
jrandom committed

        <ant target="installerexe" />
    </target>
zzz's avatar
zzz committed
    <!-- this makes i2pinstall.exe from install.jar -->
    <target name="installerexe" depends="launch4j" unless="noExe">
kytv's avatar
kytv committed
        <echo message="See the file &quot;build.properties&quot; if this step fails." />
        <!-- now the installer exe -->
jrandom's avatar
jrandom committed
        <launch4j configFile="./installer/i2pinstaller.xml" />
zzz's avatar
zzz committed

zzz's avatar
zzz committed
    <target name="installer-nowindows" depends="clean, preppkg-nowindows, izpack-patches" >
kytv's avatar
kytv committed
        <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}" />
zzz's avatar
zzz committed
    <target name="installer-freebsd" depends="clean, preppkg-freebsd-only, izpack-patches" >
kytv's avatar
kytv committed
        <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}" />
zzz's avatar
zzz committed
    <target name="installer-linux" depends="clean, preppkg-linux-only, izpack-patches" >
kytv's avatar
kytv committed
        <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}" />
zzz's avatar
zzz committed
    <target name="installer-osx" depends="clean, checkForIzpack2App, preppkg-osx-only, izpack-patches">
kytv's avatar
kytv committed
        <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>
zzz's avatar
zzz committed
    <!-- 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" >
kytv's avatar
kytv committed
        <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}" />
zzz's avatar
zzz committed
        <ant target="installerexe" />
        <delete file="${basedir}/install.jar" />
        <move file="${basedir}/i2pinstall.exe" tofile="${basedir}/i2pinstall_${full.version}_windows.exe" />
zzz's avatar
zzz committed
    <!-- 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 -->
kytv's avatar
kytv committed

    <target name="buildTest">
        <ant dir="core/java/" target="jarTest" />
        <ant dir="router/java/" target="jarTest" />
        <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 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 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" />
    </target>
    <target name="scalatest.test" depends="buildProperties, jbigi" >
        <ant dir="core/java/" target="scalatest.test" />
        <!-- note there are no router scala tests yet -->
        <ant dir="router/java/" target="scalatest.test" />
    </target>
    <target name="test" depends="buildProperties, jbigi" >
        <!-- both junit and scala -->
comwiz's avatar
comwiz committed
        <ant dir="core/java/" target="test" />
        <ant dir="router/java/" target="test" />
        <ant dir="apps/ministreaming/java/" target="test" />
        <ant dir="apps/streaming/java/" target="test" />
comwiz's avatar
comwiz committed
    </target>
    <target name="scalatest.report" depends="buildProperties" >
        <ant dir="core/java/" target="scalatest.report" />
        <ant dir="router/java/" target="scalatest.report" />
    </target>
zzz's avatar
zzz committed
    <target name="junit.report" depends="buildProperties" >
comwiz's avatar
comwiz committed
        <ant dir="core/java/" target="junit.report" />
        <ant dir="router/java/" target="junit.report" />
        <ant dir="apps/ministreaming/java/" target="junit.report" />
        <ant dir="apps/streaming/java/" target="junit.report" />
comwiz's avatar
comwiz committed
    </target>
    <target name="clover.report" depends="buildProperties" if="with.clover">
comwiz's avatar
comwiz committed
        <ant dir="core/java/" target="clover.report" />
        <ant dir="router/java/" target="clover.report" />
        <ant dir="apps/ministreaming/java" target="clover.report" />
        <ant dir="apps/streaming/java" target="clover.report" />
comwiz's avatar
comwiz committed
    </target>
    <target name="cobertura.report" depends="buildProperties" if="with.cobertura">
        <ant dir="core/java/" target="cobertura.report" />
        <ant dir="router/java/" target="cobertura.report" />
        <ant dir="apps/ministreaming/java" target="cobertura.report" />
        <ant dir="apps/streaming/java" target="cobertura.report" />
    <target name="test.report" depends="junit.report, scalatest.report, clover.report, cobertura.report"/>
    <target name="fulltest" depends="buildProperties, jbigi" >
        <ant dir="core/java/" target="fulltest" />
        <ant dir="router/java/" target="fulltest" />
        <ant dir="apps/ministreaming/java" target="fulltest" />
kytv's avatar
kytv committed
        <ant dir="apps/streaming/java" target="fulltest" />
comwiz's avatar
comwiz committed
    </target>
    <target name="jenkins.cobertura.report" depends="cobertura.report">
        <!--
             The jenkins cobertura plugin couldn't find the source files.
         -->
        <replaceregexp byline="true" file="reports/core/cobertura/coverage.xml"
            match='filename="net' replace='filename="core/java/src/net'/>
        <replaceregexp byline="true" file="reports/core/cobertura/coverage.xml"
            match="&lt;source&gt;./src" replace='&lt;source&gt;./core/java/src'/>
        <replaceregexp byline="true" file="reports/router/cobertura/coverage.xml"
            match='filename="net' replace='filename="router/java/src/net'/>
        <replaceregexp byline="true" file="reports/router/cobertura/coverage.xml"
            match="&lt;source&gt;./src" replace="&lt;source&gt;router/java/src"/>
        <replaceregexp byline="true" file="reports/ministreaming/cobertura/coverage.xml"
            match='filename="net' replace='filename="apps/ministreaming/java/src/net'/>
        <replaceregexp byline="true" file="reports/ministreaming/cobertura/coverage.xml"
            match="&lt;source&gt;./src" replace="&lt;source&gt;apps/ministreaming/java/src"/>

        <replaceregexp byline="true" file="reports/streaming/cobertura/coverage.xml"
kytv's avatar
kytv committed
            match='filename="net' replace='filename="apps/streaming/java/src/net'/>
        <replaceregexp byline="true" file="reports/streaming/cobertura/coverage.xml"
kytv's avatar
kytv committed
            match="&lt;source&gt;./src" replace="&lt;source&gt;apps/streaming/java/src"/>
zzz's avatar
zzz committed

zzz's avatar
zzz committed
    <target name="testscripts" >
        <exec executable="tests/scripts/checkcerts.sh" failonerror="true" />
        <exec executable="tests/scripts/checkpo.sh" failonerror="true" />
        <exec executable="tests/scripts/checkutf8.sh" failonerror="true" />
        <exec executable="tests/scripts/checkxml.sh" failonerror="true" />
        <exec executable="tests/scripts/checkscripts.sh" failonerror="true" />
    <target name="testscripts-net" >
        <exec executable="tests/scripts/checkremotecerts.sh" failonerror="true" />
    </target>

    <target name="testscripts-all" depends="testscripts,testscripts-net" />

    <!-- <target name="syndie" >
jrandom's avatar
jrandom committed
        <ant dir="apps/syndie/java/" target="standalone" />
        <copy file="apps/syndie/java/syndie-standalone.zip" todir="." />
zzz's avatar
zzz committed

    <!-- standalone i2psnark zip -->
    <target name="i2psnark" depends="buildStreaming, buildJetty, buildSystray" >
jrandom's avatar
jrandom committed
        <ant dir="apps/i2psnark/java" target="standalone" />
        <copy file="apps/i2psnark/java/i2psnark-standalone.zip" todir="." />
    </target>
zzz's avatar
zzz committed

    <target name="slackpkg">
        <ant dir="Slackware/i2p/" target="slackpkg" />
    </target>
    <target name="justBOB" depends="builddepSmall, jbigi">
        <ant dir="apps/BOB/" target="onejar" />
        <copy file="apps/BOB/dist/BOB-one.jar" todir="." />
    </target>
kytv's avatar
kytv committed

    <target name="sloccount.report">
        <property name="sloccount.report.file" value="sloccount.sc" />
        <echo message="Generating sloccount report (this will take awhile)" />
kytv's avatar
kytv committed
        <exec executable="sloccount" failonerror="true">
            <arg value="--details"/>
            <arg value="--wide"/>
            <redirector output="${sloccount.report.file}">
kytv's avatar
kytv committed
                <outputfilterchain>
                    <linecontainsregexp negate="true">
                        <regexp pattern="(Warning: |lib/launch4j|_MTN|reports|pkg-temp|licenses|i2p\.fba|gmp-|WEB-INF)" />
kytv's avatar
kytv committed
                    </linecontainsregexp>
                    <linecontains negate="true">
                        <contains value="${sloccount.report.file}" />
                    </linecontains>
kytv's avatar
kytv committed
                </outputfilterchain>
            </redirector>
        </exec>
        <echo message="sloccount report saved to the file &quot;${sloccount.report.file}&quot;" />
kytv's avatar
kytv committed
    </target>

    <target name="findbugs" depends="build2, buildUtilityJar">
zzz's avatar
zzz committed
        <echo message="Starting findbugs, this will take a while..." />
zzz's avatar
zzz committed
        <exec executable="nice" failonerror="true">
zzz's avatar
zzz committed
            <arg value="findbugs"/>
            <arg value="-textui"/>
            <arg value="-projectName"/>
            <arg value="i2p"/>
            <arg value="-sortByClass"/>
            <arg value="-xml"/>
            <arg value="-output"/>
zzz's avatar
zzz committed
            <arg value="i2p.fba"/>
zzz's avatar
zzz committed
            <arg value="-auxclasspath"/>
            <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"/>
zzz's avatar
zzz committed
            <arg value="-sourcepath"/>
            <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"/>
zzz's avatar
zzz committed
            <!-- start of the files to be analyzed -->
            <arg value="build/BOB.jar"/>
zzz's avatar
zzz committed
            <arg value="build/addressbook.jar"/>
zzz's avatar
zzz committed
            <arg value="build/i2p.jar"/>
            <arg value="build/i2psnark.jar"/>
            <arg value="build/i2psnark.war"/>
            <arg value="build/i2ptunnel.jar"/>
            <arg value="build/i2ptunnel.war"/>
            <arg value="build/imagegen.war"/>
zzz's avatar
zzz committed
            <arg value="build/jetty-i2p.jar"/>
zzz's avatar
zzz committed
            <arg value="build/mstreaming.jar"/>
            <arg value="build/router.jar/"/>
            <arg value="build/desktopgui.jar"/>
zzz's avatar
zzz committed
            <arg value="build/routerconsole.jar"/>
            <arg value="build/routerconsole.war"/>
zzz's avatar
zzz committed
            <arg value="build/sam.jar"/>
            <arg value="build/streaming.jar"/>
            <arg value="build/susidns.war"/>
            <arg value="build/susimail.war"/>
            <arg value="build/systray.jar"/>
            <arg value="build/utility.jar"/>
zzz's avatar
zzz committed
        </exec>
zzz's avatar
zzz committed
        <echo message="Findbugs output stored in i2p.fba" />
        <echo message="Now run: findbugs i2p.fba" />
zzz's avatar
zzz committed
    </target>

    <!-- this is the same dependency as pkg, but with updater200 in the middle,
         since preppkg puts too much stuff in pkg-temp -->
zzz's avatar
zzz committed
    <target name="release" depends="distclean, updaterWithJettyFixesAndJbigi , updater200WithJettyFixes, preppkg, installer, getReleaseNumber" >
zzz's avatar
zzz committed
    <target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyAndGeoIPRepack, updater200WithJettyAndGeoIP, delete-j6-update, installer-nowindows, delete-nonwindows, installer-windows">
    <target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyAndJbigiRepack, updater200WithJettyAndJbigi, delete-j6-update, installer-nowindows, delete-nonwindows, installer-windows">
-->
    <target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyRepack, updater200WithJetty, delete-j6-update, installer-nowindows, delete-nonwindows, installer-windows">
zzz's avatar
zzz committed
        <echo message="New version number is ${release.number}" />
zzz's avatar
zzz committed
        <copy file="i2pupdate.zip" tofile="i2pupdate_${release.number}.zip" />
        <copy file="i2pinstall_${full.version}.jar" tofile="i2pinstall_${release.number}.jar" />
        <copy file="i2pinstall_${full.version}_windows.exe" tofile="i2pinstall_${release.number}_windows.exe" />
        <!-- remove these, we don't build them anymore -->
zzz's avatar
zzz committed
        <delete file="i2pupdate.sud" />
        <delete file="i2pupdate.su2" />
        <!-- make this a lot easier by putting release.privkey.su3=/path/to/su3keystore.ks in override.properties -->
kytv's avatar
kytv committed

zzz's avatar
zzz committed
        <!-- now build and verify the packed su3 from the packed zip -->
        <su3sign infile="i2pupdate200.zip" sigtype="ROUTER" outfile="i2pupdate.su3" su3.ver="${release.number}" />
        <!-- this will use the monotonerc file in the current workspace -->
zzz's avatar
zzz committed
        <echo message="Checking out fresh copy into ../i2p-${release.number} for tarballing:" />
zzz's avatar
zzz committed
        <delete dir="../i2p-${release.number}" />
zzz's avatar
zzz committed
        <exec executable="mtn" failonerror="true">
zzz's avatar
zzz committed
            <arg value="co" />
zzz's avatar
zzz committed
            <!-- w: is the revision of the current workspace -->
            <arg value="-r" />
            <arg value="w:" />
zzz's avatar
zzz committed
            <arg value="../i2p-${release.number}/" />
        </exec>
zzz's avatar
zzz committed
        <exec executable="tar" failonerror="true">
zzz's avatar
zzz committed
            <arg value="cjf" />
            <arg value="i2psource_${release.number}.tar.bz2" />
            <arg value="-C" />
            <arg value=".." />
            <arg value="--exclude" />
zzz's avatar
zzz committed
            <arg value="i2p-${release.number}/_MTN*" />
zzz's avatar
zzz committed
            <arg value="i2p-${release.number}/" />
        </exec>
        <echo message="Sign the files:" />
zzz's avatar
zzz committed
        <input message="Enter GPG key ID (e.g. 0x12345678) for signing:" addproperty="release.gpg.keyid" />
        <fail message="You must enter a key ID." >
            <condition>
                <equals arg1="${release.gpg.keyid}" arg2=""/>
            </condition>
        </fail>

        <!-- the gpgsign macro sets the permission of signed files and the sigs themselves to 444 -->
        <gpgsign file="i2pinstall_${release.number}_windows.exe" />
        <gpgsign file="i2pinstall_${release.number}.jar" />
        <gpgsign file="i2psource_${release.number}.tar.bz2" />
        <gpgsign file="i2pupdate_${release.number}.zip" />

        <chmod perm="444" type="file">
            <fileset dir="${basedir}">
                <include name="i2pupdate.su3" />
            </fileset>
        </chmod>
zzz's avatar
zzz committed
        <echo message="File sizes:" />
zzz's avatar
zzz committed
        <exec executable="ls" failonerror="true">
zzz's avatar
zzz committed
            <arg value="-l" />
zzz's avatar
zzz committed
            <arg value="i2pinstall_${release.number}_windows.exe" />
            <arg value="i2pinstall_${release.number}.jar" />
zzz's avatar
zzz committed
            <arg value="i2psource_${release.number}.tar.bz2" />
            <arg value="i2pupdate_${release.number}.zip" />
zzz's avatar
zzz committed
            <arg value="i2pupdate.su3" />
zzz's avatar
zzz committed
            <arg value="i2pinstall_${release.number}_windows.exe.sig" />
            <arg value="i2pinstall_${release.number}.jar.sig" />
zzz's avatar
zzz committed
            <arg value="i2psource_${release.number}.tar.bz2.sig" />
            <arg value="i2pupdate_${release.number}.zip.sig" />
        </exec>
        <echo message="SHA256 sums:" />
        <sha256sum file="i2pinstall_${release.number}_windows.exe" />
        <sha256sum file="i2pinstall_${release.number}.jar" />
        <sha256sum file="i2psource_${release.number}.tar.bz2" />