63 lines
1.8 KiB
Kotlin
63 lines
1.8 KiB
Kotlin
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
|
|
|
plugins {
|
|
java
|
|
application
|
|
id("com.gradleup.shadow") version "9.5.1"
|
|
id("io.freefair.lombok") version "9.5.0"
|
|
}
|
|
|
|
group = "io.icybear.redapricot"
|
|
version = "0.1.0"
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
|
|
dependencies {
|
|
implementation("io.vertx:vertx-core:5.1.5")
|
|
implementation("org.apache.logging.log4j:log4j-core:2.26.0")
|
|
implementation("org.apache.logging.log4j:log4j-jul:2.26.0") // route Netty/JUL fallback -> log4j2
|
|
testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
|
|
testRuntimeOnly("org.junit.platform:junit-platform-launcher:1.10.2")
|
|
}
|
|
|
|
java {
|
|
toolchain {
|
|
languageVersion = JavaLanguageVersion.of(21)
|
|
}
|
|
}
|
|
|
|
application {
|
|
mainClass = "io.icybear.redapricot.Main"
|
|
// Route java.util.logging (Netty's fallback) through Log4j2 on the `run`/`installDist`
|
|
// launch paths. The `java -jar` shadow-jar path sets this programmatically in Main.
|
|
applicationDefaultJvmArgs = listOf(
|
|
"-Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager"
|
|
)
|
|
}
|
|
|
|
tasks.test {
|
|
useJUnitPlatform()
|
|
}
|
|
|
|
// Fat "shadow" jar: build/libs/redapricot-server-<version>-all.jar
|
|
// java -jar build/libs/redapricot-server-0.1.0-all.jar <config.json>
|
|
// mergeServiceFiles() is required so Vert.x/Netty SPI (META-INF/services/*)
|
|
// survives the relocation into a single jar.
|
|
tasks.named<ShadowJar>("shadowJar") {
|
|
archiveClassifier.set("all")
|
|
mergeServiceFiles()
|
|
manifest {
|
|
attributes["Main-Class"] = "io.icybear.redapricot.Main"
|
|
}
|
|
}
|
|
|
|
// Build the shadow jar as part of the default `build`/`assemble` lifecycle.
|
|
tasks.named("assemble") {
|
|
dependsOn("shadowJar")
|
|
}
|
|
|
|
// Make `installDist` output predictable for the e2e harness: it produces
|
|
// build/install/redapricot-server/lib/*.jar + a start script.
|