84 lines
1.8 KiB
Groovy
84 lines
1.8 KiB
Groovy
plugins {
|
|
id 'java'
|
|
id 'org.springframework.boot' version '3.5.6'
|
|
id 'io.spring.dependency-management' version '1.1.7'
|
|
id 'jacoco'
|
|
}
|
|
|
|
group = 'io.github.js0ny'
|
|
version = '0.0.1-SNAPSHOT'
|
|
description = 'Demo project for Spring Boot'
|
|
|
|
java {
|
|
toolchain {
|
|
languageVersion = JavaLanguageVersion.of(21)
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
|
|
dependencies {
|
|
implementation 'org.springframework.boot:spring-boot-starter-web'
|
|
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
|
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
|
implementation 'org.springframework.boot:spring-boot-starter-actuator'
|
|
|
|
}
|
|
|
|
jacoco {
|
|
toolVersion = "0.8.12"
|
|
}
|
|
|
|
tasks.named('test') {
|
|
useJUnitPlatform()
|
|
finalizedBy jacocoTestReport
|
|
}
|
|
|
|
jacocoTestReport {
|
|
dependsOn test
|
|
|
|
reports {
|
|
xml.required = true
|
|
html.required = true
|
|
}
|
|
|
|
afterEvaluate {
|
|
classDirectories.setFrom(files(classDirectories.files.collect {
|
|
fileTree(dir: it, exclude: [
|
|
'**/IlpCourseworkApplication.class',
|
|
'**/config/*',
|
|
'**/data/*',
|
|
'**/util/*',
|
|
'**/TelemetryService.class'
|
|
])
|
|
}))
|
|
}
|
|
}
|
|
|
|
jacocoTestCoverageVerification {
|
|
violationRules {
|
|
rule {
|
|
element = 'CLASS'
|
|
|
|
excludes = [
|
|
'io.github.js0ny.ilp_coursework.IlpCourseworkApplication',
|
|
'**.config.**',
|
|
'**.data.**',
|
|
'**.util.**',
|
|
'io.github.js0ny.ilp_coursework.service.TelemetryService'
|
|
]
|
|
|
|
limit {
|
|
counter = 'BRANCH'
|
|
value = 'COVEREDRATIO'
|
|
|
|
minimum = 0.50
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
check.dependsOn jacocoTestCoverageVerification
|