This repository has been archived by the owner on Sep 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
121 lines (107 loc) · 3.79 KB
/
build.gradle.kts
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
119
120
121
import org.springframework.boot.gradle.tasks.bundling.BootBuildImage
plugins {
id("com.adarshr.test-logger") version "4.0.0"
id("io.spring.dependency-management") version "1.1.6"
id("org.jetbrains.kotlinx.kover") version "0.8.3"
id("org.sonarqube") version "5.1.0.4882"
id("org.springframework.boot") version "3.3.3"
kotlin("jvm") version "2.0.10"
kotlin("kapt") version "2.0.20"
kotlin("plugin.allopen") version "2.0.20"
kotlin("plugin.jpa") version "2.0.20"
kotlin("plugin.spring") version "2.0.20"
}
group = "io.github.tacascer"
version = "1.4.0" // x-release-please-version
allOpen {
annotation("jakarta.persistence.Entity")
annotation("jakarta.persistence.Embeddable")
annotation("jakarta.persistence.MappedSuperclass")
annotation("jakarta.transaction.Transactional")
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
}
}
repositories {
mavenCentral()
}
configurations {
compileOnly {
extendsFrom(configurations.annotationProcessor.get())
}
}
val mapstructVersion = "1.6.0"
val instancioVersion = "4.6.0"
val kotestSpringVersion = "1.3.0"
val kotestVersion = "5.9.1"
val springMockkVersion = "4.0.2"
val springDocOpenApiVersion = "2.6.0"
dependencies {
developmentOnly("org.springframework.boot:spring-boot-devtools")
developmentOnly("org.springframework.boot:spring-boot-docker-compose")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.liquibase:liquibase-core")
implementation("org.mapstruct:mapstruct:$mapstructVersion")
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:$springDocOpenApiVersion")
implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-web")
kapt("org.mapstruct:mapstruct-processor:$mapstructVersion")
runtimeOnly("org.postgresql:postgresql")
testImplementation("com.ninja-squad:springmockk:$springMockkVersion")
testImplementation("io.kotest.extensions:kotest-extensions-spring:$kotestSpringVersion")
testImplementation("io.kotest:kotest-property:$kotestVersion")
testImplementation("io.kotest:kotest-runner-junit5-jvm:$kotestVersion")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.springframework.boot:spring-boot-testcontainers")
testImplementation("org.testcontainers:junit-jupiter")
testImplementation("org.testcontainers:postgresql")
}
kotlin {
compilerOptions {
freeCompilerArgs.add("-Xjsr305=strict")
}
}
kover {
reports {
filters {
excludes {
classes("io.github.tacascer.prediction.db.PredictionValueType") // Has JPA Buddy generated code
}
}
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
tasks.sonar {
dependsOn(tasks.named("koverXmlReport"))
}
sonar {
properties {
property("sonar.projectKey", "tacascer-org_predix")
property("sonar.organization", "tacascer-org")
property("sonar.host.url", "https://sonarcloud.io")
property(
"sonar.coverage.jacoco.xmlReportPaths",
"${layout.buildDirectory.asFile.get()}/reports/kover/report.xml",
)
}
}
tasks.named<BootBuildImage>("bootBuildImage") {
val image = "tacascer/${project.name}"
imageName = image
tags = listOf("$image:${project.version}", "$image:latest")
if (System.getenv("DOCKER_HUB_TOKEN") != null) {
publish = true
docker {
publishRegistry {
username = "tacascer"
password = System.getenv("DOCKER_HUB_TOKEN")
}
}
}
}