-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
114 lines (100 loc) · 4.25 KB
/
build.gradle.kts
File metadata and controls
114 lines (100 loc) · 4.25 KB
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
val springBootVersion: String by project
val javaVersion: String by project
plugins {
id("org.springframework.boot") version "2.7.17"
id("io.spring.dependency-management") version "1.1.4"
kotlin("jvm") version "1.9.10"
kotlin("plugin.spring") version "1.9.10"
kotlin("plugin.jpa") version "1.9.10"
id("io.gitlab.arturbosch.detekt") version "1.23.3"
id("jacoco")
id("org.jetbrains.dokka") version "1.9.10"
id("info.solidsoft.pitest") version "1.15.0"
}
group = "com.innopolis"
version = "0.0.1-SNAPSHOT"
java.sourceCompatibility = JavaVersion.VERSION_17
repositories {
mavenCentral()
}
dependencies {
val kotlinVersion: String by project
val flywayVersion: String by project
val firebaseVersion: String by project
val jsonVersion: String by project
val springdocVersion: String by project
val junitVersion: String by project
val mockkVersion: String by project
val testcontainersVersion: String by project
val postgresqlVersion: String by project
val jacksonVersion: String by project
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:$jacksonVersion")
implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion")
implementation("org.flywaydb:flyway-core:$flywayVersion")
implementation("com.google.firebase:firebase-admin:$firebaseVersion")
implementation("org.json:json:$jsonVersion")
implementation("org.springdoc:springdoc-openapi-ui:$springdocVersion")
implementation("org.springdoc:springdoc-openapi-ui:$springdocVersion")
runtimeOnly("org.postgresql:postgresql:$postgresqlVersion")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitVersion")
testImplementation("io.mockk:mockk:$mockkVersion")
testImplementation("org.testcontainers:postgresql:$testcontainersVersion")
}
tasks.test {
useJUnitPlatform()
finalizedBy(tasks.jacocoTestCoverageVerification, tasks.jacocoTestReport)
doLast {
println("View code coverage at:")
println("file://$buildDir/reports/jacoco/test/html/index.html")
}
}
tasks.jacocoTestReport {
dependsOn(tasks.test)
reports {
xml.required = true
}
}
tasks.jacocoTestCoverageVerification {
// dependsOn("pitest")
violationRules {
rule {
limit {
minimum = BigDecimal(0.7)
}
}
}
}
tasks.withType<io.gitlab.arturbosch.detekt.Detekt>().configureEach {
jvmTarget = javaVersion
}
tasks.withType<io.gitlab.arturbosch.detekt.DetektCreateBaselineTask>().configureEach {
jvmTarget = javaVersion
}
detekt {
buildUponDefaultConfig = true // preconfigure defaults
allRules = false // activate all available (even unstable) rules.
config =
files("$projectDir/config/detekt.yml") // point to your custom config defining rules to run, overwriting default behavior
baseline = file("$projectDir/config/baseline.xml") // a way of suppressing issues before introducing detekt
}
tasks.withType<io.gitlab.arturbosch.detekt.Detekt>().configureEach {
reports {
html.required.set(true) // observe findings in your browser with structure and code snippets
xml.required.set(true) // checkstyle like format mainly for integrations like Jenkins
txt.required.set(true) // similar to the console output, contains issue signature to manually edit baseline files
sarif.required.set(true) // standardized SARIF format (https://sarifweb.azurewebsites.net/) to support integrations with Github Code Scanning
md.required.set(true) // simple Markdown format
}
}
pitest {
setProperty("junit5PluginVersion", "1.0.0")
setProperty("testPlugin", "junit5")
setProperty("mutationThreshold", 55)
setProperty("targetClasses", listOf("com.innopolis.innoqueue.domain.notification.service.NotificationService*"))
setProperty("targetTests", listOf("com.innopolis.innoqueue.domain.notification.service.NotificationServiceTest*"))
setProperty("outputFormats", listOf("HTML", "XML"))
}