2004-04-08 04:48:39 +00:00
|
|
|
<?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>
|
2008-11-14 14:48:08 +00:00
|
|
|
<condition property="depend.available">
|
|
|
|
<typefound name="depend" />
|
|
|
|
</condition>
|
|
|
|
<target name="depend" if="depend.available">
|
2008-11-12 17:08:09 +00:00
|
|
|
<depend
|
|
|
|
cache="../../build"
|
|
|
|
srcdir="./src"
|
|
|
|
destdir="./build/obj" >
|
|
|
|
</depend>
|
|
|
|
</target>
|
2009-04-26 15:54:51 +00:00
|
|
|
<!-- only used if not set by a higher build.xml -->
|
|
|
|
<property name="javac.compilerargs" value="" />
|
2010-10-24 16:49:20 +00:00
|
|
|
<property name="javac.classpath" value="" />
|
2008-11-12 17:08:09 +00:00
|
|
|
<target name="compile" depends="depend">
|
2004-04-08 04:48:39 +00:00
|
|
|
<mkdir dir="./build" />
|
|
|
|
<mkdir dir="./build/obj" />
|
2011-02-17 12:47:35 +00:00
|
|
|
<javac srcdir="./src" debug="true" source="1.5" target="1.5" deprecation="on"
|
|
|
|
includeAntRuntime="false"
|
|
|
|
destdir="./build/obj" classpath="${javac.classpath}" >
|
2009-04-26 15:54:51 +00:00
|
|
|
<compilerarg line="${javac.compilerargs}" />
|
|
|
|
</javac>
|
2005-07-04 20:44:17 +00:00
|
|
|
</target>
|
2011-02-17 12:47:35 +00:00
|
|
|
|
2011-06-08 20:15:53 +00:00
|
|
|
<target name="listChangedFiles" if="mtn.available" >
|
2011-02-17 12:47:35 +00:00
|
|
|
<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>
|
2011-06-08 20:15:53 +00:00
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="jar" depends="compile, jarUpToDate, listChangedFiles" unless="jar.uptodate" >
|
|
|
|
<!-- set if unset -->
|
|
|
|
<property name="workspace.changes.tr" value="" />
|
2011-02-17 12:47:35 +00:00
|
|
|
<jar destfile="./build/i2p.jar" basedir="./build/obj" includes="**/*.class" >
|
|
|
|
<manifest>
|
2012-01-15 16:36:17 +00:00
|
|
|
<attribute name="Implementation-Version" value="${full.version}" />
|
2011-02-17 12:47:35 +00:00
|
|
|
<attribute name="Build-Date" value="${build.timestamp}" />
|
|
|
|
<attribute name="Base-Revision" value="${workspace.version}" />
|
|
|
|
<attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
|
|
|
|
</manifest>
|
|
|
|
</jar>
|
2004-04-08 04:48:39 +00:00
|
|
|
</target>
|
2011-02-17 12:47:35 +00:00
|
|
|
|
|
|
|
<target name="jarUpToDate" >
|
|
|
|
<uptodate property="jar.uptodate" targetfile="build/i2p.jar" >
|
|
|
|
<srcfiles dir= "build/obj" includes="**/*.class" />
|
|
|
|
</uptodate>
|
|
|
|
</target>
|
|
|
|
|
2004-04-08 04:48:39 +00:00
|
|
|
<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>
|
2012-02-16 00:08:27 +00:00
|
|
|
|
|
|
|
<!-- 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>
|
2011-02-03 06:57:35 +00:00
|
|
|
<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"/>
|
2011-02-14 18:08:45 +00:00
|
|
|
<exclude name="**/*Test.class" />
|
2011-02-03 06:57:35 +00:00
|
|
|
</fileset>
|
|
|
|
</cobertura-instrument>
|
|
|
|
</target>
|
|
|
|
<target name="test" depends="clean, compileTest, prepareTest">
|
2012-02-16 02:58:25 +00:00
|
|
|
<mkdir dir="../../reports/core/junit/" />
|
2011-02-07 18:14:10 +00:00
|
|
|
<delete>
|
|
|
|
<fileset dir="../../reports/core/junit">
|
|
|
|
<include name="TEST-*.xml"/>
|
|
|
|
</fileset>
|
|
|
|
</delete>
|
|
|
|
<junit printsummary="on" fork="yes" maxmemory="384m">
|
2011-02-03 06:57:35 +00:00
|
|
|
<sysproperty key="net.sourceforge.cobertura.datafile" file="./cobertura.ser" />
|
2005-06-23 02:11:04 +00:00
|
|
|
<classpath>
|
|
|
|
<pathelement path="${classpath}" />
|
2011-02-03 06:57:35 +00:00
|
|
|
<pathelement location="./build/obj_test" />
|
2005-07-04 20:44:17 +00:00
|
|
|
<pathelement location="./build/obj" />
|
2011-06-02 20:29:15 +00:00
|
|
|
<pathelement location="../../build/jbigi.jar" />
|
2011-02-03 06:57:35 +00:00
|
|
|
<pathelement location="${with.cobertura}" />
|
2005-06-23 02:11:04 +00:00
|
|
|
</classpath>
|
2011-02-07 18:14:10 +00:00
|
|
|
<batchtest todir="../../reports/core/junit/">
|
2005-06-23 02:11:04 +00:00
|
|
|
<fileset dir="./test/">
|
|
|
|
<include name="**/*Test.java" />
|
|
|
|
<exclude name="**/ElGamalAESEngineTest.java" />
|
|
|
|
<exclude name="**/StructureTest.java" />
|
|
|
|
</fileset>
|
|
|
|
</batchtest>
|
|
|
|
<formatter type="xml"/>
|
|
|
|
</junit>
|
|
|
|
</target>
|
2011-02-03 06:57:35 +00:00
|
|
|
<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>
|
2005-06-23 02:11:04 +00:00
|
|
|
<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>
|
2011-02-03 06:57:35 +00:00
|
|
|
<target name="test.report" depends="junit.report"/>
|
2005-09-13 09:06:07 +00:00
|
|
|
<target name="fulltest" depends="test, junit.report" />
|
2012-02-16 00:08:27 +00:00
|
|
|
<!-- end unit tests -->
|
|
|
|
|
2004-04-08 04:48:39 +00:00
|
|
|
<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>
|