forked from znsio/specmatic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
86 lines (71 loc) · 2.01 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
plugins {
id 'java'
id 'maven-publish'
id 'org.jetbrains.kotlin.plugin.serialization' version '1.9.22'
id 'org.jetbrains.kotlin.jvm' version '1.9.22'
id 'jacoco'
id "org.sonarqube" version "4.4.1.3373"
}
allprojects {
repositories {
mavenLocal()
mavenCentral()
}
}
subprojects {
def versionPropsFile = file('../version.properties')
Properties versionProps = new Properties()
versionProps.load(new FileInputStream(versionPropsFile))
def versionInfo = versionProps['version']
version versionInfo
}
task codeCoverageReport(type: JacocoReport) {
// Gather execution data from all subprojects
executionData fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec")
// Add all relevant sourcesets from the subprojects
subprojects.each {
if(!it.name.startsWith("spring-")) {
sourceSets it.sourceSets.main
}
}
reports {
xml.required = true
html.required = true
csv.required = false
}
}
codeCoverageReport.dependsOn {
subprojects.findAll {!it.name.startsWith("spring-")}.test
}
sonarqube {
properties {
property "sonar.projectKey", "znsio_specmatic"
property "sonar.organization", "znsio"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.coverage.jacoco.xmlReportPaths", "${rootDir}/build/reports/jacoco/codeCoverageReport/codeCoverageReport.xml"
property "sonar.coverage.exclusions", "**/application/src/**,**/junit5-support/src/**"
property "sonar.exclusions", "**/*Bean?."
}
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions {
jvmTarget = "17"
}
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
repositories {
mavenCentral()
}
compileKotlin {
kotlinOptions {
jvmTarget = "17"
freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "17"
}
}