-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
61 lines (51 loc) · 1.79 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
plugins {
id "org.sonarqube" version "4.0.0.2929"
id 'jacoco'
id 'java'
}
// We need to define a repository for the root project, otherwise Jacoco dependencies cannot be resolved
repositories {
mavenCentral()
}
subprojects {
// Apply plugin: 'jacoco' to all submodules JUnit tests are generated as generated/jacoco/test.exec
apply plugin: 'jacoco'
// We need to define a repository, otherwise Jacoco dependencies cannot be resolved
repositories {
mavenCentral()
}
// Allow gradle to enable JUnit support in submodules
test {
useJUnitPlatform()
}
}
// Sonar setup
sonarqube {
properties {
property "sonar.projectName", "org.gecko.libraries"
property "sonar.projectKey", "geckoprojects-org_org.gecko.libraries"
property "sonar.organization", "geckoprojects-org"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.coverage.jacoco.xmlReportPaths", "${rootDir}/build/reports/jacoco/codeCoverageReport/codeCoverageReport.xml"
//property "sonar.exclusions", "org.gecko.project/**/*.java, org.gecko.other.project/**/*.java"
}
}
task codeCoverageReport(type: JacocoReport) {
dependsOn(test)
// Gather execution data from all subprojects for JUnit generated/jacoco/test.exec for OSGi Tests generated/tmp/testOSGi/generated/jacoco.exec
// Latter are generated via agent in the test.bndrun
executionData fileTree(project.rootDir.absolutePath).include("**/**/*.exec")
// Add all relevant sourcesets from the subprojects
subprojects.each {
sourceSets it.sourceSets.main
}
// Generate xml reposrt for tools like sonar and html for humans
reports {
xml.enabled true
html.enabled true
csv.enabled false
}
}
tasks.named("sonar") {
dependsOn(codeCoverageReport)
}