-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathbuild.gradle
118 lines (96 loc) · 3 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
buildscript {
ext.kotlin_version = '1.4.31'
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.github.form-com.diff-coverage-gradle:diff-coverage:0.8.0'
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.20.0"
}
}
repositories {
mavenCentral()
}
apply plugin: 'jacoco'
apply plugin: 'com.form.diff-coverage'
ext {
kotest_version = '4.6.1'
}
subprojects {
apply plugin: 'kotlin'
apply plugin: 'maven-publish'
apply plugin: 'jacoco'
apply plugin: "io.gitlab.arturbosch.detekt"
repositories {
mavenCentral()
}
dependencies {
implementation 'org.apache.logging.log4j:log4j-slf4j-impl:2.18.0'
testImplementation "io.kotest:kotest-runner-junit5-jvm:$kotest_version"
testImplementation "io.kotest:kotest-assertions-core-jvm:$kotest_version"
testImplementation "io.kotest:kotest-property-jvm:$kotest_version"
testImplementation 'io.mockk:mockk:1.12.0'
}
test {
useJUnitPlatform()
}
compileKotlin {
kotlinOptions.jvmTarget = '1.8'
kotlinOptions.apiVersion = '1.3'
}
compileTestKotlin {
kotlinOptions.jvmTarget = '1.8'
}
sourceCompatibility = 1.8
task sourcesJar(type: Jar, dependsOn: classes) {
classifier 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
jacoco {
toolVersion = "0.8.8"
}
jacocoTestReport {
reports {
html.required = true
}
executionData.from fileTree(buildDir).include("/jacoco/*.exec")
}
}
task jacocoRootReport(type: JacocoReport, group: 'Coverage reports') {
group 'verification'
description = 'Generates an aggregate report from all subprojects'
dependsOn(subprojects.test)
additionalSourceDirs.from = files(subprojects.sourceSets.main.allSource.srcDirs)
sourceDirectories.from = files(subprojects.sourceSets.main.allSource.srcDirs)
classDirectories.from = files(subprojects.sourceSets.main.output)
executionData.from = files(subprojects.jacocoTestReport.executionData)
reports {
xml.required = true
html.required = true
}
}
diffCoverageReport {
def diffBase = project.hasProperty('diffBase') ? project.diffBase : 'HEAD'
diffSource.git.compareWith diffBase
jacocoExecFiles = files(subprojects.jacocoTestReport.executionData)
classesDirs = files(subprojects.jacocoTestReport.classDirectories)
srcDirs = files(subprojects.jacocoTestReport.sourceDirectories)
reportConfiguration.html = true
reportConfiguration.fullCoverageReport = true
violationRules.failIfCoverageLessThan 0.9
}
task clean {
doLast {
delete project.buildDir
}
}