blob: 3f77ed8f34212982d9e157054ac9b45531f8acf0 [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>
28 <artifactId>asterix</artifactId>
29 <version>0.8.8-SNAPSHOT</version>
30 </parent>
31
32 <build>
33 <plugins>
34 <plugin>
35 <groupId>org.apache.maven.plugins</groupId>
36 <artifactId>maven-antrun-plugin</artifactId>
37 <version>1.8</version>
38 <executions>
39 <execution>
40 <phase>test</phase>
41 <goals>
42 <goal>run</goal>
43 </goals>
44 <configuration>
45 <target if="coverage" unless="skipTests">
46 <echo message="Generating JaCoCo Reports" />
47 <property name="asterix.dir" location="${basedir}/.."/>
48 <!-- special case for jenkins -->
49 <condition property="hyracks.dir" value="${asterix.dir}/hyracks">
50 <available file="${asterix.dir}/hyracks/pom.xml"/>
51 </condition>
52 <pathconvert property="hyracks.dir">
53 <first>
54 <dirset dir="${asterix.dir}/..">
55 <include name="*hyracks"/>
56 </dirset>
57 </first>
58 </pathconvert>
59 <!-- gather all of the source dirs -->
60 <pathconvert property="source.dirs" pathsep=",">
61 <dirset dir="${asterix.dir}">
62 <include name="**/src/main/java"/>
63 <!-- special case for jenkins -->
64 <exclude name="hyracks/**"/>
65 </dirset>
66 </pathconvert>
67 <pathconvert property="hyracks.source.dirs" pathsep=",">
68 <dirset dir="${hyracks.dir}">
69 <include name="**/src/main/java"/>
70 </dirset>
71 </pathconvert>
72 <echo message="asterix dir: ${asterix.dir}/"/>
73 <echo message="hyracks dir: ${hyracks.dir}"/>
74 <echo message="asterix source dirs: ${source.dirs}/"/>
75 <echo message="hyracks source dirs: ${hyracks.source.dirs}/"/>
76
77 <taskdef name="report" classname="org.jacoco.ant.ReportTask">
78 <classpath path="${basedir}/target/jacoco-jars/org.jacoco.ant.jar" />
79 </taskdef>
80 <mkdir dir="${basedir}/target/coverage-report" />
81 <report>
82 <executiondata>
83 <fileset dir="${asterix.dir}">
84 <include name="**/jacoco.exec" />
85 </fileset>
86 </executiondata>
87 <structure name="AsterixDB Coverage Project">
88 <group name="AsterixDB">
89 <classfiles>
90 <fileset dir="${asterix.dir}">
91 <include name="**/target/classes/**/*.class"/>
92 <!-- special case for jenkins -->
93 <exclude name="hyracks/**"/>
94 </fileset>
95 </classfiles>
96 <sourcefiles encoding="UTF-8">
97 <multirootfileset basedirs="${source.dirs}" type="file">
98 <include name="**/*.java"/>
99 </multirootfileset>
100 </sourcefiles>
101 </group>
102 <group name="Hyracks">
103 <classfiles>
104 <fileset dir="${hyracks.dir}">
105 <include name="**/target/classes/**/*.class"/>
106 <exclude name="hyracks/hyracks-hdfs/hyracks-hdfs-1.x/**"/>
107 </fileset>
108 </classfiles>
109 <sourcefiles encoding="UTF-8">
110 <multirootfileset basedirs="${hyracks.source.dirs}" type="file">
111 <include name="**/*.java"/>
112 </multirootfileset>
113 </sourcefiles>
114 </group>
115 </structure>
116 <html destdir="${basedir}/target/coverage-report/html" />
117 <xml destfile="${basedir}/target/coverage-report/coverage-report.xml" />
118 <csv destfile="${basedir}/target/coverage-report/coverage-report.csv" />
119 </report>
120 </target>
121 </configuration>
122 </execution>
123 </executions>
124 <dependencies>
125 <dependency>
126 <groupId>org.jacoco</groupId>
127 <artifactId>org.jacoco.ant</artifactId>
128 <version>${jacoco.version}</version>
129 </dependency>
130 </dependencies>
131 </plugin>
132 </plugins>
133 </build>
134</project>