forked from spotbugs/spotbugs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
67 lines (53 loc) · 1.7 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
55
56
57
58
59
60
61
62
63
64
65
66
67
plugins {
id "com.github.kt3k.coveralls" version "2.7.1"
id 'org.sonarqube' version '2.5'
}
version = '3.1.0-SNAPSHOT'
apply plugin: 'java'
apply from: "$rootDir/gradle/jacoco.gradle"
apply from: "$rootDir/gradle/sonar.gradle"
subprojects {
apply plugin: 'java'
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 {
gradleVersion = '4.1'
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 coveralls'
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
}
}
coveralls {
jacocoReportPath = "${buildDir}/reports/jacoco/jacocoRootReport/jacocoRootReport.xml"
}
tasks.coveralls {
dependsOn jacocoRootReport
doFirst {
// set lazily to relect subproject specific config in each build.groovy
coveralls.sourceDirs = subprojects.sourceSets.main.allSource.srcDirs.flatten()
}
}