blob: 6cc00d36066da8cbe9a4c64f4c76c869e174cd56 [file] [log] [blame]
<!--
! Licensed to the Apache Software Foundation (ASF) under one
! or more contributor license agreements. See the NOTICE file
! distributed with this work for additional information
! regarding copyright ownership. The ASF licenses this file
! to you under the Apache License, Version 2.0 (the
! "License"); you may not use this file except in compliance
! with the License. You may obtain a copy of the License at
!
! http://www.apache.org/licenses/LICENSE-2.0
!
! Unless required by applicable law or agreed to in writing,
! software distributed under the License is distributed on an
! "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
! KIND, either express or implied. See the License for the
! specific language governing permissions and limitations
! under the License.
!-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>asterix-coverage</artifactId>
<packaging>pom</packaging>
<name>asterix-coverage</name>
<parent>
<groupId>org.apache.asterix</groupId>
<artifactId>apache-asterixdb</artifactId>
<version>0.8.9-SNAPSHOT</version>
</parent>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target if="coverage" unless="skipTests">
<echo message="Generating JaCoCo Reports" />
<property name="asterix.dir" location="${basedir}/.."/>
<!-- special case for jenkins -->
<condition property="hyracks.dir" value="${asterix.dir}/hyracks">
<available file="${asterix.dir}/hyracks/pom.xml"/>
</condition>
<pathconvert property="hyracks.dir">
<first>
<dirset dir="${asterix.dir}/..">
<include name="*hyracks"/>
</dirset>
</first>
</pathconvert>
<!-- gather all of the source dirs -->
<pathconvert property="source.dirs" pathsep=",">
<dirset dir="${asterix.dir}">
<include name="**/src/main/java"/>
<!-- special case for jenkins -->
<exclude name="hyracks/**"/>
</dirset>
</pathconvert>
<pathconvert property="hyracks.source.dirs" pathsep=",">
<dirset dir="${hyracks.dir}">
<include name="**/src/main/java"/>
</dirset>
</pathconvert>
<echo message="asterix dir: ${asterix.dir}/"/>
<echo message="hyracks dir: ${hyracks.dir}"/>
<echo message="asterix source dirs: ${source.dirs}/"/>
<echo message="hyracks source dirs: ${hyracks.source.dirs}/"/>
<taskdef name="report" classname="org.jacoco.ant.ReportTask">
<classpath path="${basedir}/target/jacoco-jars/org.jacoco.ant.jar" />
</taskdef>
<mkdir dir="${basedir}/target/coverage-report" />
<report>
<executiondata>
<fileset dir="${asterix.dir}">
<include name="**/jacoco.exec" />
</fileset>
</executiondata>
<structure name="AsterixDB Coverage Project">
<group name="AsterixDB">
<classfiles>
<fileset dir="${asterix.dir}">
<include name="**/target/classes/**/*.class"/>
<!-- special case for jenkins -->
<exclude name="hyracks/**"/>
</fileset>
</classfiles>
<sourcefiles encoding="UTF-8">
<multirootfileset basedirs="${source.dirs}" type="file">
<include name="**/*.java"/>
</multirootfileset>
</sourcefiles>
</group>
<group name="Hyracks">
<classfiles>
<fileset dir="${hyracks.dir}">
<include name="**/target/classes/**/*.class"/>
<exclude name="hyracks/hyracks-hdfs/hyracks-hdfs-1.x/**"/>
</fileset>
</classfiles>
<sourcefiles encoding="UTF-8">
<multirootfileset basedirs="${hyracks.source.dirs}" type="file">
<include name="**/*.java"/>
</multirootfileset>
</sourcefiles>
</group>
</structure>
<html destdir="${basedir}/target/coverage-report/html" />
<xml destfile="${basedir}/target/coverage-report/coverage-report.xml" />
<csv destfile="${basedir}/target/coverage-report/coverage-report.csv" />
</report>
</target>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>org.jacoco.ant</artifactId>
<version>${jacoco.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>