-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
121 lines (103 loc) · 3.32 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 com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
plugins {
kotlin("jvm") version "2.0.21"
kotlin("plugin.spring") version "2.0.21"
id("org.springframework.boot") version "3.3.5"
id("io.spring.dependency-management") version "1.1.6"
kotlin("plugin.jpa") version "2.0.21"
id("org.jlleitschuh.gradle.ktlint") version "12.1.1"
id("com.gorylenko.gradle-git-properties") version "2.4.2"
id("com.github.ben-manes.versions") version "0.51.0"
id("se.patrikerdes.use-latest-versions") version "0.2.18"
}
group = "com.github.adminelix"
version = "0.0.1-SNAPSHOT"
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
configurations {
compileOnly {
extendsFrom(configurations.annotationProcessor.get())
}
}
repositories {
mavenCentral()
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-web") {
exclude(group = "org.springframework.boot", module = "spring-boot-starter-tomcat")
}
implementation("org.springframework.boot:spring-boot-starter-jetty")
implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.6.0")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("io.github.microutils:kotlin-logging-jvm:3.0.5")
implementation("org.postgresql:postgresql")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.springframework.boot:spring-boot-testcontainers")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
testImplementation("org.testcontainers:junit-jupiter")
testImplementation("io.rest-assured:rest-assured:5.5.0")
testImplementation("io.rest-assured:kotlin-extensions:5.5.0")
testImplementation("org.testcontainers:postgresql")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
kotlin {
compilerOptions {
freeCompilerArgs.addAll("-Xjsr305=strict")
}
}
allOpen {
annotation("jakarta.persistence.Entity")
annotation("jakarta.persistence.MappedSuperclass")
annotation("jakarta.persistence.Embeddable")
}
springBoot {
buildInfo()
}
tasks.jar {
enabled = false
}
tasks.bootJar {
archiveClassifier.set("")
}
tasks.withType<Test> {
useJUnitPlatform()
}
tasks.register<Delete>("cleanGitHooks") {
delete(
fileTree(".git/hooks").matching {
include("*")
exclude("*.sample")
},
)
}
tasks.register<Copy>("installGitHooks") {
dependsOn("cleanGitHooks")
from(File(rootProject.rootDir, ".githooks"))
into(File(rootProject.rootDir, ".git/hooks"))
filePermissions {
unix("rwxr-xr-x")
}
}
tasks.generateGitProperties {
mustRunAfter("installGitHooks")
}
tasks.assemble {
dependsOn("installGitHooks")
}
tasks.withType<DependencyUpdatesTask> {
gradleReleaseChannel = "current"
rejectVersionIf {
isNonStable(candidate.version)
}
}
fun isNonStable(version: String): Boolean {
val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.uppercase().contains(it) }
val regex = "^[0-9,.v-]+(-r)?$".toRegex()
val isStable = stableKeyword || regex.matches(version)
return isStable.not()
}