-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
176 lines (145 loc) · 4.5 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
import com.google.cloud.tools.jib.gradle.JibExtension
import com.vaadin.gradle.vaadin
import io.gitlab.arturbosch.detekt.Detekt
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jlleitschuh.gradle.ktlint.reporter.ReporterType
plugins {
id("org.springframework.boot") version "3.2.2"
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("org.jlleitschuh.gradle.ktlint") version "11.0.0"
kotlin("plugin.noarg") version "1.9.10"
kotlin("plugin.allopen") version "1.9.10"
id("com.google.cloud.tools.jib") version "3.3.1"
id("com.vaadin") version "24.3.7"
}
allOpen {
annotations(
"jakarta.persistence.Entity",
"jakarta.persistence.Embeddable",
"jakarta.persistence.MappedSuperclass"
)
}
noArg {
annotations(
"jakarta.persistence.Entity",
"jakarta.persistence.Embeddable",
"jakarta.persistence.MappedSuperclass"
)
}
group = "com.albatros"
version = "0.0.1-SNAPSHOT"
java {
sourceCompatibility = JavaVersion.VERSION_17
}
configurations {
compileOnly {
extendsFrom(configurations.annotationProcessor.get())
}
}
repositories {
mavenCentral()
maven { setUrl("https://maven.vaadin.com/vaadin-prereleases") }
maven { setUrl("https://repo.spring.io/milestone") }
maven { setUrl("https://maven.vaadin.com/vaadin-addons") }
}
vaadin.productionMode = System.getenv("PROD_MODE")?.toBoolean() ?: false
vaadin {
forceProductionBuild = System.getenv("PROD_MODE")?.toBoolean() ?: false
productionMode = System.getenv("PROD_MODE")?.toBoolean() ?: false
}
dependencies {
// Actuator
implementation("org.springframework.boot:spring-boot-starter-actuator")
// OpenAI
implementation("org.springframework.ai:spring-ai-openai-spring-boot-starter")
// Elasticsearch
implementation("org.springframework.boot:spring-boot-starter-data-elasticsearch")
// Vaadin
implementation("com.vaadin:vaadin-spring-boot-starter") {
if (System.getenv("PROD_MODE")?.toBoolean() == true) {
exclude(module = "vaadin-dev")
}
}
// Kotlin
implementation("org.jetbrains.kotlin:kotlin-reflect")
// Lombok
annotationProcessor("org.projectlombok:lombok")
compileOnly("org.projectlombok:lombok")
// Persistence
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-data-redis")
runtimeOnly("org.postgresql:postgresql")
// WebClient
implementation("org.springframework.boot:spring-boot-starter-webflux")
// Swagger-UI + OpenApi
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.3.0")
// Validation
implementation("org.springframework.boot:spring-boot-starter-validation")
// Spring MVC
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
// Test
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.springframework.security:spring-security-test")
// Liquibase
implementation("org.liquibase:liquibase-core")
}
dependencyManagement {
imports {
mavenBom("com.vaadin:vaadin-bom:24.3.7")
mavenBom("org.springframework.ai:spring-ai-bom:0.8.1")
}
}
val jibBaseImage = "eclipse-temurin:17-jre"
val jibImageArch = "amd64"
configure<JibExtension> {
container.creationTime.set("USE_CURRENT_TIMESTAMP")
from {
image = jibBaseImage
platforms {
platform {
architecture = jibImageArch
os = "linux"
}
}
}
to {
image = "spring-security:$version"
tags = setOf("$version", "latest")
}
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs += "-Xjsr305=strict"
jvmTarget = "17"
}
}
detekt {
buildUponDefaultConfig = true
config.setFrom(
file("detekt.yml")
)
}
ktlint {
android.set(false)
ignoreFailures.set(true)
reporters {
reporter(ReporterType.HTML)
}
}
tasks.withType<Detekt>().configureEach {
reports {
xml.required.set(true)
html.required.set(true)
txt.required.set(true)
sarif.required.set(true)
md.required.set(true)
}
}
tasks.withType<Test> {
useJUnitPlatform()
}