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

Skip to content
Snippets Groups Projects
build.xml 77.4 KiB
Newer Older
  • Learn to ignore specific revisions
  •              classname="com.izforge.izpack.ant.IzPackTask" />
    
        <target name="izpack-patches" >
            <jar destfile="${basedir}/installer/lib/izpack/patches.jar"
                 basedir="${basedir}/installer/lib/izpack/patches" />
        </target>
    
        <target name="installer" depends="preppkg, buildProperties, util-list-changes, izpack-patches" >
    
            <mkdir dir="pkg-temp/installer" />
            <!-- set if unset -->
            <property name="workspace.changes.util.tr" value="" />
    
    zzz's avatar
    zzz committed
            <jar destfile="./pkg-temp/installer/copy.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Copy.class net/i2p/util/FileUtil.class">
    
    zzz's avatar
    zzz committed
                <manifest>
                    <attribute name="Main-Class" value="net.i2p.util.Copy" />
                    <attribute name="Build-Date" value="${build.timestamp}" />
                    <attribute name="Base-Revision" value="${workspace.version}" />
                    <attribute name="Workspace-Changes" value="${workspace.changes.util.tr}" />
                </manifest>
    
    jrandom's avatar
    jrandom committed
            </jar>
    
    zzz's avatar
    zzz committed
            <jar destfile="./pkg-temp/installer/delete.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Delete.class net/i2p/util/FileUtil.class">
    
    zzz's avatar
    zzz committed
                <manifest>
                    <attribute name="Main-Class" value="net.i2p.util.Delete" />
                    <attribute name="Build-Date" value="${build.timestamp}" />
                    <attribute name="Base-Revision" value="${workspace.version}" />
                    <attribute name="Workspace-Changes" value="${workspace.changes.util.tr}" />
                </manifest>
    
    jrandom's avatar
    jrandom committed
            </jar>
    
    zzz's avatar
    zzz committed
            <jar destfile="./pkg-temp/installer/exec.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Exec.class">
    
    zzz's avatar
    zzz committed
                <manifest>
                    <attribute name="Main-Class" value="net.i2p.util.Exec" />
                    <attribute name="Build-Date" value="${build.timestamp}" />
                    <attribute name="Base-Revision" value="${workspace.version}" />
                    <attribute name="Workspace-Changes" value="${workspace.changes.util.tr}" />
                </manifest>
    
    jrandom's avatar
    jrandom committed
            </jar>
    
            <!--
              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>
    
    jrandom's avatar
    jrandom committed
        <target name="installerexe">
    
            <condition property="noExe">
    	    <os arch="x86_64" />
    	</condition>
            <condition property="noExe">
    	    <os arch="amd64" />
    	</condition>
    
    	<condition property="noExe">
    	   <not>
    	    <or>
    	     <os name="Linux" />
    	     <os family="windows" />
    	    </or>
    	   </not>
    	</condition>
    
    jrandom's avatar
    jrandom committed
    	<ant target="doInstallerEXE" />
        </target>
    
        <target name="doInstallerEXE" unless="noExe">
    
    jrandom's avatar
    jrandom committed
    	<!-- now the installer exe -->
            <launch4j configFile="./installer/i2pinstaller.xml" />
            <launch4j configFile="./installer/i2pstandalone.xml" />
    	<!-- thazzit -->
    
    zzz's avatar
    zzz committed
    
    
        <target name="installer-freebsd" depends="clean, preppkg-freebsd-only, getReleaseNumber, getBuildNumber, buildProperties, util-list-changes, izpack-patches" >
    
            <mkdir dir="pkg-temp/installer" />
            <!-- set if unset -->
            <property name="workspace.changes.util.tr" value="" />
    
    	<izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${release.number}-${build.number}${build.extra}_freebsd-only.jar" installerType="standard" basedir="${basedir}" />
    
        <target name="installer-linux" depends="clean, preppkg-linux-only, getReleaseNumber, getBuildNumber, buildProperties, util-list-changes, izpack-patches" >
    
            <mkdir dir="pkg-temp/installer" />
            <!-- set if unset -->
            <property name="workspace.changes.util.tr" value="" />
    
    	<izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${release.number}-${build.number}${build.extra}_linux-only.jar" installerType="standard" basedir="${basedir}" />
    
        <target name="installer-osx" depends="clean, checkForIzpack2App, preppkg-osx-only, getReleaseNumber, getBuildNumber, buildProperties, util-list-changes, izpack-patches">
    
            <mkdir dir="pkg-temp/installer" />
    	<mkdir dir="pkg-temp/osx" />
            <!-- set if unset -->
            <property name="workspace.changes.util.tr" value="" />
    
    	<izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${release.number}-${build.number}${build.extra}_osx-only.jar" installerType="standard" basedir="${basedir}" />
    
    	<ant target="installer2app" />
    	<delete dir="pkg-temp/osx" />
        </target>
    
        <target name="checkForIzpack2App">
            <available property="izpack2app.available" file="${user.home}/IzPack/utils/wrappers/izpack2app/izpack2app.py" />
        </target>
    
        <target name="installer2app" if="izpack2app.available">
    	<mkdir dir="pkg-temp/osx" />
    	<exec executable="python" failonerror="true">
    	    <arg value="${user.home}/IzPack/utils/wrappers/izpack2app/izpack2app.py" />
    
    	    <arg value="${basedir}/i2pinstall_${release.number}-${build.number}${build.extra}_osx-only.jar" />
    	    <arg value="${basedir}/pkg-temp/osx/i2p-${release.number}-${build.number}${build.extra}_osx-install.app" />
    
    	<exec executable="chmod" failonerror="true" osfamily="unix">
    		<arg value="755" />
    
    		<arg value="${basedir}/pkg-temp/osx/i2p-${release.number}-${build.number}${build.extra}_osx-install.app/Contents/MacOS/JavaApplicationStub" />
    
    	</exec>
    	<exec executable="tar" osfamily="unix" failonerror="true">
    		<arg value="--owner=root" />
    		<arg value="--group=root" />
    		<arg value="-cjvf" />
    
    		<arg value="${basedir}/i2pinstall_${release.number}-${build.number}${build.extra}_osx.tar.bz2" />
    
    		<arg value="-C" />
    		<arg value="${basedir}/pkg-temp/osx" />
    
    		<arg value="i2p-${release.number}-${build.number}${build.extra}_osx-install.app" />
    
    	</exec>
    
        </target>
    
        <!-- Yes, even though this makes an installer for Windows, we still need to depend on preppkg-unix (because the installer attempts to delete these files
         and will fail if they don't exist. Thankfully these files are so very small there's not much harm in including them.
        -->
    
        <target name="installer-windows" depends="clean, doBuildEXE, preppkg-windows-only, preppkg-unix, getReleaseNumber, getBuildNumber, buildProperties, util-list-changes, izpack-patches" >
    
            <mkdir dir="pkg-temp/installer" />
            <!-- set if unset -->
            <property name="workspace.changes.util.tr" value="" />
            <jar destfile="./pkg-temp/installer/copy.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Copy.class net/i2p/util/FileUtil.class">
                <manifest>
                    <attribute name="Main-Class" value="net.i2p.util.Copy" />
                    <attribute name="Build-Date" value="${build.timestamp}" />
                    <attribute name="Base-Revision" value="${workspace.version}" />
                    <attribute name="Workspace-Changes" value="${workspace.changes.util.tr}" />
                </manifest>
            </jar>
            <jar destfile="./pkg-temp/installer/delete.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Delete.class net/i2p/util/FileUtil.class">
                <manifest>
                    <attribute name="Main-Class" value="net.i2p.util.Delete" />
                    <attribute name="Build-Date" value="${build.timestamp}" />
                    <attribute name="Base-Revision" value="${workspace.version}" />
                    <attribute name="Workspace-Changes" value="${workspace.changes.util.tr}" />
                </manifest>
            </jar>
            <jar destfile="./pkg-temp/installer/exec.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Exec.class">
                <manifest>
                    <attribute name="Main-Class" value="net.i2p.util.Exec" />
                    <attribute name="Build-Date" value="${build.timestamp}" />
                    <attribute name="Base-Revision" value="${workspace.version}" />
                    <attribute name="Workspace-Changes" value="${workspace.changes.util.tr}" />
                </manifest>
            </jar>
    
    	<izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${release.number}-${build.number}${build.extra}_windows-only.jar" installerType="standard" basedir="${basedir}" />
    
    	<delete dir="pkg-temp/win" />
        </target>
    
    
    kytv's avatar
    kytv committed
        <target name="installer-all" depends="installer-freebsd, installer-linux, installer-osx, installer-windows, installer" >
    
        </target>
        <!-- end custom installers -->
    
    kytv's avatar
    kytv committed
    
    
        <target name="test" depends="buildProperties, jbigi" >
            <mkdir dir="reports/core/junit/" />
    
    comwiz's avatar
    comwiz committed
            <ant dir="core/java/" target="test" />
        </target>
    
    zzz's avatar
    zzz committed
        <target name="junit.report" depends="buildProperties" >
    
    comwiz's avatar
    comwiz committed
            <ant dir="core/java/" target="junit.report" />
        </target>
    
    zzz's avatar
    zzz committed
        <target name="clover.report" depends="buildProperties" >
    
    comwiz's avatar
    comwiz committed
            <ant dir="core/java/" target="clover.report" />
        </target>
        <target name="test.report" depends="junit.report, clover.report"/>
    
    zzz's avatar
    zzz committed
        <target name="fulltest" depends="buildProperties" >
    
    comwiz's avatar
    comwiz committed
    		<ant dir="core/java/" target="fulltest" />
    
    comwiz's avatar
    comwiz committed
    		<ant dir="router/java/" target="fulltest" />
        </target>
    
    zzz's avatar
    zzz committed
        <target name="fullclovertest" depends="buildProperties" >
    
    comwiz's avatar
    comwiz committed
    		<ant dir="core/java/" target="fullclovertest" />
    		<ant dir="router/java/" target="fullclovertest" />
    
    comwiz's avatar
    comwiz committed
        </target>
    
    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" />
        </target>
    
    
    
        <!-- <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
        <target name="i2psnark" depends="buildProperties" >
    
    jrandom's avatar
    jrandom committed
            <ant dir="apps/i2psnark/java" target="standalone" />
            <copy file="apps/i2psnark/java/i2psnark-standalone.zip" todir="." />
        </target>
    
        <target name="slackpkg">
            <echo message="Building Slackware package." />
            <ant dir="Slackware/i2p/" target="slackpkg" />
            <ant dir="Slackware/i2p-base/" target="slackpkg" />
        </target>
    
        <target name="justBOB" depends="builddepSmall">
            <ant dir="apps/BOB/" target="onejar" />
            <copy file="apps/BOB/dist/BOB-one.jar" todir="." />
        </target>
    
    zzz's avatar
    zzz committed
        <target name="findbugs" depends="build2">
            <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-compiler.jar:build/jasper-runtime.jar:build/javax.servlet.jar:build/org.mortbay.jetty.jar:apps/jrobin/jrobin-1.5.9.1.jar:apps/systray/java/lib/systray4j.jar:installer/lib/wrapper/all/wrapper.jar:apps/susidns/src/WEB-INF/lib/standard.jar:apps/susidns/src/WEB-INF/lib/jstl.jar:apps/jrobin/jrobin-1.5.9.1.jar"/>
    
    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/"/>
                <!-- start of the files to be analyzed -->
                <arg value="build/BOB.jar"/>
                <arg value="build/addressbook.war"/>
                <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/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"/>
            </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
    -->
    
    zzz's avatar
    zzz committed
        <target name="release" depends="distclean, testscripts, updater, updater200, preppkg, installer, getReleaseNumber" >
    
    zzz's avatar
    zzz committed
            <echo message="================================================================" />
            <echo message="Did you update these files?" />
    
    zzz's avatar
    zzz committed
            <exec executable="ls" failonerror="true">
    
    zzz's avatar
    zzz committed
                <arg value="-l" />
                <arg value="history.txt" />
                <arg value="installer/install.xml" />
    
                <arg value="installer/resources/news.xml" />
    
    zzz's avatar
    zzz committed
    	    <arg value="core/java/src/net/i2p/CoreVersion.java" />
    	    <arg value="router/java/src/net/i2p/router/RouterVersion.java" />
            </exec>
    
    zzz's avatar
    zzz committed
            <echo message="Everything is checked in, right? Let's be sure:" />
    
    zzz's avatar
    zzz committed
            <exec executable="mtn" failonerror="true">
    
    zzz's avatar
    zzz committed
                <arg value="st" />
            </exec>
    
    zzz's avatar
    zzz committed
            <echo message="If there are any modified files above, stop now!" />
    
    zzz's avatar
    zzz committed
    
    
    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.exe" tofile="i2pinstall_${release.number}.exe" />
            <delete file="i2pupdate.sud" failonerror="false" />
    
            <delete file="i2pupdate.su2" failonerror="false" />
    
    zzz's avatar
    zzz committed
            <input message="Enter private signing key file:" addproperty="release.privkey" />
            <fail message="You must enter a path." >
                <condition>
                    <equals arg1="${release.privkey}" arg2=""/>
                </condition>
            </fail>
    
    zzz's avatar
    zzz committed
            <echo message="Key file is ${release.privkey}" />
    
    zzz's avatar
    zzz committed
            <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
                <classpath>
                    <pathelement location="build/i2p.jar" />
                </classpath>
                <arg value="sign" />
                <arg value="i2pupdate.zip" />
                <arg value="i2pupdate.sud" />
                <arg value="${release.privkey}" />
                <arg value="${release.number}" />
            </java>
            <echo message="Verify version and VALID signature:" />
            <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
                <classpath>
                    <pathelement location="build/i2p.jar" />
                </classpath>
                <arg value="verifysig" />
                <arg value="i2pupdate.sud" />
            </java>
    
    zzz's avatar
    zzz committed
            <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
                <classpath>
                    <pathelement location="build/i2p.jar" />
                </classpath>
                <arg value="verifyversion" />
                <arg value="i2pupdate.sud" />
            </java>
    
    zzz's avatar
    zzz committed
            <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
                <classpath>
                    <pathelement location="build/i2p.jar" />
                </classpath>
                <arg value="showversion" />
                <arg value="i2pupdate.sud" />
            </java>
    
            <!-- now build and verify the packed sud from the packed zip -->
            <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
                <classpath>
                    <pathelement location="build/i2p.jar" />
                </classpath>
                <arg value="sign" />
                <arg value="i2pupdate200.zip" />
                <arg value="i2pupdate.su2" />
                <arg value="${release.privkey}" />
                <arg value="${release.number}" />
            </java>
            <echo message="Verify version and VALID signature:" />
            <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
                <classpath>
                    <pathelement location="build/i2p.jar" />
                </classpath>
                <arg value="verifysig" />
                <arg value="i2pupdate.su2" />
            </java>
    
    zzz's avatar
    zzz committed
            <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
                <classpath>
                    <pathelement location="build/i2p.jar" />
                </classpath>
                <arg value="verifyversion" />
                <arg value="i2pupdate.su2" />
            </java>
    
            <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
                <classpath>
                    <pathelement location="build/i2p.jar" />
                </classpath>
                <arg value="showversion" />
                <arg value="i2pupdate.su2" />
            </java>
    
    zzz's avatar
    zzz committed
            <!-- will this 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" />
                <arg value="-b" />
                <arg value="i2p.i2p" />
    
    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
            <delete file="i2pinstall_${release.number}.exe.sig" />
            <delete file="i2psource_${release.number}.tar.bz2.sig" />
            <delete file="i2pupdate_${release.number}.zip.sig" />
    
    zzz's avatar
    zzz committed
            <exec executable="gpg" failonerror="true">
    
    zzz's avatar
    zzz committed
                <arg value="-b" />
                <arg value="i2pinstall_${release.number}.exe" />
            </exec>
    
    zzz's avatar
    zzz committed
            <exec executable="gpg" failonerror="true">
    
    zzz's avatar
    zzz committed
                <arg value="-b" />
                <arg value="i2psource_${release.number}.tar.bz2" />
            </exec>
    
    zzz's avatar
    zzz committed
            <exec executable="gpg" failonerror="true">
    
    zzz's avatar
    zzz committed
                <arg value="-b" />
                <arg value="i2pupdate_${release.number}.zip" />
            </exec>
            <echo message="File sizes:" />
    
    zzz's avatar
    zzz committed
            <exec executable="ls" failonerror="true">
    
    zzz's avatar
    zzz committed
                <arg value="-l" />
                <arg value="i2pinstall_${release.number}.exe" />
                <arg value="i2psource_${release.number}.tar.bz2" />
                <arg value="i2pupdate_${release.number}.zip" />
    
                <arg value="i2pupdate.su2" />
    
    zzz's avatar
    zzz committed
                <arg value="i2pupdate.sud" />
                <arg value="i2pinstall_${release.number}.exe.sig" />
                <arg value="i2psource_${release.number}.tar.bz2.sig" />
                <arg value="i2pupdate_${release.number}.zip.sig" />
            </exec>
            <echo message="SHA256 sums:" />
    
    zzz's avatar
    zzz committed
            <exec executable="sha256sum" failonerror="true">
    
    zzz's avatar
    zzz committed
                <arg value="i2pinstall_${release.number}.exe" />
                <arg value="i2psource_${release.number}.tar.bz2" />
                <arg value="i2pupdate_${release.number}.zip" />
    
                <arg value="i2pupdate.su2" />
    
    zzz's avatar
    zzz committed
                <arg value="i2pupdate.sud" />
            </exec>
    
    zzz's avatar
    zzz committed
            <echo message="Don't forget to mtn tag w: i2p-${release.number}" />
    
    zzz's avatar
    zzz committed
            <echo message="... and mtn cert t:i2p-${release.number} branch i2p.i2p.release" />
    
    zzz's avatar
    zzz committed
        </target>
    
    kytv's avatar
    kytv committed
        <target name="debian" depends="debian-clean, debian-binary" />
    
    kytv's avatar
    kytv committed
        <target name="debian-binary" >
            <echo message="Did you update the version using dch -i?" />
    
            <echo message=" " />
            <echo message="If the changelog was not updated with dch -i, press" />
            <echo message="press CTRL+C to abort building this Debian package." />
            <echo message="" />
            <echo message="Pausing build for ten seconds to give enough time to read this notice." />
            <exec executable="sleep" failonerror="true">
                    <arg value="10" />
            </exec>
    
    HungryHobo's avatar
    HungryHobo committed
            <echo message="====================" />
    
    
            <exec executable="fakeroot" failonerror="true">
                <arg value="debian/rules" />
                <arg value="patch" />
                <arg value="binary" />
                <arg value="clean" />
    
    kytv's avatar
    kytv committed
        </target>
    
    kytv's avatar
    kytv committed
        <target name="debian-clean" depends="buildProperties" >
            <exec executable="fakeroot" failonerror="true">
    
                <arg value="debian/rules" />
                <arg value="clean" />
    
    kytv's avatar
    kytv committed
        <target name="debian-patch" depends="buildProperties" >
            <exec executable="quilt" failonerror="true">
                <arg value="-a" />
                <arg value="push" />
    
            </exec>
            <echo message="====================" />
    
    kytv's avatar
    kytv committed
        </target>
        <target name="debian-unpatch" depends="buildProperties">
            <exec executable="quilt" failonerror="false">
    
                <arg value="-a" />
                <arg value="pop" />
    
            </exec>
        </target>
    
    kytv's avatar
    kytv committed
    
    
    HungryHobo's avatar
    HungryHobo committed
        <target name="debianrepo" depends="debian">
    
            <exec dir="debian" executable="./makerepo.sh" failonerror="true"/>
    
    HungryHobo's avatar
    HungryHobo committed
        </target>
    
    kytv's avatar
    kytv committed
    <!-- the following are appened to help build barebone portable version,
    
         none of the above is modified for this purpose -->
    	<target name = "pkg-portable-clean">
    		<delete dir="build/" />
    
    walking's avatar
    walking committed
    		<delete dir="pkg-temp/" />
    
    		<delete>
    			<fileset dir="." includes="portable-**.zip**" />
    		</delete>
    	</target>
    <!-- build a portable archive -->
    
    kytv's avatar
    kytv committed
    <!-- *0* Since we simply pack all files in folder "build/" into our archieve,
    
    walking's avatar
    walking committed
    		we need to make sure its small, with NO redundent jars or wars.
    		thus cleaning is required before each build-->
    	<target name="buildSmallOnly" depends="pkg-portable-clean,buildSmall"/>
    
    <!-- *1* preparing the jars by OS dependent de-bloating -->
    
    	<target name="preppkg-portable-win32-jbigi" depends="buildSmallOnly, jbigi-windows-only" />
    
    	<target name="preppkg-portable-linux-jbigi"  depends="buildSmallOnly, jbigi-linux-only" />
    
    walking's avatar
    walking committed
    
    <!-- *2* os independent procedure  -->
    
    	<target name="preppkg-portable-basic" >
    
    walking's avatar
    walking committed
    		<mkdir dir="pkg-temp" />
    
    			<!-- non OS dependent configurations only, dont add *nux/win stuff here -->
    
    walking's avatar
    walking committed
    			<copy todir="pkg-temp">
    
    				<fileset dir="installer/resources/portable/configs/" />
    			</copy>
    
    walking's avatar
    walking committed
    			<copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
    			<copy file="installer/resources/hosts.txt" todir="pkg-temp/" />
    			<copy file="installer/resources/readme.license.txt" todir="pkg-temp/" />
    		<mkdir dir="pkg-temp/addressbook" />
    			<copy file="apps/addressbook/subscriptions.txt" todir="pkg-temp/addressbook/" />
    			<copy file="apps/addressbook/myhosts.txt"  todir="pkg-temp/addressbook/" />
    
    			<!-- config.txt is in installer/resources/portable -->
    
    walking's avatar
    walking committed
    		<mkdir dir="pkg-temp/docs" />
    
    			<copy file="installer/resources/initialNews/initialNews.xml" tofile="pkg-temp/docs/news.xml" overwrite="true" />
    
    walking's avatar
    walking committed
    			<copy file="installer/resources/readme/readme.html" tofile="pkg-temp/docs/readme.html" />
    			<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/" />
    			<!-- HTTP Header files, english only,
    
    				if you need a different lang do it in a seperate target -->
    
    walking's avatar
    walking committed
    			<copy todir="pkg-temp/docs/" >
    
    				<fileset dir="installer/resources/proxy/"  includes="**-header.ht" />
    			</copy>
    
    walking's avatar
    walking committed
    			<!-- Theme light only -->
    			<copy todir="pkg-temp/docs/themes/console/light/" overwrite="true" >
    
    				<fileset dir="installer/resources/themes/console/light/" includes="**.css" />
    			</copy>
    
    			<copy file="installer/resources/themes/console/light/console_big.css" todir="portable/docs/themes/console/light/" />
    
    walking's avatar
    walking committed
    			<copy todir="pkg-temp/docs/themes/console/images/" >
    
    				<fileset dir="installer/resources/themes/console/images/" />
    			</copy>
    
    walking's avatar
    walking committed
    			<!-- FLAGs for language icon (not for ip)-->
    			<copy todir="pkg-temp/docs/icons/flags" >
    
    				<fileset dir="installer/resources/icons/flags/" includes="cn.png,de.png,fr.png,nl.png,ru.png,se.png,us.png" />
    			</copy>
    
    walking's avatar
    walking committed
    		<mkdir dir="pkg-temp/webapps" />
    			<copy todir="pkg-temp/webapps/">
    
    				<fileset dir="build/" includes="**.war" />
    			</copy>
    
    walking's avatar
    walking committed
    		<mkdir dir="pkg-temp/lib" />
    			<copy todir ="pkg-temp/lib/" >
    				<fileset dir="build/" includes="**.jar" />
    			</copy>
    			<!-- 3rd party jars from apps/  -->
    				<!-- jrobin - without jobin , you lost graph and get a lot error entry in logs -->
    
    zzz's avatar
    zzz committed
    			<copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
    
    	</target>
    <!-- *3* os dependent procedure/commands -->
    
    walking's avatar
    walking committed
    	<target name = "preppkg-portable-win32" depends="preppkg-portable-win32-jbigi,preppkg-portable-basic">
    
    			<!-- systray4.j  - why do we need trayicons for portable version ? dependency hardcoded in console -->
    
    walking's avatar
    walking committed
    		<copy file="apps/systray/java/lib/systray4j.dll" todir="pkg-temp/lib" />
    		<copy file="apps/systray/java/lib/systray4j.jar" todir="pkg-temp/lib" />
    
    			<!--wrapper - dont even think about it. i2p cosumes appreantly more mem without it on win32-->
    
    walking's avatar
    walking committed
    		<copy file="installer/lib/wrapper/win32/wrapper.dll" todir="pkg-temp/lib" />
    
    		<copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
    
    walking's avatar
    walking committed
    		<copy file="installer/lib/wrapper/win32/I2Psvc.exe" tofile="pkg-temp/i2psvc.ex_" />
    			<!--  copy the unpack/start batchfiles -->
    		<copy todir="pkg-temp">
    
    			<fileset dir="installer/resources/portable/win32/" />
    		</copy>
    	</target>
    
    walking's avatar
    walking committed
    <!-- *4* command for windows package -->
    	<target name = "pkg-portable-win32"	depends="preppkg-portable-win32, pack200" >
    		<!-- i need the portable\ folder in .zip so basedir is set to . -->
    		<move file="pkg-temp" tofile="portable"/>
    		<zip destfile="portable-win32.zip" basedir="." level="9" includes="portable\**" />
    		<checksum file="portable-win32.zip" forceOverwrite="yes"/>
    		<move file="portable" tofile="pkg-temp"/>
    	</target>
    
    </project>