[DEV] basic version of ant

This commit is contained in:
Edouard DUPIN 2020-09-06 21:48:32 +02:00
parent 58dfb8f59f
commit 487cba9ccb

View File

@ -1,22 +1,17 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project basedir="." default="build" name="scenarium-logger" xmlns:jacoco="antlib:org.jacoco.ant">
<property environment="env"/>
<property name="colos-network.location" value="../spearhead/colos"/>
<property name="plugin-manager.location" value="../plugin-manager"/>
<property name="scenarium-base.location" value="../scenarium-base"/>
<property name="scenarium-core.location" value="../scenarium-core/core"/>
<property name="scenarium-river.location" value="../scenarium-river"/>
<property name="scenarium-run.location" value="../scenarium-run"/>
<property name="junit.output.dir" value="junit"/>
<property name="debuglevel" value="source,lines,vars"/>
<!-- configure dependency of JAVA -->
<property name="target" value="14"/>
<property name="source" value="14"/>
<property name="result.dir" location="./target" />
<property name="result.dir" location="./out/ant/" />
<property name="result.juint.dir" location="${result.dir}/junit" />
<property name="result.classes.dir" location="${result.dir}/classes" />
<property name="result.report.dir" location="${result.dir}/site/jacoco" />
<property name="result.exec.file" location="${result.dir}/jacoco.exec" />
<!-- Step 1: Import JaCoCo Ant tasks -->
<!-- Import JaCoCo Ant tasks -->
<taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
<classpath path="/home/heero/jacoco/jacocoant.jar" />
</taskdef>
@ -41,6 +36,9 @@ wget https://repo1.maven.org/maven2/org/junit/platform/junit-platform-suite-api/
wget https://repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar
-->
<path id="junit.classpath">
<!-- keep all lib in this directiry-->
<fileset dir="${basedir}/extern/lib/"/>
<!--
<pathelement location="${basedir}/extern/lib/junit-jupiter-api-5.6.2.jar"/>
<pathelement location="${basedir}/extern/lib/junit-jupiter-engine-5.6.2.jar"/>
<pathelement location="${basedir}/extern/lib/junit-jupiter-migrationsupport-5.6.2.jar"/>
@ -55,6 +53,7 @@ wget https://repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core
<pathelement location="${basedir}/extern/lib/apiguardian-api-1.1.0.jar"/>
<pathelement location="${basedir}/extern/lib/junit-4.13.jar"/>
<pathelement location="${basedir}/extern/lib/hamcrest-core-1.3.jar"/>
-->
</path>
<path id="scenarium-logger.classpath">
<pathelement location="target/classes"/>
@ -101,63 +100,16 @@ wget https://repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core
<classpath refid="scenarium-logger.classpath"/>
</javac>
</target>
<target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects">
<ant antfile="build_old.xml" dir="${colos-network.location}" inheritAll="false" target="clean"/>
<ant antfile="build_old.xml" dir="${colos-network.location}" inheritAll="false" target="build">
<propertyset>
<propertyref name="build.compiler"/>
</propertyset>
</ant>
<ant antfile="build_old.xml" dir="${plugin-manager.location}" inheritAll="false" target="clean"/>
<ant antfile="build_old.xml" dir="${plugin-manager.location}" inheritAll="false" target="build">
<propertyset>
<propertyref name="build.compiler"/>
</propertyset>
</ant>
<ant antfile="build_old.xml" dir="${scenarium-base.location}" inheritAll="false" target="clean"/>
<ant antfile="build_old.xml" dir="${scenarium-base.location}" inheritAll="false" target="build">
<propertyset>
<propertyref name="build.compiler"/>
</propertyset>
</ant>
<ant antfile="build_old.xml" dir="${scenarium-core.location}" inheritAll="false" target="clean"/>
<ant antfile="build_old.xml" dir="${scenarium-core.location}" inheritAll="false" target="build">
<propertyset>
<propertyref name="build.compiler"/>
</propertyset>
</ant>
<ant antfile="build_old.xml" dir="${scenarium-river.location}" inheritAll="false" target="clean"/>
<ant antfile="build_old.xml" dir="${scenarium-river.location}" inheritAll="false" target="build">
<propertyset>
<propertyref name="build.compiler"/>
</propertyset>
</ant>
<ant antfile="build_old.xml" dir="${scenarium-run.location}" inheritAll="false" target="clean"/>
<ant antfile="build_old.xml" dir="${scenarium-run.location}" inheritAll="false" target="build">
<propertyset>
<propertyref name="build.compiler"/>
</propertyset>
</ant>
</target>
<target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
<copy todir="${ant.library.dir}">
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</copy>
<unzip dest="${ant.library.dir}">
<patternset includes="jdtCompilerAdapter.jar"/>
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</unzip>
</target>
<target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
<antcall target="build"/>
</target>
<target name="TestBasicLog">
<mkdir dir="${junit.output.dir}"/>
<mkdir dir="${result.juint.dir}"/>
<jacoco:coverage destfile="${result.exec.file}">
<junit fork="yes" printsummary="withOutAndErr">
<formatter type="xml"/>
<test name="test.scenarium.logger.TestBasicLog" todir="${junit.output.dir}"/>
<test name="test.scenarium.logger.TestBasicLog" todir="${result.juint.dir}"/>
<jvmarg line="-ea"/>
<classpath refid="run.TestBasicLog.classpath"/>
</junit>
@ -189,11 +141,21 @@ wget https://repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core
<csv destfile="${result.report.dir}/report.csv" />
<xml destfile="${result.report.dir}/report.xml" />
</jacoco:report>
<junitreport todir="${junit.output.dir}">
<fileset dir="${junit.output.dir}">
<junitreport todir="${result.juint.dir}">
<fileset dir="${result.juint.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${junit.output.dir}"/>
<report format="frames" todir="${result.juint.dir}"/>
</junitreport>
</target>
<!-- generate by eclipse do not understand why -->
<target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
<copy todir="${ant.library.dir}">
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</copy>
<unzip dest="${ant.library.dir}">
<patternset includes="jdtCompilerAdapter.jar"/>
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</unzip>
</target>
</project>