-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
86 lines (73 loc) · 1.78 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
plugins {
id "org.sonarqube" version "3.1.1"
id 'jacoco'
id 'java'
}
repositories {
mavenCentral()
}
sonarqube {
properties {
property "sonar.projectName", "org.geckoprojects.rsa"
property "sonar.projectKey", "geckoprojects-org_org.geckoprojects.rsa"
property "sonar.organization", "geckoprojects-org"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.coverage.jacoco.xmlReportPaths", "${rootDir}/build/reports/jacoco/codeCoverageReport/codeCoverageReport.xml"
}
}
subprojects {
test {
useJUnitPlatform()
reports {
junitXml {
outputPerTestCase = true
mergeReruns = true
}
}
}
}
tasks.named('wrapper') {
jarFile = rootProject.file('.gradle-wrapper/gradle-wrapper.jar')
}
// Disable bnd plugin built-in task 'testOSGi' and register custom task for testing
gradle.startParameter.excludedTaskNames += "testOSGi"
tasks.register('itest'){
subprojects.each { sp ->
sp.tasks.each { t ->
if(t.name ==~ "resolve\\.(test|export)(.*)?"){
dependsOn t
}
}
}
subprojects.each { sp ->
sp.tasks.each { t ->
if(t.name ==~ "testrun\\.test(.*)?"){
dependsOn t
}
}
}
subprojects.each { sp ->
sp.tasks.each { t ->
if(t.name ==~ "export\\.export(.*)?"){
dependsOn t
}
}
}
}
task codeCoverageReport(type: JacocoReport) {
dependsOn itest
// Gather execution data from all subprojects
executionData fileTree(project.rootDir.absolutePath).include("**/**/jacoco.exec")
// Add all relevant sourcesets from the subprojects
subprojects.each {
sourceSets it.sourceSets.main
}
reports {
xml.enabled true
html.enabled true
csv.enabled false
}
}
tasks.named("sonarqube") {
dependsOn(codeCoverageReport)
}