forked from projectnessie/nessie
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
228 lines (200 loc) · 8.31 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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
/*
* Copyright (C) 2022 Dremio
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import io.quarkus.gradle.tasks.QuarkusBuild
import org.apache.tools.ant.taskdefs.condition.Os
plugins {
alias(libs.plugins.quarkus)
id("nessie-conventions-quarkus")
id("nessie-jacoco")
}
extra["maven.name"] = "Nessie - Quarkus Server"
val quarkusRunner by
configurations.creating {
description = "Used to reference the generated runner-jar (either fast-jar or uber-jar)"
}
val openapiSource by
configurations.creating { description = "Used to reference OpenAPI spec files" }
configurations.configureEach {
// Avoids dependency resolution error since Quarkus 3.3:
// Cannot select module with conflict on capability 'com.google.guava:listenablefuture:1.0' also
// provided by
// [com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava(runtime)]
resolutionStrategy.capabilitiesResolution.withCapability("com.google.guava:listenablefuture") {
select("com.google.guava:guava:0")
}
}
dependencies {
implementation(project(":nessie-model"))
implementation(project(":nessie-services"))
implementation(project(":nessie-quarkus-common"))
implementation(project(":nessie-events-quarkus"))
implementation(project(":nessie-rest-services"))
implementation(project(":nessie-versioned-spi"))
implementation(project(":nessie-versioned-persist-adapter"))
implementation(project(":nessie-versioned-persist-store"))
implementation(libs.nessie.ui)
implementation(enforcedPlatform(libs.quarkus.bom))
implementation(enforcedPlatform(libs.quarkus.amazon.services.bom))
implementation("org.jboss.resteasy:resteasy-core-spi")
implementation("io.quarkus:quarkus-resteasy")
implementation("io.quarkus:quarkus-resteasy-jackson")
implementation("io.quarkus:quarkus-reactive-routes")
implementation("io.quarkus:quarkus-elytron-security-properties-file")
implementation("io.quarkus:quarkus-smallrye-health")
implementation("io.quarkus:quarkus-oidc")
implementation("io.quarkus:quarkus-smallrye-openapi")
implementation("io.quarkus:quarkus-micrometer")
implementation("io.quarkus:quarkus-core-deployment")
implementation("io.quarkus:quarkus-opentelemetry")
implementation(libs.quarkus.logging.sentry)
implementation("io.smallrye:smallrye-open-api-jaxrs")
implementation("io.micrometer:micrometer-registry-prometheus")
implementation(platform(libs.cel.bom))
implementation("org.projectnessie.cel:cel-tools")
implementation("org.projectnessie.cel:cel-jackson")
if (project.hasProperty("k8s")) {
/*
* Use the k8s project property to generate manifest files for K8s & Minikube, which will be
* located under target/kubernetes.
* See also https://quarkus.io/guides/deploying-to-kubernetes for additional details
*/
implementation("io.quarkus:quarkus-kubernetes")
implementation("io.quarkus:quarkus-minikube")
}
openapiSource(project(":nessie-model", "openapiSource"))
testFixturesApi(project(":nessie-client"))
testFixturesApi(project(":nessie-client-testextension"))
testFixturesApi(project(":nessie-jaxrs-tests"))
testFixturesApi(project(":nessie-quarkus-common"))
testFixturesApi(project(":nessie-quarkus-tests"))
testFixturesApi(project(":nessie-events-api"))
testFixturesApi(project(":nessie-events-spi"))
testFixturesApi(project(":nessie-events-service"))
testFixturesImplementation(project(":nessie-versioned-spi"))
testFixturesImplementation(project(":nessie-versioned-tests"))
testFixturesImplementation(project(":nessie-versioned-persist-adapter"))
testFixturesImplementation(project(":nessie-versioned-persist-store"))
testFixturesImplementation(project(":nessie-versioned-persist-tests"))
testFixturesApi(project(":nessie-versioned-storage-common"))
testFixturesApi(project(":nessie-versioned-storage-store"))
testFixturesImplementation(project(":nessie-versioned-storage-testextension")) {
// Needed to avoid dependency resolution error:
// Module 'com.google.guava:guava' ... rejected: 'com.google.guava:listenablefuture:1.0' also
// provided by
// [com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava(compile)]
exclude("com.google.guava")
}
testFixturesApi(enforcedPlatform(libs.quarkus.bom))
testFixturesImplementation("com.fasterxml.jackson.core:jackson-annotations")
testFixturesApi("io.quarkus:quarkus-rest-client")
testFixturesApi("io.quarkus:quarkus-test-security")
testFixturesApi("io.quarkus:quarkus-test-oidc-server")
testFixturesImplementation(libs.guava)
testFixturesImplementation(libs.microprofile.openapi)
testFixturesImplementation(libs.awaitility)
testFixturesApi(platform(libs.junit.bom))
testFixturesApi(libs.bundles.junit.testing)
intTestImplementation("io.quarkus:quarkus-test-keycloak-server")
intTestImplementation(project(":nessie-keycloak-testcontainer"))
intTestImplementation(libs.keycloak.admin.client)
}
val pullOpenApiSpec by tasks.registering(Sync::class)
val openApiSpecDir = layout.buildDirectory.dir("openapi-extra")
pullOpenApiSpec.configure {
destinationDir = openApiSpecDir.get().asFile
from(openapiSource) { include("openapi.yaml") }
}
quarkus {
quarkusBuildProperties.put("quarkus.package.type", quarkusPackageType())
quarkusBuildProperties.put(
"quarkus.smallrye-openapi.store-schema-directory",
layout.buildDirectory.asFile.map { it.resolve("openapi") }.get().toString()
)
quarkusBuildProperties.put(
"quarkus.smallrye-openapi.additional-docs-directory",
openApiSpecDir.get().toString()
)
quarkusBuildProperties.put("quarkus.smallrye-openapi.info-version", project.version.toString())
quarkusBuildProperties.put("quarkus.smallrye-openapi.auto-add-security", "false")
// Pull manifest attributes from the "main" `jar` task to get the
// release-information into the jars generated by Quarkus.
quarkusBuildProperties.putAll(
provider {
tasks
.named("jar", Jar::class.java)
.get()
.manifest
.attributes
.map { e -> "quarkus.package.manifest.attributes.\"${e.key}\"" to e.value.toString() }
.toMap()
}
)
}
val quarkusAppPartsBuild = tasks.named("quarkusAppPartsBuild")
quarkusAppPartsBuild.configure {
dependsOn(pullOpenApiSpec)
inputs.files(openapiSource)
}
tasks.withType<Test>().configureEach {
systemProperty(
"it.nessie.container.postgres.tag",
System.getProperty("it.nessie.container.postgres.tag", libs.versions.postgresContainerTag.get())
)
systemProperty("keycloak.docker.tag", libs.versions.keycloak.get())
}
val quarkusBuild = tasks.named<QuarkusBuild>("quarkusBuild")
// Expose runnable jar via quarkusRunner configuration for integration-tests that require the
// server.
artifacts {
add(
quarkusRunner.name,
provider {
if (quarkusFatJar()) quarkusBuild.get().runnerJar
else quarkusBuild.get().fastJar.resolve("quarkus-run.jar")
}
) {
builtBy(quarkusBuild)
}
}
// Add the uber-jar, if built, to the Maven publication
if (quarkusFatJar()) {
afterEvaluate {
publishing {
publications {
named<MavenPublication>("maven") {
artifact(quarkusBuild.get().runnerJar) {
classifier = "runner"
builtBy(quarkusBuild)
}
}
}
}
}
}
listOf("javadoc", "sourcesJar").forEach { name ->
tasks.named(name).configure { dependsOn(tasks.named("compileQuarkusGeneratedSourcesJava")) }
}
listOf("checkstyleTest", "compileTestJava").forEach { name ->
tasks.named(name).configure { dependsOn(tasks.named("compileQuarkusTestGeneratedSourcesJava")) }
}
// Testcontainers is not supported on Windows :(
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
tasks.named<Test>("intTest").configure { this.enabled = false }
}
// Issue w/ testcontainers/podman in GH workflows :(
if (Os.isFamily(Os.FAMILY_MAC) && System.getenv("CI") != null) {
tasks.named<Test>("intTest").configure { this.enabled = false }
}