| <!-- |
| ! 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.9.3-SNAPSHOT</version> |
| </parent> |
| |
| <profiles> |
| <profile> |
| <id>coverage</id> |
| <activation> |
| <property> |
| <name>coverage</name> |
| </property> |
| </activation> |
| <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}/../.." /> |
| |
| <!-- gather all of the source dirs --> |
| <pathconvert property="source.dirs" pathsep=","> |
| <dirset dir="${asterix.dir}"> |
| <include name="**/src/main/java" /> |
| </dirset> |
| </pathconvert> |
| |
| <echo message="asterix dir: ${asterix.dir}/" /> |
| <echo message="asterix source dirs: ${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" /> |
| <exclude name="**/hyracks-hdfs/hyracks-hdfs-1.x/**" /> |
| </fileset> |
| </classfiles> |
| <sourcefiles encoding="UTF-8"> |
| <multirootfileset basedirs="${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> |
| <plugin> |
| <groupId>org.jacoco</groupId> |
| <artifactId>jacoco-maven-plugin</artifactId> |
| <version>${jacoco.version}</version> |
| <executions> |
| <execution> |
| <goals> |
| <goal>merge</goal> |
| </goals> |
| <phase>test</phase> |
| <configuration> |
| <fileSets> |
| <fileSet> |
| <directory>${session.executionRootDirectory}</directory> |
| <includes> |
| <include>**/target/jacoco.exec</include> |
| <include>**/target/jacoco-it.exec</include> |
| </includes> |
| </fileSet> |
| </fileSets> |
| <destFile>${session.executionRootDirectory}/target/jacoco-merged.exec</destFile> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| </plugins> |
| </build> |
| </profile> |
| </profiles> |
| |
| </project> |