Files
i2p.i2p/core/java/build.xml
str4d d1a03f500f Moved mkdir above delete in core build.xml and removed mkdir from base build.xml
mkdir does nothing if the directory exists, whereas delete fails by default
if the directory doesn't exist. Also, mkdir creates parent dirs as needed.
2012-02-16 02:58:25 +00:00

147 lines
6.1 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="listChangedFiles" if="mtn.available" >
<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>
</target>
<target name="jar" depends="compile, jarUpToDate, listChangedFiles" unless="jar.uptodate" >
<!-- set if unset -->
<property name="workspace.changes.tr" value="" />
<jar destfile="./build/i2p.jar" basedir="./build/obj" includes="**/*.class" >
<manifest>
<attribute name="Implementation-Version" value="${full.version}" />
<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="javadoc">
<mkdir dir="./build" />
<mkdir dir="./build/javadoc" />
<javadoc sourcepath="./src:./test" destdir="./build/javadoc" packagenames="*" use="true" splitindex="true" windowtitle="I2P SDK" />
</target>
<!-- unit tests -->
<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="jarTest" depends="compileTest">
<jar destfile="./build/i2ptest.jar" basedir="./build/obj" includes="**/*.class" />
</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">
<mkdir dir="../../reports/core/junit/" />
<delete>
<fileset dir="../../reports/core/junit">
<include name="TEST-*.xml"/>
</fileset>
</delete>
<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="../../build/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" />
<!-- end unit tests -->
<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>