-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
73 lines (58 loc) · 1.74 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
plugins {
id 'java'
id 'jacoco'
id 'org.jetbrains.kotlin.jvm' version '1.4.30'
id "org.sonarqube" version "3.4.0.2513"
}
group 'com.madrapps'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib"
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
}
test {
useJUnitPlatform()
}
jacoco {
toolVersion '0.8.0'
}
sonarqube {
properties {
property "sonar.projectKey", "PavanMudigonda_jacoco-playground"
property "sonar.organization", "pavanmudigonda"
property "sonar.host.url", "https://sonarcloud.io"
}
}
tasks.withType(Test) {
jacoco.includeNoLocationClasses = true
}
tasks.create(name: "testCoverage", type: JacocoReport, dependsOn: "test") {
group = "Reporting"
description = "Generate Jacoco coverage reports for the test build."
reports {
html.enabled = true
xml.enabled = true
}
def excludes = [
'**/*Test*.*',
'**/actions/*.*',
'**/core/*.*',
'**/markers/*.*',
'**/services/**/*.*',
'**/toolwindow/*.*',
'**/utils/*.*'
]
def javaClasses = fileTree(dir: "${buildDir}/classes/java/main", excludes: excludes)
def kotlinClasses = fileTree(dir: "${buildDir}/classes/kotlin/main", excludes: excludes)
classDirectories.from = files([javaClasses, kotlinClasses])
sourceDirectories.from = files([
"$project.projectDir/src/main/java",
"$project.projectDir/src/main/kotlin",
"$buildDir/generated/source/kapt/test"
])
executionData.from = files("${project.buildDir}/jacoco/test.exec")
}