Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 47 additions & 2 deletions quarkus/server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* under the License.
*/

import io.quarkus.gradle.tasks.QuarkusBuild

plugins {
alias(libs.plugins.quarkus)
alias(libs.plugins.jandex)
Expand All @@ -26,6 +28,11 @@ plugins {
id("distribution")
}

val quarkusRunner by
configurations.creating {
description = "Used to reference the generated runner-jar (either fast-jar or uber-jar)"
}

dependencies {
implementation(project(":polaris-core"))
implementation(project(":polaris-api-management-service"))
Expand All @@ -41,8 +48,10 @@ dependencies {
implementation(platform(libs.dnsjava))
}

val quarkusFatJar = project.hasProperty("uber-jar") || project.hasProperty("release")

quarkus {
quarkusBuildProperties.put("quarkus.package.type", "fast-jar")
quarkusBuildProperties.put("quarkus.package.type", if (quarkusFatJar) "uber-jar" else "fast-jar")
// Pull manifest attributes from the "main" `jar` task to get the
// release-information into the jars generated by Quarkus.
quarkusBuildProperties.putAll(
Expand All @@ -69,10 +78,46 @@ tasks.register("polarisServerRun") { dependsOn("quarkusRun") }
distributions {
main {
contents {
from(project.layout.buildDirectory.dir("quarkus-app"))
if (quarkusFatJar) {
from(project.layout.buildDirectory) { include("polaris-quarkus-admin-*-runner.jar") }
Copy link
Contributor

@eric-maynard eric-maynard Jan 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why doesn't this go in /libs?

} else {
from(project.layout.buildDirectory.dir("quarkus-app"))
}
from("../../NOTICE")
from("../../LICENSE-BINARY-DIST").rename("LICENSE-BINARY-DIST", "LICENSE")
exclude("lib/main/io.quarkus.quarkus-container-image*")
}
}
}

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)
}
}
}
}
}
}
Loading