56 lines
1.4 KiB
Kotlin
56 lines
1.4 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")
|
|
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"
|
|
}
|
|
|
|
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.
|