forked from spotbugs/spotbugs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
54 lines (42 loc) · 1.39 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
plugins {
id 'org.sonarqube' version '2.6.2'
}
version = '3.1.10-SNAPSHOT'
apply from: "$rootDir/gradle/java.gradle"
apply from: "$rootDir/gradle/jacoco.gradle"
apply from: "$rootDir/gradle/sonar.gradle"
subprojects {
apply from: "$rootDir/gradle/java.gradle"
apply from: "$rootDir/gradle/eclipse.gradle"
apply from: "$rootDir/gradle/idea.gradle"
apply from: "$rootDir/gradle/test.gradle"
apply from: "$rootDir/gradle/jacoco.gradle"
group = 'com.github.spotbugs'
version = rootProject.version
// Java versions
project.sourceCompatibility = 1.8
project.targetCompatibility = 1.8
repositories {
jcenter()
}
}
repositories {
jcenter()
}
wrapper {
distributionType = Wrapper.DistributionType.ALL
}
// https://discuss.gradle.org/t/merge-jacoco-coverage-reports-for-multiproject-setups/12100/6
task jacocoRootReport(type: JacocoReport) {
description = 'Merge all coverage reports before submit to SonarQube'
executionData project(':spotbugs').file('build/jacoco/test.exec')
sourceDirectories = files(subprojects.sourceSets.main.allSource.srcDirs)
// Only enable class directories related to non-test project
classDirectories = files(subprojects.sourceSets.main.output).filter {
!it.toString().contains("-test") && !it.toString().contains("Test") && !it.toString().contains("junit")
}
reports {
xml.enabled = true
}
}
tasks.sonarqube.dependsOn jacocoRootReport