-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
109 lines (97 loc) · 2.76 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
plugins {
id("java")
id("jacoco")
id("io.freefair.lombok") version "8.6"
id("com.diffplug.spotless") version "6.25.0"
id("org.springframework.boot") version "3.4.1"
}
group = "net.verotek.twitch"
version = "1.0"
java.sourceCompatibility = JavaVersion.VERSION_17
java.toolchain.languageVersion.set(JavaLanguageVersion.of(17))
repositories {
mavenCentral()
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-data-jpa:3.4.1")
implementation("org.springframework.boot:spring-boot-starter-web:3.4.1")
implementation("org.springframework.boot:spring-boot-starter-thymeleaf:3.4.1")
implementation("org.springframework.boot:spring-boot-devtools:3.4.1")
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.6.0")
implementation("org.modelmapper:modelmapper:3.2.1")
implementation("org.postgresql:postgresql:42.7.3")
implementation("com.github.twitch4j:twitch4j:1.23.0")
testImplementation("com.google.truth:truth:1.4.2")
testImplementation("org.mockito:mockito-core:5.10.0")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.0")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.10.0")
}
spotless {
format("misc") {
target("**/*.properties", ".gitignore")
trimTrailingWhitespace()
indentWithTabs()
endWithNewline()
}
java {
googleJavaFormat()
formatAnnotations()
}
kotlinGradle {
trimTrailingWhitespace()
indentWithSpaces(2)
endWithNewline()
}
}
jacoco {
toolVersion = "0.8.8"
reportsDirectory.set(layout.buildDirectory.dir("jacoco"))
}
tasks.register("bootRunDev") {
group = "application"
description = "Run Spring application with dev profile"
dependencies {
implementation("com.h2database:h2:2.1.214")
}
doFirst {
tasks.bootRun.configure {
systemProperty("spring.profiles.active", "dev")
}
}
finalizedBy("bootRun")
}
tasks.bootBuildImage {
val registry = System.getenv("CONTAINER_REGISTRY")
val name = System.getenv("CONTAINER_NAME")
val version = System.getenv("CONTAINER_VERSION")
val login = System.getenv("CONTAINER_LOGIN")
val pass = System.getenv("CONTAINER_PASS")
imageName.set("${registry}/${name}:${version}")
docker {
publishRegistry {
username.set(login)
password.set(pass)
url.set("https://${registry}")
}
}
}
tasks.jacocoTestReport {
dependsOn(tasks.test)
reports {
html.required.set(true)
html.outputLocation.set(layout.buildDirectory.dir("jacoco/html"))
xml.required.set(false)
csv.required.set(true)
csv.outputLocation.set(layout.buildDirectory.file("jacoco/csv/report.csv"))
}
}
tasks.test {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
jacoco {
isEnabled = true
}
finalizedBy(tasks.jacocoTestReport)
}