-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
186 lines (172 loc) · 7.21 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
186 lines (172 loc) · 7.21 KB
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
177
178
179
180
181
182
183
184
185
186
plugins {
alias(libs.plugins.micronaut.application)
alias(libs.plugins.micronaut.aot)
alias(libs.plugins.micronaut.test.resources) // TODO: Needs be fixed, ref: https://github.com/micronaut-projects/micronaut-gradle-plugin/issues/1195
jacoco
`maven-publish`
alias(libs.plugins.cyclonedx)
}
version = "2.6.0" // x-release-please-version
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(25))
}
}
dependencies {
//Micronaut
annotationProcessor(mn.micronaut.serde.processor)
annotationProcessor(mn.micronaut.http.validation)
annotationProcessor(mn.micronaut.data.processor)
annotationProcessor(mn.micronaut.validation.processor)
annotationProcessor(mn.micronaut.inject.java)
annotationProcessor(mn.micronaut.openapi)
compileOnly(mn.micronaut.openapi.annotations)
implementation(mn.micronaut.serde.jackson)
implementation(mn.micronaut.data.processor)
implementation(mn.micronaut.validation)
implementation(mn.micronaut.data.jpa)
implementation(mn.micronaut.hibernate.jpa)
implementation(mn.micronaut.data.hibernate.jpa)
implementation(mn.micronaut.data.tx.hibernate)
implementation(mn.micronaut.jdbc.hikari)
implementation(mn.micronaut.runtime)
implementation(mn.micronaut.openapi)
implementation(mn.validation)
implementation(mn.swagger.core)
implementation(mn.micronaut.management)
implementation(mn.micronaut.micrometer.core)
implementation(mn.micronaut.micrometer.registry.prometheus)
// Kubernetes service discovery — beans only activate in the k8s environment,
// so this is inert in local/dev. Needs RBAC (read services/endpoints) in-cluster.
implementation(mn.micronaut.kubernetes.discovery.client)
// External Dependencies
implementation(mn.mariadb.java.client)
implementation(mn.postgresql)
implementation(mn.snakeyaml)
implementation(mn.logback.core)
implementation(mn.logback.classic)
// Distributed tracing (OpenTelemetry). Spans/export are only active when
// OTEL_TRACES_EXPORTER=otlp is set (prod/Docker) — see application.yml.
implementation(mn.micronaut.tracing.opentelemetry.http)
implementation(mn.micronaut.tracing.opentelemetry.jdbc)
implementation(libs.opentelemetry.exporter.otlp)
// Structured JSON logging for Grafana Loki + trace/log correlation.
// logstash encoder renders JSON; the OTel MDC appender injects trace_id/span_id.
implementation(libs.logstash.logback.encoder)
implementation(libs.opentelemetry.logback.mdc)
// Enables the <if>/<then>/<else> conditional in logback.xml.
runtimeOnly(libs.janino)
// Vulpes API
implementation(libs.vulpes.api)
// UUID Creator
implementation(libs.uuid.creator)
testImplementation(mn.junit.jupiter.api)
testImplementation(mn.junit.jupiter.params)
testImplementation(mn.testcontainers.core)
testImplementation(mn.testcontainers.mariadb)
testImplementation(mn.micronaut.test.rest.assured)
testImplementation(mn.micronaut.validation)
testImplementation(mn.micronaut.test.resources.extensions.core)
testImplementation(mn.micronaut.test.resources.extensions.junit.platform)
// Faker library for JUnit tests
testImplementation(libs.testcontainers.junit)
testImplementation(libs.datafaker)
testImplementation(libs.hibernate.validator)
testImplementation(libs.jakarta.validation)
testRuntimeOnly(mn.junit.jupiter.engine)
}
application {
mainClass.set("net.onelitefeather.vulpes.backend.VulpesBackend")
}
graalvmNative.toolchainDetection = false
micronaut {
runtime("netty")
testRuntime("junit5")
processing {
incremental(true)
annotations("net.onelitefeather.vulpes.*")
}
aot {
optimizeServiceLoading = false
convertYamlToJava = false
precomputeOperations = true
cacheEnvironment = true
optimizeClassLoading = false
deduceEnvironment = true
optimizeNetty = true
// Keep logback.xml parsed at runtime so the env-driven JSON/plain switch
// and ${...} substitutions work in the optimized (Docker/prod) jar.
replaceLogbackXml = false
}
}
tasks {
named("internalStartTestResourcesService") { // Workaround for Java 25 Graal: https://github.com/micronaut-projects/micronaut-gradle-plugin/issues/1195#issuecomment-3714801163
setProperty("useClassDataSharing", false)
}
compileJava {
options.encoding = "UTF-8"
options.release = 25
options.forkOptions.jvmArgs = listOf("-Dmicronaut.openapi.views.spec=rapidoc.enabled=true,openapi-explorer.enabled=true,swagger-ui.enabled=true,swagger-ui.theme=flattop")
}
jacocoTestReport {
reports {
xml.required.set(true)
html.required.set(true)
csv.required.set(false)
}
}
}
publishing {
publications.create<MavenPublication>("maven") {
// Only the thin application jar is published. The fat runner jars and the
// full distribution tar/zip bundle every dependency; the runnable artifact
// is the Docker image, not a Maven artifact.
artifact(project.tasks.jar)
version = rootProject.version as String
artifactId = "vulpes-backend"
groupId = rootProject.group as String
pom {
name = "Vulpes Backend"
description = "A backend server for OneLiteFeather's Vulpes project, providing a REST API and database access."
url = "https://github.com/OneLiteFeatherNET/vulpes-backend"
licenses {
license {
name = "AGPL-3.0"
url = "https://www.gnu.org/licenses/agpl-3.0.en.html"
}
}
developers {
developer {
id = "themeinerlp"
name = "Phillipp Glanz"
email = "p.glanz@madfix.me"
}
developer {
id = "theEvilReaper"
name = "Steffen Wonning"
email = "steffenwx@gmail.com"
}
}
scm {
connection = "scm:git:git://github.com:OneLiteFeatherNET/vulpes-backend.git"
developerConnection = "scm:git:ssh://git@github.com:OneLiteFeatherNET/vulpes-backend.git"
url = "https://github.com/OneLiteFeatherNET/vulpes-backend"
}
}
}
repositories {
maven {
authentication {
credentials(PasswordCredentials::class) {
// Those credentials need to be set under "Settings -> Secrets -> Actions" in your repository
username = System.getenv("ONELITEFEATHER_MAVEN_USERNAME")
password = System.getenv("ONELITEFEATHER_MAVEN_PASSWORD")
}
}
name = "OneLiteFeatherRepository"
val releasesRepoUrl = uri("https://repo.onelitefeather.dev/onelitefeather-releases")
val snapshotsRepoUrl = uri("https://repo.onelitefeather.dev/onelitefeather-snapshots")
url = if (version.toString().contains("BETA") || version.toString().contains("ALPHA") || version.toString().contains("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
}
}
}