blob: ba34646c61c59797ab7f812e4a025b653cd7ac08 [file] [log] [blame]
Michael Blowfc644822016-03-16 10:21:24 -04001<!--
2 ! Licensed to the Apache Software Foundation (ASF) under one
3 ! or more contributor license agreements. See the NOTICE file
4 ! distributed with this work for additional information
5 ! regarding copyright ownership. The ASF licenses this file
6 ! to you under the Apache License, Version 2.0 (the
7 ! "License"); you may not use this file except in compliance
8 ! with the License. You may obtain a copy of the License at
9 !
10 ! http://www.apache.org/licenses/LICENSE-2.0
11 !
12 ! Unless required by applicable law or agreed to in writing,
13 ! software distributed under the License is distributed on an
14 ! "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 ! KIND, either express or implied. See the License for the
16 ! specific language governing permissions and limitations
17 ! under the License.
18 !-->
19
20<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">
21 <modelVersion>4.0.0</modelVersion>
22 <artifactId>asterix-coverage</artifactId>
23 <packaging>pom</packaging>
24 <name>asterix-coverage</name>
25
26 <parent>
27 <groupId>org.apache.asterix</groupId>
Ian Maxon3da9d062016-03-16 17:05:31 -070028 <artifactId>apache-asterixdb</artifactId>
AsterixDB Jenkins478eccb2018-08-31 14:57:31 -070029 <version>0.9.5-SNAPSHOT</version>
Michael Blowfc644822016-03-16 10:21:24 -040030 </parent>
31
Michael Blow4cd925c2018-01-20 17:15:38 -050032 <properties>
33 <root.dir>${basedir}/..</root.dir>
34 </properties>
35
Michael Blow7c15c132016-05-04 22:06:34 -040036 <profiles>
37 <profile>
38 <id>coverage</id>
39 <activation>
40 <property>
41 <name>coverage</name>
42 </property>
43 </activation>
44 <build>
45 <plugins>
46 <plugin>
47 <groupId>org.apache.maven.plugins</groupId>
48 <artifactId>maven-antrun-plugin</artifactId>
49 <version>1.8</version>
50 <executions>
51 <execution>
52 <phase>test</phase>
53 <goals>
54 <goal>run</goal>
55 </goals>
56 <configuration>
57 <target if="coverage" unless="skipTests">
58 <echo message="Generating JaCoCo Reports" />
Michael Blow380b0a22016-08-02 13:05:52 -040059 <property name="asterix.dir" location="${basedir}/../.." />
Michael Blow7cd7c2d2016-05-27 21:01:50 -040060
Michael Blow7c15c132016-05-04 22:06:34 -040061 <!-- gather all of the source dirs -->
62 <pathconvert property="source.dirs" pathsep=",">
63 <dirset dir="${asterix.dir}">
Michael Blow380b0a22016-08-02 13:05:52 -040064 <include name="**/src/main/java" />
Michael Blow7c15c132016-05-04 22:06:34 -040065 </dirset>
66 </pathconvert>
Michael Blow7cd7c2d2016-05-27 21:01:50 -040067
Michael Blow380b0a22016-08-02 13:05:52 -040068 <echo message="asterix dir: ${asterix.dir}/" />
69 <echo message="asterix source dirs: ${source.dirs}/" />
Michael Blowfc644822016-03-16 10:21:24 -040070
Michael Blow7c15c132016-05-04 22:06:34 -040071 <taskdef name="report" classname="org.jacoco.ant.ReportTask">
72 <classpath path="${basedir}/target/jacoco-jars/org.jacoco.ant.jar" />
73 </taskdef>
74 <mkdir dir="${basedir}/target/coverage-report" />
75 <report>
76 <executiondata>
Michael Blowfc644822016-03-16 10:21:24 -040077 <fileset dir="${asterix.dir}">
Michael Blow7c15c132016-05-04 22:06:34 -040078 <include name="**/jacoco.exec" />
Michael Blowfc644822016-03-16 10:21:24 -040079 </fileset>
Michael Blow7c15c132016-05-04 22:06:34 -040080 </executiondata>
81 <structure name="AsterixDB Coverage Project">
82 <group name="AsterixDB">
83 <classfiles>
84 <fileset dir="${asterix.dir}">
Michael Blow380b0a22016-08-02 13:05:52 -040085 <include name="**/target/classes/**/*.class" />
Michael Blow7c15c132016-05-04 22:06:34 -040086 </fileset>
87 </classfiles>
88 <sourcefiles encoding="UTF-8">
89 <multirootfileset basedirs="${source.dirs}" type="file">
Michael Blow380b0a22016-08-02 13:05:52 -040090 <include name="**/*.java" />
Michael Blow7c15c132016-05-04 22:06:34 -040091 </multirootfileset>
92 </sourcefiles>
93 </group>
Michael Blow7c15c132016-05-04 22:06:34 -040094 </structure>
95 <html destdir="${basedir}/target/coverage-report/html" />
96 <xml destfile="${basedir}/target/coverage-report/coverage-report.xml" />
97 <csv destfile="${basedir}/target/coverage-report/coverage-report.csv" />
98 </report>
99 </target>
100 </configuration>
101 </execution>
102 </executions>
103 <dependencies>
104 <dependency>
105 <groupId>org.jacoco</groupId>
106 <artifactId>org.jacoco.ant</artifactId>
107 <version>${jacoco.version}</version>
108 </dependency>
109 </dependencies>
110 </plugin>
111 <plugin>
Michael Blowfc644822016-03-16 10:21:24 -0400112 <groupId>org.jacoco</groupId>
Michael Blow7c15c132016-05-04 22:06:34 -0400113 <artifactId>jacoco-maven-plugin</artifactId>
Michael Blowfc644822016-03-16 10:21:24 -0400114 <version>${jacoco.version}</version>
Michael Blow7c15c132016-05-04 22:06:34 -0400115 <executions>
116 <execution>
117 <goals>
118 <goal>merge</goal>
119 </goals>
120 <phase>test</phase>
121 <configuration>
122 <fileSets>
123 <fileSet>
124 <directory>${session.executionRootDirectory}</directory>
125 <includes>
126 <include>**/target/jacoco.exec</include>
127 <include>**/target/jacoco-it.exec</include>
128 </includes>
129 </fileSet>
130 </fileSets>
131 <destFile>${session.executionRootDirectory}/target/jacoco-merged.exec</destFile>
132 </configuration>
133 </execution>
134 </executions>
135 </plugin>
136 </plugins>
137 </build>
138 </profile>
139 </profiles>
140
Michael Blowfc644822016-03-16 10:21:24 -0400141</project>