Files
i2p.android.base/core/java/build.xml
2011-02-17 13:50:43 +00:00

140 lines
5.9 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="all" name="i2p_sdk">
<target name="all" depends="clean, build" />
<target name="build" depends="builddep, jar" />
<target name="builddep">
<!-- noop, since the core doesnt depend on anything -->
</target>
<condition property="depend.available">
<typefound name="depend" />
</condition>
<target name="depend" if="depend.available">
<depend
cache="../../build"
srcdir="./src"
destdir="./build/obj" >
</depend>
</target>
<!-- only used if not set by a higher build.xml -->
<property name="javac.compilerargs" value="" />
<property name="javac.classpath" value="" />
<target name="compile" depends="depend">
<mkdir dir="./build" />
<mkdir dir="./build/obj" />
<javac srcdir="./src" debug="true" source="1.5" target="1.5" deprecation="on"
includeAntRuntime="false"
destdir="./build/obj" classpath="${javac.classpath}" >
<compilerarg line="${javac.compilerargs}" />
</javac>
</target>
<target name="compileTest">
<mkdir dir="./build" />
<mkdir dir="./build/obj" />
<!-- junit classes are in ant runtime -->
<javac srcdir="./src:./test" debug="true" source="1.5" target="1.5" deprecation="on"
includeAntRuntime="true"
destdir="./build/obj" >
<compilerarg line="${javac.compilerargs}" />
</javac>
</target>
<target name="jar" depends="compile, jarUpToDate" unless="jar.uptodate" >
<exec executable="mtn" outputproperty="workspace.changes" errorproperty="mtn.error2" failifexecutionfails="false" >
<arg value="list" />
<arg value="changed" />
<arg value="." />
</exec>
<!-- \n in an attribute value generates an invalid manifest -->
<exec executable="tr" inputstring="${workspace.changes}" outputproperty="workspace.changes.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
<arg value="-s" />
<arg value="[:space:]" />
<arg value="," />
</exec>
<jar destfile="./build/i2p.jar" basedir="./build/obj" includes="**/*.class" >
<manifest>
<attribute name="Build-Date" value="${build.timestamp}" />
<attribute name="Base-Revision" value="${workspace.version}" />
<attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
</manifest>
</jar>
</target>
<target name="jarUpToDate" >
<uptodate property="jar.uptodate" targetfile="build/i2p.jar" >
<srcfiles dir= "build/obj" includes="**/*.class" />
</uptodate>
</target>
<target name="jarTest" depends="compileTest">
<jar destfile="./build/i2ptest.jar" basedir="./build/obj" includes="**/*.class" />
</target>
<target name="javadoc">
<mkdir dir="./build" />
<mkdir dir="./build/javadoc" />
<javadoc sourcepath="./src:./test" destdir="./build/javadoc" packagenames="*" use="true" splitindex="true" windowtitle="I2P SDK" />
</target>
<target name="prepareTest" depends="compileTest" if="with.cobertura">
<taskdef classpath="${with.cobertura}" resource="tasks.properties" onerror="report" />
<mkdir dir="./build/obj_test" />
<cobertura-instrument todir="./build/obj_test">
<fileset dir="./build/obj">
<include name="**/*.class"/>
<exclude name="**/*Test.class" />
</fileset>
</cobertura-instrument>
</target>
<target name="test" depends="clean, compileTest, prepareTest">
<delete>
<fileset dir="../../reports/core/junit">
<include name="TEST-*.xml"/>
</fileset>
</delete>
<mkdir dir="../../reports/" />
<mkdir dir="../../reports/core/" />
<mkdir dir="../../reports/core/junit/" />
<junit printsummary="on" fork="yes" maxmemory="384m">
<sysproperty key="net.sourceforge.cobertura.datafile" file="./cobertura.ser" />
<classpath>
<pathelement path="${classpath}" />
<pathelement location="./build/obj_test" />
<pathelement location="./build/obj" />
<pathelement location="../../installer/lib/jbigi/jbigi.jar" />
<pathelement location="${with.cobertura}" />
</classpath>
<batchtest todir="../../reports/core/junit/">
<fileset dir="./test/">
<include name="**/*Test.java" />
<exclude name="**/ElGamalAESEngineTest.java" />
<exclude name="**/StructureTest.java" />
</fileset>
</batchtest>
<formatter type="xml"/>
</junit>
</target>
<target name="cobertura" depends="test" if="with.cobertura">
<mkdir dir="../../reports/core/cobertura" />
<cobertura-report format="xml" srcdir="./src" destdir="../../reports/core/cobertura" />
<delete file="./cobertura.ser" />
</target>
<target name="junit.report">
<junitreport todir="../../reports/core/junit">
<fileset dir="../../reports/core/junit">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="../../reports/core/html/junit"/>
</junitreport>
</target>
<target name="test.report" depends="junit.report"/>
<target name="fulltest" depends="test, junit.report" />
<target name="clean">
<delete dir="./build" />
</target>
<target name="cleandep" depends="clean">
<!-- noop, since the core doesn't depend on anything -->
</target>
<target name="distclean" depends="clean">
<!-- noop, since the core doesn't depend on anything -->
</target>
</project>