view clover-ant.xml @ 361:7b6d30651db7 tip

Cygwin has an ENV that container 'CI'. Causing build issues. Just check for 'github' to determine if it is a local build
author davis@ssdt-ohio.org
date Thu, 16 Nov 2023 15:52:40 -0500
parents 639bec4999f2
children
line wrap: on
line source
<?xml version="1.0" encoding="UTF-8"?>
<project name="clover-project-tasks" default="" basedir="."
         xmlns:ivy="antlib:fr.jayasoft.ivy.ant"
         xmlns:ssdt="http://www.ssdt-ohio.org/ant/common">

    <description>Clover Ant tasks</description>
    

    <target name="-check.clover" depends="init">
        <property           name="clover.jar.file" value="${user.home.ant.lib}/clover.jar"/>
        <property           name="ssdt.clover.jar.src"
                            value="http://ivy.ssdt.nwoca.org/repository/clover/clover.jar"/>
        <property           name="clover.dest" value="${build.dir}/clover"/>
        <ssdt:fetch         dest="${clover.jar.file}"
                            src="${ssdt.clover.jar.src}"/>
        <property           name="clover.license"
                            value="${user.home.ant.lib}/clover.license"/>
        <condition property="clover.installed">
            <and>
                <available classname="com.cenqua.clover.CloverInstr" />
                <available file="${clover.license}"/>
            </and>
        </condition>
        <if>
            <isset property="clover.installed"/>
            <then><taskdef resource="cloverlib.xml"/></then>
        </if>
    </target>

    <target name="with.coverage" depends="-check.clover" if="clover.installed">
        
        <property name="coverage.run.with.clover" value="true"/>
        <clover-env/>
        <clover-clean/>
        <clover-setup>
            <fileset dir="${src.dir}"/>
        </clover-setup>
        <mkdir dir="${build.dir}/.clover"/>
        <mkdir dir="${build.dir}/clover"/>
    </target>

    <target name="coverage.xml" depends="-check.clover"
        description="Generates an XML report to ${clover.dest}."
        if="coverage.run.with.clover">
        <clover-report>
            <current outfile="${clover.dest}/clover.xml" title="${ivy.project.module}" span="${clover.span}">
                <format type="xml"/>
                <testresults dir="build/test/results" includes="TEST-*.xml"/>
             <sourcepath>
                <pathelement path="${src.dir}"/>
              </sourcepath>
            </current>
        </clover-report>
    </target>

    <target name="coverage.html" depends="-check.clover"
            description="Generates an HTML report to ${clover.dest}."
            if="coverage.run.with.clover">
        <clover-report>
            <current outfile="${clover.dest}" title="${ivy.project.module}" span="${clover.span}">
                <format type="html"/>
                <testresults dir="build/test/results" includes="TEST-*.xml"/>
             <sourcepath>
                <pathelement path="${src.dir}"/>
              </sourcepath>
            </current>
        </clover-report>
    </target>

</project>