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

Skip to content
Snippets Groups Projects
build.xml 87.7 KiB
Newer Older
jrandom's avatar
jrandom committed
<?xml version="1.0" encoding="ISO-8859-1"?>
<project basedir="." default="all" name="i2p">
kytv's avatar
kytv committed

    <!-- Include property files so that values can be easily overridden.
         Users should create an override.properties file to make changes.
     -->
    <property file="override.properties"/>
    <property file="build.properties"/>
    <!-- You probably don't want to change anything from here down -->
zzz's avatar
zzz committed
    <target name="help" depends="all" />
    <target name="all" >
        <echo message="Useful targets: " />
        <echo message="  pkg:       distclean then package everything up (updater, installer)" />
zzz's avatar
zzz committed
        <echo message="  dist:      pkg and javadoc" />
        <echo message="  dist200:   pkg, updater200, and javadoc" />
jrandom's avatar
jrandom committed
        <echo message="  installer: build the GUI installer" />
        <echo message="  installer-freebsd: build the GUI installer (FreeBSD only)" />
        <echo message="  installer-linux: build the GUI installer (Linux only)" />
        <echo message="  installer-osx: build the GUI installer (OSX only)" />
        <echo message="  installer-windows: build the GUI installer (Windows only)" />
        <echo message="  installer-nowindows: build the GUI installer (all but Windows)" />
jrandom's avatar
jrandom committed
        <echo message="  tarball:   tar the full install into i2p.tar.bz2 (extracts to build a new clean install)" />
        <echo message="  updater:   Package the built files in i2pupdate.zip (extracts safely over existing installs)" />
        <echo message="  updater200: Updater compressed with pack200 (creates i2pupdate200.zip, 60% smaller)" />
zzz's avatar
zzz committed
        <echo message="  updaterWithJavadoc: updater including the javadocs, for display in the console" />
        <echo message="  updater200WithJavadoc: updater including the javadocs, for display in the console (creates i2pupdate200.zip)" />
        <echo message="  updaterWithJavadocAndJetty: updater including the javadocs, for display in the console, and Jetty " />
        <echo message="  updater200WithJavadocAndJetty: updater including the javadocs, for display in the console, and Jetty (creates i2pupdate200.zip)" />
        <echo message="  updaterWithJetty: Updater including Jetty" />
zzz's avatar
zzz committed
        <echo message="  updater200withJetty: Updater including Jetty" />
        <echo message="  updaterWithJettyFixes: updater including local jetty patches" />
zzz's avatar
zzz committed
        <echo message="  updaterWithGeoIP: updater including GeoIP Files" />
        <echo message="  updaterWithJettyFixesAndGeoIP" />
zzz's avatar
zzz committed
        <echo message="  updaterWithJettyFixesAndJbigi" />
        <echo message="  updaterSmall:   updater with the essentials only - no SAM, i2psnark, SusiMail, SusiDNS, or history.txt" />
        <echo message="  updaterRouter:  updater with the i2p.jar and router.jar only" />
        <echo message="  distclean: clean up all derived files" />
        <!-- <echo message="  syndie:    generate a standalone syndie install" /> -->
        <echo message="  desktopgui: generate a standalone desktopgui install" />
jrandom's avatar
jrandom committed
        <echo message="  i2psnark:  generate a standalone i2psnark install" />
        <echo message="  justBOB:  generate a standalone BOB-one.jar" />
        <echo message="  javadoc:   generate javadoc for the entire project into ./build/javadoc and ./javadoc.zip" />
zzz's avatar
zzz committed
        <echo message="  javadoc-test: Javadocs for unit test classes (build/javadoc-test)" />
        <echo message="  slackpkg:  generate Slackware packages in ./Slackware/i2p and ./Slackware/i2p-base" />
dream's avatar
dream committed
        <echo message="  debianhowto: instructions on building Debian packages" />
        <echo message="  debian: generate Debian packages in ../" />
        <echo message="          run &quot;ant debianhowto&quot; for instructions" />
        <echo message="  debian-clean: rollback debian specific patches and run the &quot;distclean&quot; target (done automatically at the end of the &quot;debian&quot; target)" />
        <!-- <echo message="  debianrepo: build a Debian repository (reprepro required)" /> -->
        <echo message="  poupdate: update the .po files for translators" />
        <echo message="  pkg-portable-win32:  build a minimum portable version for win32" />
   </target>
dream's avatar
dream committed
    <target name="debianhowto">
            <echo message="To build debian packages, you must make sure that you have" />
            <echo message="the necessary build-dependencies installed." />
            <echo message="The packages required to build can be found in the file "/>
            <echo message="&quot;debian/control&quot; in the &quot;Build-Depends&quot; field."/>
            <echo message="In addition to those packages, be sure to install &quot;fakeroot&quot;,"/>
            <echo message="&quot;quilt&quot; and &quot;build-essential&quot;!" />
            <echo message="" />
            <echo message="The following command will install all of the dependencies for you:" />
            <echo message=" " />
            <echo message="apt-get install debhelper ant debconf default-jdk gettext libgmp3-dev po-debconf fakeroot build-essential \" />
            <echo message="                   quilt libcommons-logging-java" />
            <echo message=" " />
            <echo message="Once the dependencies are installed, run &quot;ant debian&quot;"/>
            <echo message="to patch the source and build the packages." />
    </target>
    <target name="dist" depends="pkg, javadoc" />
    <target name="dist200" depends="pkg200, javadoc" />
zzz's avatar
zzz committed
    <target name="build" depends="build2">
        <!-- so we don't build standalone for the updater -->
zzz's avatar
zzz committed
        <!-- This builds apps/i2psnark/java/i2psnark-standalone.zip,
          -   which we don't distribute anywhere...
zzz's avatar
zzz committed
        <ant dir="apps/i2psnark/java/" target="standalone" />
zzz's avatar
zzz committed
        -->
zzz's avatar
zzz committed
    </target>
    <target name="build2" depends="builddep, jar, buildWEB" />
    <target name="buildSmall" depends="builddepSmall, jarSmall, buildWEB" />
    <target name="buildclean" depends="distclean, build" />

    <target name="builddep" depends="builddepSmall, buildBOB, buildSAM, buildSusiMail, buildSusiDNS, buildI2PSnark" />

    <target name="builddepSmall" depends="buildrouter, buildSystray, buildDesktopGui, buildRouterConsole, buildStreaming, buildI2PTunnel, buildAddressbook" />

    <!-- start of buildX, one for each sub-build.xml.
         Do not put ant tasks in the sub-build.xmls anymore,
         so the build will go faster.
      -->

zzz's avatar
zzz committed
    <target name="buildBOB" depends="buildStreaming" >
    </target>

    <target name="buildSAM" depends="buildStreaming" >
        <ant dir="apps/sam/java/" target="jar" />
    </target>

    <target name="buildSusiMail" depends="buildCore, buildJetty" >
        <ant dir="apps/susimail/" target="war" />
    </target>

    <target name="buildSusiDNS" depends="buildCore, buildJetty" >
        <ant dir="apps/susidns/src" target="all" />
    </target>

    <target name="buildI2PSnark" depends="buildStreaming, buildJetty" >
zzz's avatar
zzz committed
        <ant dir="apps/i2psnark/java/" target="war" />

    <target name="buildAddressbook" depends="buildCore, buildJetty" >
        <ant dir="apps/addressbook/" target="war" />
    </target>

    <!-- jar only (no war) for Android -->
    <target name="buildI2PTunnelJar" depends="buildStreaming" >
        <ant dir="apps/i2ptunnel/java/" target="jar" />
    </target>

    <target name="buildI2PTunnel" depends="buildStreaming, buildJetty" >
        <ant dir="apps/i2ptunnel/java/" target="build" />
    </target>

    <target name="buildDesktopGui" depends="buildCore, buildrouter" >
zzz's avatar
zzz committed
<!--
        <ant dir="apps/desktopgui" target="clean" />
zzz's avatar
zzz committed
-->
        <ant dir="apps/desktopgui" target="jar" />
    </target>

    <target name="buildRouterConsole" depends="buildrouter, buildSystray, buildDesktopGui, buildJetty" >
zzz's avatar
zzz committed
        <ant dir="apps/routerconsole/java/" target="jar" />
zzz's avatar
zzz committed
    <target name="buildJetty" depends="buildCore" >
        <ant dir="apps/jetty" target="build" />
    </target>

    <target name="buildSystray" depends="buildCore" >
        <ant dir="apps/systray/java/" target="jar" />
    </target>

    <target name="buildStreaming" depends="buildMinistreaming" >
jrandom's avatar
jrandom committed
        <ant dir="apps/streaming/java/" target="jar" />
    </target>

    <target name="buildMinistreaming" depends="buildCore" >
        <ant dir="apps/ministreaming/java/" target="jar" />
    </target>

    <target name="buildRouter" depends="buildrouter" />
    <target name="buildrouter" depends="buildCore" >
jrandom's avatar
jrandom committed
        <ant dir="router/java/" target="jar" />
        <copy file="router/java/build/router.jar" todir="build/" />
    </target>
zzz's avatar
zzz committed
    <target name="buildCore" depends="buildProperties" >
        <ant dir="core/java/" target="jar" />
        <copy file="core/java/build/i2p.jar" todir="build/" />
    </target>

zzz's avatar
zzz committed
    <target name="buildJrobin" depends="buildProperties" >
        <!-- take only what we need from the jrobin jar -->
        <jar destfile="build/jrobin.jar" >
            <zipfileset src="apps/jrobin/jrobin-1.5.9.1.jar"
                        excludes="org/jrobin/cmd/ org/jrobin/convertor/ org/jrobin/inspector/" />
            <manifest>
                <attribute name="Built-By" value="${build.built-by}" />
zzz's avatar
zzz committed
                <attribute name="Build-Date" value="${build.timestamp}" />
                <attribute name="Base-Revision" value="${workspace.version}" />
	    </manifest>
        </jar>
    </target>

    <target name="checkForMtn" >
        <available property="mtn.available" file="_MTN" type="dir" />
    </target>

    <target name="getMtnRev" depends="checkForMtn" if="mtn.available" >
zzz's avatar
zzz committed
        <exec executable="mtn" outputproperty="workspace.version" errorproperty="mtn.error1" failifexecutionfails="false" >
            <arg value="automate" />
            <arg value="get_base_revision_id" />
        </exec>
    <target name="buildProperties" depends="getMtnRev, getReleaseNumber, getBuildNumber" >
        <!-- default if not set above -->
        <property name="workspace.version" value="unknown" />
zzz's avatar
zzz committed
        <tstamp>
            <format property="build.timestamp" pattern="yyyy-MM-dd HH:mm:ss z" timezone="UTC" locale="en" />
        </tstamp>
        <property name="full.version" value="${release.number}-${i2p.build.number}${build.extra}" />
zzz's avatar
zzz committed
        <echo message="Building version ${full.version} (mtn rev ${workspace.version})" />
zzz's avatar
zzz committed
    </target>

    <!-- end of sub-build.xml targets -->

    <target name="buildWEB" depends="buildRouterConsole" >
        <copy file="apps/routerconsole/java/build/routerconsole.jar" todir="build/" />
        <copy file="apps/routerconsole/java/build/routerconsole.war" todir="build/" />
        <copy todir="build/" >
            <fileset dir="apps/jetty/jettylib" excludes="ant.jar" />
        </copy>
    </target>
zzz's avatar
zzz committed
    <!-- this makes an empty build/launchi2p.jar and the build/i2p.exe for the no-wrapper windows startup, if possible -->
jrandom's avatar
jrandom committed
    <target name="buildexe">
        <condition property="noExe">
            <or>
                <os arch="ppc" />
                <os arch="armv5tejl" />
                <os arch="armv6l" />
                <os arch="armv7l" />
            </or>
        </condition>
        <condition property="noExe">
            <not>
                <or>
                    <os name="Linux" />
                    <os family="windows" />
                </or>
            </not>
        </condition>
        <ant target="doBuildEXE" />
jrandom's avatar
jrandom committed
    </target>
kytv's avatar
kytv committed
    <target name="launch4j">
        <taskdef name="launch4j"
                 classname="net.sf.launch4j.ant.Launch4jTask"
                 classpath="${basedir}/installer/lib/launch4j/launch4j.jar:${basedir}/installer/lib/launch4j/lib/xstream.jar" />
     </target>
zzz's avatar
zzz committed
    <!-- this makes an empty build/launchi2p.jar and the build/i2p.exe for the no-wrapper windows startup -->
kytv's avatar
kytv committed
    <target name="doBuildEXE" depends="buildProperties, launch4j" unless="noExe">
kytv's avatar
kytv committed
        <echo message="See the file &quot;build.properties&quot; if this step fails." />
jrandom's avatar
jrandom committed
        <jar destfile="./build/launchi2p.jar">
            <manifest>
	     <attribute name="Main-Class" value="net.i2p.router.RouterLaunch" />
	     <attribute name="Class-Path" value="lib/i2p.jar lib/router.jar lib/jbigi.jar lib/BOB.jar lib/sam.jar lib/mstreaming.jar lib/streaming.jar lib/routerconsole.jar lib/i2ptunnel.jar lib/org.mortbay.jetty.jar lib/javax.servlet.jar lib/jasper-compiler.jar lib/jasper-runtime.jar lib/commons-logging.jar lib/commons-el.jar lib/wrapper.jar lib/systray.jar lib/systray4j.jar lib/desktopgui.jar lib/i2psnark.jar lib/jrobin.jar lib/jstl.jar lib/standard.jar lib/jetty-i2p.jar lib/jetty-java5-threadpool.jar lib/jetty-rewrite-handler.jar lib/jetty-sslengine.jar lib/jetty-start.jar lib/jetty-util.jar" />
             <attribute name="Built-By" value="${build.built-by}" />
zzz's avatar
zzz committed
             <attribute name="Build-Date" value="${build.timestamp}" />
             <attribute name="Base-Revision" value="${workspace.version}" />
jrandom's avatar
jrandom committed
	    </manifest>
        </jar>
	<!-- now the standalone launcher exe -->
        <launch4j configFile="./installer/i2pstandalone.xml" />
	<!-- thazzit -->
    </target>
    <target name="jar" depends="jarSmall" >
        <copy file="apps/BOB/dist/BOB.jar" todir="build/" />
        <copy file="apps/sam/java/build/sam.jar" todir="build/" />
        <copy file="apps/susimail/susimail.war" todir="build/" />
        <copy file="apps/susidns/src/susidns.war" todir="build/" />
        <copy file="apps/i2psnark/i2psnark.war" todir="build/" />
        <copy file="apps/i2psnark/java/build/i2psnark.jar" todir="build/" />
zzz's avatar
zzz committed
    <target name="jarSmall" depends="builddepSmall, buildJrobin" >
        <copy file="core/java/build/i2p.jar" todir="build/" />
        <copy file="router/java/build/router.jar" todir="build/" />
        <copy file="apps/ministreaming/java/build/mstreaming.jar" todir="build/" />
jrandom's avatar
jrandom committed
        <copy file="apps/streaming/java/build/streaming.jar" todir="build/" />
        <copy file="apps/i2ptunnel/java/build/i2ptunnel.jar" todir="build/" />
        <copy file="apps/i2ptunnel/java/build/i2ptunnel.war" todir="build/" />
        <copy file="apps/systray/java/build/systray.jar" todir="build/" />
        <copy file="apps/desktopgui/dist/desktopgui.jar" todir="build/" />
jrandom's avatar
jrandom committed
        <copy file="apps/addressbook/dist/addressbook.war" todir="build/" />
    </target>
    <target name="jbigi-list-changes" depends="checkForMtn" if="mtn.available" >
        <exec executable="mtn" outputproperty="workspace.changes.jbigi" errorproperty="mtn.error.jbigi" failifexecutionfails="false" >
            <arg value="list" />
            <arg value="changed" />
            <arg value="installer/lib/jbigi" />
        </exec>
        <!-- \n in an attribute value generates an invalid manifest -->
        <exec executable="tr" inputstring="${workspace.changes.jbigi}" outputproperty="workspace.changes.jbigi.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
            <arg value="-s" />
            <arg value="&quot;[:space:]&quot;" />
            <arg value="," />
        </exec>
    </target>

    <target name="jbigi" depends="buildProperties, jbigi-list-changes" >
        <!-- set if unset -->
        <property name="workspace.changes.jbigi.tr" value="" />
        <jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
            <fileset dir="installer/lib/jbigi" includes="*.so *.dll *.jnilib" />
            <manifest>
                <attribute name="Built-By" value="${build.built-by}" />
                <attribute name="Build-Date" value="${build.timestamp}" />
                <attribute name="Base-Revision" value="${workspace.version}" />
                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
            </manifest>
        </jar>
    </target>

    <target name="jbigi-nowindows" depends="buildProperties, jbigi-list-changes" >
        <!-- set if unset -->
        <property name="workspace.changes.jbigi.tr" value="" />
        <jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
            <fileset dir="installer/lib/jbigi" includes="*.so *.jnilib" />
            <manifest>
                <attribute name="Built-By" value="${build.built-by}" />
                <attribute name="Build-Date" value="${build.timestamp}" />
                <attribute name="Base-Revision" value="${workspace.version}" />
                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
            </manifest>
        </jar>
    </target>

    <!-- Now system-specific jbigis in alphabetical order -->
    <target name="jbigi-freebsd-only"  depends="buildProperties, jbigi-list-changes" >
        <!-- set if unset -->
        <property name="workspace.changes.jbigi.tr" value="" />
        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
            <fileset dir="installer/lib/jbigi" includes="*bsd*.so" />
            <manifest>
                <attribute name="Built-By" value="${build.built-by}" />
                <attribute name="Build-Date" value="${build.timestamp}" />
                <attribute name="Base-Revision" value="${workspace.version}" />
                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
            </manifest>
        </jar>
    </target>

    <target name="jbigi-linux-only"  depends="buildProperties, jbigi-list-changes" >
        <!-- set if unset -->
        <property name="workspace.changes.jbigi.tr" value="" />
        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
            <fileset dir="installer/lib/jbigi" includes="*linux*.so" />
            <manifest>
                <attribute name="Built-By" value="${build.built-by}" />
                <attribute name="Build-Date" value="${build.timestamp}" />
                <attribute name="Base-Revision" value="${workspace.version}" />
                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
            </manifest>
        </jar>
    </target>

    <target name="jbigi-linux-nonx86-only"  depends="buildProperties, jbigi-list-changes" >
        <!-- set if unset -->
        <property name="workspace.changes.jbigi.tr" value="" />
        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
            <fileset dir="installer/lib/jbigi" includes="*linux-arm*.so,*linux-ppc*.so" />
            <manifest>
                <attribute name="Built-By" value="${build.built-by}" />
                <attribute name="Build-Date" value="${build.timestamp}" />
                <attribute name="Base-Revision" value="${workspace.version}" />
                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
            </manifest>
        </jar>
    </target>

    <target name="jbigi-osx-only"  depends="buildProperties, jbigi-list-changes" >
        <!-- set if unset -->
        <property name="workspace.changes.jbigi.tr" value="" />
        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
            <fileset dir="installer/lib/jbigi" includes="*.jnilib" />
            <manifest>
                <attribute name="Built-By" value="${build.built-by}" />
                <attribute name="Build-Date" value="${build.timestamp}" />
                <attribute name="Base-Revision" value="${workspace.version}" />
                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
            </manifest>
        </jar>
    </target>

    <target name="jbigi-windows-only" depends="buildProperties, jbigi-list-changes" >
        <!-- set if unset -->
        <property name="workspace.changes.jbigi.tr" value="" />
        <jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
            <fileset dir="installer/lib/jbigi" includes="*windows*.dll" />
            <manifest>
                <attribute name="Built-By" value="${build.built-by}" />
                <attribute name="Build-Date" value="${build.timestamp}" />
                <attribute name="Base-Revision" value="${workspace.version}" />
                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
            </manifest>
        </jar>
    </target>
    <!-- the apps need to compile the jsps to poupdate -->
    <target name="poupdate" depends="buildRouter, buildStreaming, buildSystray, buildJetty, buildDesktopGui" >
walking's avatar
walking committed
        <echo message="Setting environment variable LG2 to a lang code (eg: de,zh,nl etc)" />
        <echo message=" will restrict language update to the language you specified, leaving other language untact." />
        <ant dir="apps/routerconsole/java/" target="poupdate" />
        <ant dir="apps/i2psnark/java/" target="poupdate" />
zzz's avatar
zzz committed
        <ant dir="apps/i2ptunnel/java/" target="poupdate" />
zzz's avatar
zzz committed
        <ant dir="apps/susidns/src/" target="poupdate" />
        <ant dir="apps/susimail/" target="poupdate" />
        <ant dir="apps/desktopgui" target="poupdate" />
        <ant dir="installer/resources/locale" target="poupdate" />
    </target>

    <target name="prep-script-translation" >
        <!-- script translation added in 0.8.13, disable for now -->
        <echo message="i2prouter script translations disabled" />
<!--
        <ant dir="installer/resources/locale" target="bundle" />
        <copy todir="pkg-temp/locale/">
            <fileset dir="installer/resources/locale/mo/" />
        </copy>
zzz's avatar
zzz committed

    <target name="javadoc" depends="getReleaseNumber, getBuildNumber" >
zzz's avatar
zzz committed
        <ant dir="apps/jetty" target="ensureJettylib" />
        <mkdir dir="./build" />
        <mkdir dir="./build/javadoc" />
kytv's avatar
kytv committed
        <javadoc access="package"
            destdir="./build/javadoc"
            packagenames="*"
            use="true"
            splitindex="true"
            doctitle="I2P Javadocs for Release ${release.number} Build ${i2p.build.number}${build.extra}"
zzz's avatar
zzz committed
            windowtitle="I2P Anonymous Network - Java Documentation - Version ${release.number}">
            <group title="Core SDK (i2p.jar)" packages="net.i2p:net.i2p.*:net.i2p.client:net.i2p.client.*:net.i2p.internal:net.i2p.internal.*:freenet.support.CPUInformation:org.bouncycastle.oldcrypto:org.bouncycastle.oldcrypto.*:gnu.crypto.*:gnu.gettext:com.nettgryppa.security:net.metanotion:net.metanotion.*" />
            <group title="Streaming Library" packages="net.i2p.client.streaming" />
            <group title="Router" packages="net.i2p.router:net.i2p.router.*:net.i2p.data.i2np:org.cybergarage.*:org.freenetproject:org.xlattice.crypto.filters" />
zzz's avatar
zzz committed
            <group title="Router Console" packages="net.i2p.router.web:net.i2p.router.update" />
            <!-- apps and bridges starting here, alphabetical please -->
            <group title="Addressbook Application" packages="net.i2p.addressbook" />
            <group title="BOB Bridge" packages="net.i2p.BOB" />
zzz's avatar
zzz committed
            <group title="BOB Demos" packages="net.i2p.BOB.Demos.echo.echoclient:net.i2p.BOB.Demos.echo.echoserver" />
zzz's avatar
zzz committed
            <group title="Desktopgui Application" packages="net.i2p.desktopgui:net.i2p.desktopgui.*" />
zzz's avatar
zzz committed
            <group title="I2PSnark Application" packages="org.klomp.snark:org.klomp.snark.*:net.i2p.kademlia" />
            <group title="I2PTunnel Application" packages="net.i2p.i2ptunnel:net.i2p.i2ptunnel.*" />
zzz's avatar
zzz committed
            <group title="Jetty Logging" packages="net.i2p.jetty" />
            <group title="SAM Bridge" packages="net.i2p.sam" />
zzz's avatar
zzz committed
            <group title="SAM Demos" packages="net.i2p.sam.client" />
            <group title="SusiDNS Application" packages="i2p.susi.dns" />
            <group title="SusiMail Application" packages="i2p.susi.webmail:i2p.susi.webmail.*:i2p.susi.debug:i2p.susi.util:org.mortbay.servlet:org.mortbay.util" />
            <group title="Systray Application" packages="net.i2p.apps.systray" />
jrandom's avatar
jrandom committed
            <sourcepath>
                <pathelement location="core/java/src" />
                <pathelement location="router/java/src" />
                <pathelement location="apps/ministreaming/java/src" />
jrandom's avatar
jrandom committed
                <pathelement location="apps/streaming/java/src" />
jrandom's avatar
jrandom committed
                <pathelement location="apps/i2ptunnel/java/src" />
                <pathelement location="apps/systray/java/src" />
                <pathelement location="apps/desktopgui/src" />
jrandom's avatar
jrandom committed
                <pathelement location="apps/routerconsole/java/src" />
                <pathelement location="apps/addressbook/java/src" />
                <pathelement location="apps/i2psnark/java/src" />
                <pathelement location="apps/sam/java/src" />
                <pathelement location="apps/BOB/src" />
zzz's avatar
zzz committed
                <pathelement location="apps/BOB/Demos/echo/echoclient/src" />
                <pathelement location="apps/BOB/Demos/echo/echoserver/src" />
                <pathelement location="apps/susidns/src/java/src" />
                <pathelement location="apps/susimail/src/src" />
                <pathelement location="apps/jetty/java/src" />
jrandom's avatar
jrandom committed
            </sourcepath>
            <classpath>
                <pathelement location="apps/jetty/jettylib/org.mortbay.jetty.jar" />
sponge's avatar
sponge committed
                <pathelement location="apps/jetty/jettylib/javax.servlet.jar" />
                <pathelement location="apps/jetty/jettylib/jetty-sslengine.jar" />
                <pathelement location="apps/jetty/jettylib/jetty-start.jar" />
                <pathelement location="apps/jetty/jettylib/jetty-java5-threadpool.jar" />
                <pathelement location="apps/jetty/jettylib/jetty-util.jar" />
                <pathelement location="apps/jetty/jettylib/jsp-api.jar" />
jrandom's avatar
jrandom committed
                <pathelement location="apps/systray/java/lib/systray4j.jar" />
zzz's avatar
zzz committed
                <pathelement location="apps/jrobin/jrobin-1.5.9.1.jar" />
                <pathelement location="installer/lib/wrapper/all/wrapper.jar" />
jrandom's avatar
jrandom committed
            </classpath>
	    <!-- These variables are stored in build.properties. 
		 End-users can override by creating the file override.properties -->
            <link offline="true" href="${javasedocs.url}" packagelistLoc="installer/resources/package-lists/java/" />
            <link offline="true" href="${jettydocs.url}" packagelistLoc="installer/resources/package-lists/jetty/" />
            <link offline="true" href="${jrobindocs.url}" packagelistLoc="installer/resources/package-lists/jrobin/" />
            <link offline="true" href="${wrapperdocs.url}" packagelistLoc="installer/resources/package-lists/wrapper/" />
jrandom's avatar
jrandom committed
        </javadoc>
        <echo message="Warning, javadoc embeds timestamps in the output, run with 'TZ=UTC ant javadoc' if you plan to distribute" />
	<zip destfile="javadoc.zip" basedir="build" level="9" includes="javadoc\**" />
zzz's avatar
zzz committed
    </target>

    <target name="javadoc-test" depends="buildRouter, javadoc" >
        <mkdir dir="./build" />
        <mkdir dir="./build/javadoc-test" />
        <javadoc access="package"
            destdir="./build/javadoc-test"
            packagenames="*"
            use="true"
            splitindex="true"
            doctitle="I2P Unit Test Javadocs for Release ${release.number} Build ${i2p.build.number}${build.extra}"
zzz's avatar
zzz committed
            windowtitle="I2P Anonymous Network - Java Documentation - Version ${release.number}">
            <group title="Core SDK" packages="net.i2p:net.i2p.*:net.i2p.client:net.i2p.client.*:net.i2p.internal:net.i2p.internal.*:freenet.support.CPUInformation:org.bouncycastle.oldcrypto:org.bouncycastle.oldcrypto.*:gnu.crypto.*:gnu.gettext:org:com.nettgryppa.security:net.metanotion:net.metanotion.*" />
            <group title="Router" packages="net.i2p.router:net.i2p.router.*:net.i2p.data.i2np:org.cybergarage.*:org.freenetproject:org.xlattice.crypto.filters" />
zzz's avatar
zzz committed
            <sourcepath>
                <pathelement location="core/java/test/junit" />
                <pathelement location="router/java/test/junit" />
zzz's avatar
zzz committed
            </sourcepath>
            <classpath>
                <pathelement location="build/i2p.jar" />
                <pathelement location="build/router.jar" />
                <pathelement location="${ant.home}/lib/junit.jar" />
            </classpath>
	    <!-- These variables are stored in build.properties. 
		 End-users can override by creating the file override.properties -->
            <link offline="true" href="${javasedocs.url}" packagelistLoc="installer/resources/package-lists/java/" />
            <link offline="true" href="${junitdocs.url}" packagelistLoc="installer/resources/package-lists/junit/" />
            <link offline="true" href="${i2pdocs.url}" packagelistLoc="build/javadoc/" />
        </javadoc>
        <echo message="Warning, javadoc embeds timestamps in the output, run with 'TZ=UTC ant javadoc' if you plan to distribute" />
    </target>
    <target name="getReleaseNumber">
        <loadfile srcfile="core/java/src/net/i2p/CoreVersion.java" property="release.number">
            <filterchain>
                <linecontains>
                    <contains value="public final static String VERSION"/>
                </linecontains>
                <tokenfilter>
                    <replaceregex pattern=".*&quot;(.*)&quot;;" replace="\1" flags="gi" />
                </tokenfilter>
                <striplinebreaks/>
                <trim/>
                <ignoreblank/>
            </filterchain>
        </loadfile>
        <property name="release.number" value="unknown" />
zzz's avatar
zzz committed
        <echo message="Release number is ${release.number}" />
    </target>

    <target name="getBuildNumber">
        <loadfile srcfile="router/java/src/net/i2p/router/RouterVersion.java" property="i2p.build.number">
            <filterchain>
                <linecontains>
                    <contains value="public final static long BUILD" />
                </linecontains>
                <tokenfilter>
kytv's avatar
kytv committed
                    <replaceregex pattern=".*=\s([0-9]+);" replace="\1" flags="gi" />
                </tokenfilter>
                <striplinebreaks/>
                <trim/>
                <ignoreblank/>
            </filterchain>
        </loadfile>
        <loadfile srcfile="router/java/src/net/i2p/router/RouterVersion.java" property="build.extra">
            <filterchain>
                <linecontains>
                    <contains value="public final static String EXTRA" />
                </linecontains>
                <tokenfilter>
                    <replaceregex pattern=".*&quot;(.*)&quot;;" replace="\1" flags="gi" />
                </tokenfilter>
                <striplinebreaks/>
                <ignoreblank/>
                <trim/>
            </filterchain>
        </loadfile>
        <property name="i2p.build.number" value="??" />
        <property name="build.extra" value="" />
        <echo message="Build number is ${i2p.build.number}${build.extra}" />
zzz's avatar
zzz committed
    </target>

    <target name="verifyReleaseBuildNumbers" depends="getReleaseNumber, getBuildNumber" >
zzz's avatar
zzz committed
        <echo message="SDK: ${java.vendor} ${java.version} (${java.runtime.name} ${java.runtime.version})" />
        <fail message="Bad release number: ${release.number}" >
            <condition>
                <or>
                    <equals arg1="${release.number}" arg2="unknown"/>
                    <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>

        <delete dir="./build" />
        <delete dir="./reports" />
        <delete file="installer/lib/izpack/patches.jar" failonerror="false" quiet="true" />
jrandom's avatar
jrandom committed
        <delete file="syndie-standalone.zip" failonerror="false" quiet="true" />
        <delete failonerror="false" quiet="true">
            <fileset dir="." includes="i2pinstall*jar i2p.fba ${sloccount.report.file} javadoc.zip i2pinstall*.exe i2pinstall*bz2" />
jrandom's avatar
jrandom committed
        <delete file="i2psnark-standalone.zip" failonerror="false" quiet="true" />
        <delete file="BOB-one.jar" failonerror="false" quiet="true" />
        <delete dir="debian/tmp" />
HungryHobo's avatar
HungryHobo committed
        <delete dir="debian/db" />
        <delete file="debian/files" />
HungryHobo's avatar
HungryHobo committed
        <delete file="debian/build" />
    <target name="distclean" depends="clean">
zzz's avatar
zzz committed
        <delete includeemptydirs="true" failonerror="false" >
            <fileset dir="debian/packages" followSymlinks="false" />
HungryHobo's avatar
HungryHobo committed
        </delete>
        <delete dir="debian/repo" />
        <ant dir="core/java/" target="distclean" />
        <ant dir="router/java/" target="distclean" />
        <ant dir="apps/ministreaming/java/" target="distclean" />
jrandom's avatar
jrandom committed
        <ant dir="apps/streaming/java/" target="distclean" />
        <ant dir="apps/i2ptunnel/java/" target="distclean" />
        <ant dir="apps/sam/java/" target="distclean" />
        <ant dir="apps/desktopgui" target="clean" />
        <ant dir="apps/routerconsole/java/" target="distclean" />
jrandom's avatar
jrandom committed
        <ant dir="apps/addressbook/" target="distclean" />
jrandom's avatar
jrandom committed
        <ant dir="apps/susimail/" target="distclean" />
jrandom's avatar
jrandom committed
        <ant dir="apps/susidns/src/" target="distclean" />
        <ant dir="apps/systray/java/" target="distclean" />
jrandom's avatar
jrandom committed
        <ant dir="apps/i2psnark/java/" target="distclean" />
        <ant dir="apps/jetty/" 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" />
kytv's avatar
kytv committed
	<!--
		NOTE! We need to turn off the default excludes for these
kytv's avatar
kytv committed
		patterns to work.
		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~" />
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
            -->
        </delete>
	<!--
		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" />
    </target>

    <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>
    </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>

    <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" />
    <target name="preppkg-windows" depends="preppkg-base, buildexe">
zzz's avatar
zzz committed
        <copy file="build/i2p.exe" todir="pkg-temp/" failonerror="false" />
        <copy file="apps/systray/java/lib/systray4j.dll" todir="pkg-temp/lib" />
        <copy file="apps/systray/java/resources/iggy.ico" todir="pkg-temp/icons" />
        <copy file="apps/systray/java/resources/iggy.xpm" todir="pkg-temp/icons" />
        <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/" />
kytv's avatar
kytv committed
        <copy file="installer/resources/fixpaths.cmd" 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="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
        <copy todir="pkg-temp/lib/wrapper/win32/">
            <fileset dir="installer/lib/wrapper/win32/" excludes="*.txt" />
        </copy>
	<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" />
	<copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
    </target>
zzz's avatar
zzz committed
    <target name="preppkg-base" depends="build, preplicenses, prepConsoleDocs, prepthemeupdates, prepCertificates">
        <!-- 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" />
        </delete>
        <copy file="build/i2p.jar" todir="pkg-temp/lib/" />
        <copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
        <!-- all jetty stuff -->
        <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" />
        <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/" />
        <!-- pulled out of routerconsole.jar in 0.7.12; 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="apps/systray/java/lib/systray4j.jar" todir="pkg-temp/lib" />
        <copy file="build/i2ptunnel.war" todir="pkg-temp/webapps/" />
        <copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
jrandom's avatar
jrandom committed
        <copy file="build/addressbook.war" todir="pkg-temp/webapps/" />
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="apps/susidns/src/WEB-INF/lib/jstl.jar" todir="pkg-temp/lib/" />
        <copy file="apps/susidns/src/WEB-INF/lib/standard.jar" todir="pkg-temp/lib/" />
jrandom's avatar
jrandom committed
        <copy file="build/i2psnark.war" todir="pkg-temp/webapps/" />
kytv's avatar
kytv committed
	<!--
	     Disabling per zzz's statement on IRC: jetty-i2psnark.xml is for an obscure feature that is broken anyway,
	     					   you can remove the file, the link, and the patch from the package

kytv's avatar
kytv committed
		     So I'm going one further: I'm disabling it in build.xml
kytv's avatar
kytv committed
	<copy file="apps/i2psnark/jetty-i2psnark.xml" todir="pkg-temp/" />
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/" />
zzz's avatar
zzz committed
        <!-- overwrite the truncated history put in by the updater -->
        <copy file="history.txt" todir="pkg-temp/" overwrite="true" />
smeghead's avatar
smeghead committed
        <mkdir dir="pkg-temp/scripts" />
        <copy file="apps/proxyscript/i2pProxy.pac" 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" />
    <target name="preplicenses">
zzz's avatar
zzz committed
        <copy file="LICENSE.txt" todir="pkg-temp/" />
        <copy todir="pkg-temp/licenses/" >
          <fileset dir="licenses/" />
        </copy>
        <!--
              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" />
        <copy file="apps/jetty/apache-tomcat-deployer/NOTICE" tofile="pkg-temp/licenses/NOTICE-Tomcat.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>
    <!-- this is no longer required, izpack 4.3.0 supports headless installs with java -jar i2pinstall.exe -console -->
    <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" />
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>
    </target>
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; im.png added in 0.8.12; -->
          <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" />
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="updater200WithJettyFixes" depends="prepjupdatefixes, preplicenses, pack200, zipit200" />
    <target name="updater200WithJettyFixesAndJbigi" depends="prepjupdatefixes, 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="updaterWithJettyFixes" depends="prepjupdatefixes, preplicenses, zipit" />
    <target name="updaterWithJettyFixesAndJbigi" depends="prepjupdatefixes, prepjbigiupdate, preplicenses, zipit" />
    <target name="updaterWithJettyFixesAndGeoIP" depends="prepjupdatefixes, prepgeoupdate, preplicenses, zipit" />
zzz's avatar
zzz committed
    <target name="updaterSmall" depends="prepupdateSmall, zipit" />
    <target name="updaterRouter" depends="prepupdateRouter, zipit" />
zzz's avatar
zzz committed

    <target name="zipit" depends="getReleaseNumber" >
        <!--
             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}" />
    </target>
        <!-- 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/jasper-compiler.jar -o $i = pkg-temp/lib/jbigi.jar ]; 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/jasper-compiler.jar -o $i = pkg-temp/lib/jbigi.jar ]; 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" />