-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
104 lines (89 loc) · 3.58 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
plugins {
id("org.springframework.boot") version "3.1.4"
id("io.spring.dependency-management") version "1.1.2"
id("org.graalvm.buildtools.native") version "0.9.27"
kotlin("jvm") version "1.8.22"
id("org.asciidoctor.jvm.convert") version "3.3.2"
}
group = "ru.razornd.twitch"
version = "0.0.1-SNAPSHOT"
java {
sourceCompatibility = JavaVersion.VERSION_17
}
configurations {
compileOnly {
extendsFrom(configurations.annotationProcessor.get())
}
}
val asciiDoc: Configuration by configurations.creating
repositories {
mavenCentral()
}
extra["springmockk"] = "4.0.2"
extra["assertj-db"] = "2.0.2"
extra["wiremock"] = "3.0.4"
val snippetsDir = file("build/generated-snippets")
dependencies {
implementation("org.springframework.boot:spring-boot-starter-webflux")
implementation("org.springframework.boot:spring-boot-starter-data-r2dbc")
implementation("org.springframework.boot:spring-boot-starter-data-redis-reactive")
implementation("org.springframework.boot:spring-boot-starter-oauth2-client")
implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.springframework.session:spring-session-data-redis")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("io.projectreactor.kotlin:reactor-kotlin-extensions")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor")
implementation("org.flywaydb:flyway-core")
runtimeOnly("org.postgresql:r2dbc-postgresql")
runtimeOnly("org.postgresql:postgresql")
runtimeOnly("io.micrometer:micrometer-registry-prometheus")
developmentOnly("org.springframework.boot:spring-boot-docker-compose")
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
asciiDoc("org.springframework.restdocs:spring-restdocs-asciidoctor")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.springframework.boot:spring-boot-testcontainers")
testImplementation("org.springframework.security:spring-security-test")
testImplementation("io.projectreactor:reactor-test")
testImplementation("com.ninja-squad:springmockk:${property("springmockk")}")
testImplementation("org.assertj:assertj-db:${property("assertj-db")}")
testImplementation("org.postgresql:postgresql")
testImplementation("com.squareup.okhttp3:mockwebserver")
testImplementation("org.wiremock:wiremock:${property("wiremock")}")
testImplementation("org.testcontainers:junit-jupiter")
testImplementation("org.testcontainers:postgresql")
testImplementation("org.testcontainers:r2dbc")
testImplementation("org.springframework.restdocs:spring-restdocs-webtestclient")
}
tasks.compileKotlin {
kotlinOptions {
freeCompilerArgs += "-Xjsr305=strict"
jvmTarget = "17"
}
}
tasks.test {
useJUnitPlatform()
outputs.dir(snippetsDir)
}
tasks.asciidoctor {
inputs.dir(snippetsDir)
configurations("asciiDoc")
dependsOn(tasks.test)
}
tasks.processAot {
jvmArgs = listOf("-Dspring.profiles.active=process-aot")
}
tasks.bootBuildImage {
val registryUrl: String? by project
val registryUsername: String? by project
val registryPassword: String? by project
val domain = listOfNotNull(registryUrl, registryUsername?.lowercase(), project.name).joinToString("/")
imageName = "$domain:${project.version}"
docker {
publishRegistry {
url = registryUrl
username = registryUsername
password = registryPassword
}
}
}