2004-10-28 02:11:52 +00:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<project basedir="." default="all" name="streaming">
|
|
|
|
<target name="all" depends="clean, build" />
|
|
|
|
<target name="build" depends="builddep, jar" />
|
|
|
|
<target name="builddep">
|
2010-11-28 03:56:56 +00:00
|
|
|
<!-- run from top level build.xml to get dependencies built -->
|
2004-10-28 02:11:52 +00:00
|
|
|
</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"
|
2014-11-12 17:42:50 +00:00
|
|
|
srcdir="./src:./test/junit"
|
2008-11-12 17:08:09 +00:00
|
|
|
destdir="./build/obj" >
|
|
|
|
<!-- Depend on classes instead of jars where available -->
|
|
|
|
<classpath>
|
|
|
|
<pathelement location="../../../core/java/build/obj" />
|
|
|
|
<pathelement location="../../ministreaming/java/build/obj" />
|
|
|
|
</classpath>
|
|
|
|
</depend>
|
|
|
|
</target>
|
2014-06-27 13:57:43 +00:00
|
|
|
|
|
|
|
<!-- only used if not set by a higher build.xml -->
|
2009-04-26 15:54:51 +00:00
|
|
|
<property name="javac.compilerargs" value="" />
|
2014-06-27 13:57:43 +00:00
|
|
|
<property name="javac.version" value="1.6" />
|
|
|
|
|
2008-11-12 17:08:09 +00:00
|
|
|
<target name="compile" depends="depend">
|
2004-10-28 02:11:52 +00:00
|
|
|
<mkdir dir="./build" />
|
|
|
|
<mkdir dir="./build/obj" />
|
2014-11-12 17:42:50 +00:00
|
|
|
<javac
|
|
|
|
srcdir="./src"
|
|
|
|
debug="true" deprecation="on" source="${javac.version}" target="${javac.version}"
|
2011-02-17 12:47:35 +00:00
|
|
|
includeAntRuntime="false"
|
2014-11-12 17:42:50 +00:00
|
|
|
destdir="./build/obj"
|
2009-04-26 15:54:51 +00:00
|
|
|
classpath="../../../core/java/build/i2p.jar:../../ministreaming/java/build/mstreaming.jar" >
|
|
|
|
<compilerarg line="${javac.compilerargs}" />
|
|
|
|
</javac>
|
2008-12-08 15:03:45 +00:00
|
|
|
</target>
|
2013-06-28 18:48:39 +00:00
|
|
|
<target name="builddeptest">
|
2014-11-12 17:42:50 +00:00
|
|
|
<ant dir="../../../core/java" target="jar" />
|
2015-07-25 11:42:53 +00:00
|
|
|
<ant dir="../../../apps/ministreaming/java/" target="jar" />
|
2013-06-28 18:48:39 +00:00
|
|
|
</target>
|
|
|
|
<target name="junit.compileTest" depends="builddeptest, compile">
|
2013-06-28 20:50:38 +00:00
|
|
|
|
2014-11-12 17:42:50 +00:00
|
|
|
<echo message="[DEBUG] ant home is ${ant.home}" />
|
|
|
|
<echo message="[DEBUG] junit home before override is ${junit.home}" />
|
|
|
|
<echo message="[DEBUG] hamcrest home before override is ${hamcrest.home}" />
|
2015-07-27 01:52:56 +00:00
|
|
|
<echo message="[DEBUG] mockito home before override is ${mockito.home}" />
|
2014-11-12 17:42:50 +00:00
|
|
|
|
|
|
|
<property name="junit.home" value="${ant.home}/lib" />
|
|
|
|
<property name="hamcrest.home" value="${ant.home}/lib" />
|
2015-07-27 01:52:56 +00:00
|
|
|
<property name="mockito.home" value="${ant.home}/lib" />
|
2014-11-12 17:42:50 +00:00
|
|
|
|
|
|
|
<echo message="[DEBUG] junit home after override is ${junit.home}" />
|
|
|
|
<echo message="[DEBUG] hamcrest home after override is ${hamcrest.home}" />
|
2015-07-27 01:52:56 +00:00
|
|
|
<echo message="[DEBUG] mockito home after override is ${mockito.home}" />
|
2014-11-12 17:42:50 +00:00
|
|
|
|
|
|
|
<javac
|
|
|
|
srcdir="./test/junit"
|
|
|
|
debug="true" deprecation="on" source="${javac.version}" target="${javac.version}"
|
2011-02-17 12:47:35 +00:00
|
|
|
includeAntRuntime="false"
|
2013-06-28 18:48:39 +00:00
|
|
|
destdir="./build/obj" >
|
2014-11-12 17:42:50 +00:00
|
|
|
<classpath>
|
|
|
|
<pathelement location="../../../core/java/build/i2p.jar" />
|
|
|
|
<pathelement location="../../ministreaming/java/build/mstreaming.jar" />
|
|
|
|
<pathelement location="${junit.home}/junit4.jar" />
|
|
|
|
<pathelement location="${hamcrest.home}/hamcrest.jar" />
|
|
|
|
<pathelement location="${hamcrest.home}/hamcrest-all.jar" />
|
2015-07-27 01:52:56 +00:00
|
|
|
<pathelement location="${mockito.home}/byte-buddy.jar" />
|
|
|
|
<pathelement location="${mockito.home}/objenesis.jar" />
|
|
|
|
<pathelement location="${mockito.home}/mockito-core.jar" />
|
2014-11-12 17:42:50 +00:00
|
|
|
</classpath>
|
2009-04-26 15:54:51 +00:00
|
|
|
<compilerarg line="${javac.compilerargs}" />
|
|
|
|
</javac>
|
2004-10-28 02:11:52 +00:00
|
|
|
</target>
|
2011-02-17 12:47:35 +00:00
|
|
|
|
2013-06-28 18:48:39 +00:00
|
|
|
<!-- preparation of code coverage tool of choice -->
|
|
|
|
<target name="prepareClover" depends="compile" if="with.clover">
|
|
|
|
<taskdef resource="clovertasks"/>
|
|
|
|
<mkdir dir="../../../reports/streaming/clover" />
|
|
|
|
<clover-setup initString="../../../reports/streaming/clover/coverage.db"/>
|
|
|
|
</target>
|
|
|
|
<target name="prepareCobertura" depends="compile" if="with.cobertura">
|
|
|
|
<taskdef classpath="${with.cobertura}" resource="tasks.properties" onerror="report" />
|
|
|
|
<mkdir dir="./build/obj_cobertura" />
|
|
|
|
<delete file="./cobertura.ser" />
|
|
|
|
<cobertura-instrument todir="./build/obj_cobertura">
|
|
|
|
<fileset dir="./build/obj">
|
|
|
|
<include name="**/*.class"/>
|
|
|
|
<!-- exclude Test classes -->
|
|
|
|
<exclude name="**/*Test.class" />
|
2015-07-27 08:18:46 +00:00
|
|
|
<exclude name="**/*TestBase.class" />
|
2015-07-27 00:58:42 +00:00
|
|
|
<exclude name="**/*IT.class" />
|
2015-07-27 06:31:31 +00:00
|
|
|
<exclude name="**/*IT$*.class" />
|
2015-07-27 00:58:42 +00:00
|
|
|
<exclude name="**/StreamingITBase.class" />
|
2015-07-27 06:31:31 +00:00
|
|
|
<exclude name="**/StreamingITBase$*.class" />
|
2013-06-28 18:48:39 +00:00
|
|
|
<!-- exclude anything not in net.i2p.* -->
|
|
|
|
<exclude name="org/cybergarage/**/*.class" />
|
|
|
|
<exclude name="org/freenetproject/**/*.class" />
|
|
|
|
<exclude name="org/xlattice/**/*.class" />
|
|
|
|
</fileset>
|
|
|
|
</cobertura-instrument>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="prepareTest" depends="prepareClover, prepareCobertura" />
|
|
|
|
|
|
|
|
<target name="junit.test" depends="clean, junit.compileTest, prepareTest">
|
|
|
|
<mkdir dir="../../../reports/streaming/junit/" />
|
|
|
|
<delete>
|
|
|
|
<fileset dir="../../../reports/streaming/junit">
|
|
|
|
<include name="TEST-*.xml"/>
|
|
|
|
</fileset>
|
|
|
|
</delete>
|
|
|
|
|
2014-11-12 17:42:50 +00:00
|
|
|
<property name="junit.home" value="${ant.home}/lib" />
|
|
|
|
<property name="hamcrest.home" value="${ant.home}/lib" />
|
2015-07-27 01:52:56 +00:00
|
|
|
<property name="mockito.home" value="${ant.home}/lib" />
|
2013-06-28 18:48:39 +00:00
|
|
|
|
|
|
|
<junit printsummary="withOutAndErr" fork="yes" showoutput="yes" >
|
|
|
|
<sysproperty key="net.sourceforge.cobertura.datafile" file="./cobertura.ser" />
|
|
|
|
<classpath>
|
|
|
|
<pathelement path="${javac.classpath}" />
|
|
|
|
<pathelement location="${hamcrest.home}/hamcrest-core.jar" />
|
|
|
|
<pathelement location="${hamcrest.home}/hamcrest-library.jar" />
|
|
|
|
<pathelement location="${hamcrest.home}/hamcrest-integration.jar" />
|
2014-11-12 17:42:50 +00:00
|
|
|
<pathelement location="${hamcrest.home}/hamcrest-all.jar" />
|
2015-07-27 01:52:56 +00:00
|
|
|
<pathelement location="${mockito.home}/byte-buddy.jar" />
|
|
|
|
<pathelement location="${mockito.home}/objenesis.jar" />
|
|
|
|
<pathelement location="${mockito.home}/mockito-core.jar" />
|
2013-06-28 18:48:39 +00:00
|
|
|
<pathelement location="${junit.home}/junit4.jar" />
|
|
|
|
<pathelement location="./build/obj_cobertura" />
|
|
|
|
<pathelement location="./build/obj" />
|
|
|
|
<pathelement location="../../../core/java/build/i2ptest.jar" />
|
2014-11-12 17:42:50 +00:00
|
|
|
<pathelement location="../../../core/java/build/i2p.jar" />
|
2013-06-28 18:48:39 +00:00
|
|
|
<pathelement location="../../ministreaming/java/build/mstreaming.jar" />
|
|
|
|
<pathelement location="../../build/jbigi.jar" />
|
|
|
|
<pathelement location="${with.clover}" />
|
|
|
|
<pathelement location="${with.cobertura}" />
|
|
|
|
</classpath>
|
|
|
|
<batchtest todir="../../../reports/streaming/junit/">
|
|
|
|
<fileset dir="./test/junit">
|
|
|
|
<include name="**/*Test.java" />
|
2015-07-27 00:58:42 +00:00
|
|
|
<include name="**/*IT.java" if="runIntegrationTests" />
|
2013-06-28 18:48:39 +00:00
|
|
|
</fileset>
|
|
|
|
</batchtest>
|
|
|
|
<formatter type="xml"/>
|
|
|
|
</junit>
|
|
|
|
<!-- set if unset -->
|
|
|
|
<property name="host.fakename" value="i2ptester" />
|
|
|
|
<!-- replace hostname that junit inserts into reports with fake one -->
|
|
|
|
<replaceregexp byline="true"
|
|
|
|
match="(hostname=)"[^"]+""
|
|
|
|
replace="\1"${host.fakename}"">
|
|
|
|
<fileset dir="../../../reports/streaming/junit/" />
|
|
|
|
</replaceregexp>
|
|
|
|
</target>
|
|
|
|
<target name="test" depends="junit.test"/>
|
|
|
|
<!-- test reports -->
|
|
|
|
<target name="junit.report">
|
|
|
|
<junitreport todir="../../../reports/streaming/junit">
|
|
|
|
<fileset dir="../../../reports/streaming/junit">
|
|
|
|
<include name="TEST-*.xml"/>
|
|
|
|
</fileset>
|
|
|
|
<report format="frames" todir="../../../reports/streaming/html/junit"/>
|
|
|
|
</junitreport>
|
|
|
|
</target>
|
|
|
|
<target name="clover.report" depends="test" if="with.clover">
|
|
|
|
<clover-report>
|
|
|
|
<current outfile="../../../reports/streaming/html/clover">
|
|
|
|
<format type="html"/>
|
|
|
|
</current>
|
|
|
|
</clover-report>
|
|
|
|
</target>
|
|
|
|
<target name="cobertura.report" depends="test" if="with.cobertura">
|
|
|
|
<mkdir dir="../../../reports/streaming/cobertura" />
|
|
|
|
<cobertura-report format="xml" srcdir="./src" destdir="../../../reports/streaming/cobertura" />
|
|
|
|
<mkdir dir="../../../reports/streaming/html/cobertura" />
|
|
|
|
<cobertura-report format="html" srcdir="./src" destdir="../../../reports/streaming/html/cobertura" />
|
|
|
|
<delete file="./cobertura.ser" />
|
|
|
|
</target>
|
|
|
|
<target name="test.report" depends="junit.report, clover.report, cobertura.report"/>
|
|
|
|
<!-- end test reports -->
|
|
|
|
<target name="fulltest" depends="cleandep, test, test.report" />
|
|
|
|
<!-- end unit tests -->
|
|
|
|
|
2011-06-08 20:15:53 +00:00
|
|
|
<target name="listChangedFiles" depends="jarUpToDate" if="shouldListChanges" >
|
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="builddep, 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/streaming.jar" basedir="./build/obj" includes="**/*.class" >
|
|
|
|
<manifest>
|
2016-06-15 18:34:44 +00:00
|
|
|
<attribute name="Specification-Title" value="I2P Streaming API" />
|
|
|
|
<attribute name="Specification-Version" value="${release.number}" />
|
|
|
|
<attribute name="Specification-Vendor" value="The I2P Project https://geti2p.net/" />
|
|
|
|
<attribute name="Implementation-Title" value="I2P Java Streaming API" />
|
2012-01-15 16:36:17 +00:00
|
|
|
<attribute name="Implementation-Version" value="${full.version}" />
|
2016-06-15 18:34:44 +00:00
|
|
|
<attribute name="Implementation-Vendor" value="The I2P Project https://geti2p.net/" />
|
2012-03-01 16:04:17 +00:00
|
|
|
<attribute name="Built-By" value="${build.built-by}" />
|
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-10-28 02:11:52 +00:00
|
|
|
</target>
|
2011-02-17 12:47:35 +00:00
|
|
|
|
|
|
|
<target name="jarUpToDate">
|
|
|
|
<uptodate property="jar.uptodate" targetfile="build/streaming.jar" >
|
|
|
|
<srcfiles dir= "." includes="build/obj/**/*.class" />
|
|
|
|
</uptodate>
|
2011-06-08 20:15:53 +00:00
|
|
|
<condition property="shouldListChanges" >
|
|
|
|
<and>
|
|
|
|
<not>
|
|
|
|
<isset property="jar.uptodate" />
|
|
|
|
</not>
|
|
|
|
<isset property="mtn.available" />
|
|
|
|
</and>
|
|
|
|
</condition>
|
2011-02-17 12:47:35 +00:00
|
|
|
</target>
|
|
|
|
|
2013-06-28 18:48:39 +00:00
|
|
|
<target name="jarTest" depends="jar, junit.compileTest">
|
2008-12-08 15:03:45 +00:00
|
|
|
<jar destfile="./build/streaming.jar" basedir="./build/obj" includes="**/*Test*.class" update="true" />
|
|
|
|
</target>
|
2004-10-28 02:11:52 +00:00
|
|
|
<target name="javadoc">
|
|
|
|
<mkdir dir="./build" />
|
|
|
|
<mkdir dir="./build/javadoc" />
|
2014-11-12 17:42:50 +00:00
|
|
|
<javadoc
|
|
|
|
sourcepath="./src:../../../core/java/src:../../ministreaming/java/src" destdir="./build/javadoc"
|
|
|
|
packagenames="*"
|
|
|
|
use="true"
|
|
|
|
splitindex="true"
|
2004-10-28 02:11:52 +00:00
|
|
|
windowtitle="Streaming" />
|
|
|
|
</target>
|
2016-06-13 06:02:48 +00:00
|
|
|
|
|
|
|
<!-- for Maven Central -->
|
|
|
|
<target name="javadocJar" depends="javadoc">
|
|
|
|
<jar jarfile="./build/streaming-${release.number}-javadoc.jar">
|
|
|
|
<fileset dir="./build/javadoc" />
|
|
|
|
</jar>
|
|
|
|
</target>
|
|
|
|
<target name="sourcesJar">
|
|
|
|
<jar jarfile="./build/streaming-${release.number}-sources.jar">
|
|
|
|
<fileset dir="./src" />
|
|
|
|
</jar>
|
|
|
|
</target>
|
|
|
|
|
2004-10-28 02:11:52 +00:00
|
|
|
<target name="clean">
|
|
|
|
<delete dir="./build" />
|
|
|
|
</target>
|
|
|
|
<target name="cleandep" depends="clean">
|
|
|
|
</target>
|
|
|
|
<target name="distclean" depends="clean">
|
|
|
|
</target>
|
|
|
|
</project>
|