Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
134 lines (113 sloc) 5.05 KB
<?xml version="1.0"?>
<!-- the project element's name attribute will be used in the name of the module's jar file -->
<project name="dosis-til-text" basedir="." xmlns:jacoco="antlib:org.jacoco.ant">
<property name="sourceversion" value="1.8"/>
<property name="targetversion" value="1.8"/>
<property file="build.properties" />
<property file="revision.properties" />
<property name="trifork-common" value="${basedir}/../trifork-common"/>
<import file="${trifork-common}/etc/build-common.xml"/>
<property environment="env"/>
<property name="test.instrument" value="true"/>
<taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
<classpath path="${trifork-common}/lib/shared-lib/org.jacoco/jacocoant.jar"/>
</taskdef>
<path id="sourcepath">
<pathelement location="src"/>
</path>
<target name="compile-test" depends="compile,init-test, resolve-test">
<echo message="test.dir=${test.dir}"/>
<javac classpathref="compile-test-classpath" destdir="target/test" debug="true" encoding="${encoding}">
<src path="${test.dir};src-noproducion" />
</javac>
<copy todir="target/test" encoding="${encoding}">
<fileset dir="${test.dir}">
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="releasedosisstructure" depends="compile" description="dosisstructure jar">
<tstamp/>
<mkdir dir="target/dosisstruct"/>
<copy todir="target/dosisstruct">
<fileset dir="${build.dir}"/>
</copy>
<jar destfile="target/dosisstructuretext.jar" basedir="target/dosisstruct">
<manifest>
<attribute name="Built-By" value="${DSTAMP} ${TSTAMP}"/>
<attribute name="Implementation-Vendor" value="Trifork"/>
<attribute name="Implementation-Title" value="dosisstructuretext"/>
</manifest>
</jar>
<mkdir dir="target/doc"/>
<javadoc
sourcepath = "src"
packagenames="dk.medicinkortet.dosisstructuretext.*"
destdir="target/doc"
/>
</target>
<target name="publish-internal" depends="init, resolve-build, local-revision,jar, war, publish-internal-do"/>
<target name="publish-trifork-common" depends="publish-local">
<copy todir="/${trifork-common}/lib/shared-lib/trifork/${ant.project.name}/${revision}">
<fileset dir="target" includes="ivy.xml, dosis-til-text.jar"/>
</copy>
</target>
<target name="jacoco-report" depends="">
<jacoco:report>
<executiondata>
<file file="target/jacoco.exec"/>
</executiondata>
<structure name="Example Project">
<classfiles>
<fileset dir="target/classes">
<include name="**/medicinkortet/**/*.class" />
<exclude name="**/notproducion/**/*.class" />
</fileset>
</classfiles>
<sourcefiles encoding="UTF-8">
<fileset dir="src"/>
</sourcefiles>
</structure>
<html destdir="target/report"/>
</jacoco:report>
</target>
<target name="test-do">
<condition property="cond.jmx.port" value="${jmx.port}" else="8005">
<isset property="jmx.port"/>
</condition>
<condition property="cond.jmx.remote" value="true" else="false">
<isset property="jmx.port"/>
</condition>
<condition property="cond.jmx.auth" value="${jmx.auth}" else="false">
<isset property="jmx.auth"/>
</condition>
<jacoco:coverage destfile="target/jacoco.exec">
<junit forkmode="once" fork="true" failureproperty="test.failed" maxmemory="${testMaxMemory}" timeout="${unittest.timeout.millis}"
showoutput="true" >
<sysproperty key="test.with.memorydb" value="true" />
<classpath refid="testclasspath" />
<jvmarg value="-Duser.timezone=Europe/Copenhagen"/>
<jvmarg value="-Dcom.sun.management.jmxremote=${cond.jmx.remote}"/>
<jvmarg value="-Dcom.sun.management.jmxremote.port=${cond.jmx.port}"/>
<jvmarg value="-Dcom.sun.management.jmxremote.ssl=false"/>
<jvmarg value="-Dcom.sun.management.jmxremote.authenticate=${cond.jmx.auth}"/>
<jvmarg value="-Djava.awt.headless=true"/>
<formatter type="plain"/>
<formatter type="xml"/>
<batchtest fork="yes" todir="${artifactsDir}/test">
<fileset dir="${test.dir}">
<include name="${test.includePattern}"/>
</fileset>
</batchtest>
</junit>
</jacoco:coverage>
<mkdir dir="${junitHtmlReportDir}"/>
<junitreport todir="${junitHtmlReportDir}">
<fileset dir="${artifactsDir}/test">
<include name="**/TEST-*.xml"/>
</fileset>
<report format="frames" todir="${junitHtmlReportDir}" />
</junitreport>
<fail if="test.failed" message="There were test failures" />
</target>
</project>