setup docker build
This commit is contained in:
@@ -1,12 +1,16 @@
|
||||
import eu.jonahbauer.chat.build.jlink.JLinkTask
|
||||
|
||||
plugins {
|
||||
id("chat-bot.java-conventions")
|
||||
application
|
||||
}
|
||||
|
||||
group = "eu.jonahbauer.chat"
|
||||
version = "0.1.0-SNAPSHOT"
|
||||
|
||||
val bots = project(":bots").subprojects
|
||||
val bot : Configuration by configurations.creating
|
||||
configurations.runtimeOnly {
|
||||
extendsFrom(bot)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(project(":bot-api"))
|
||||
@@ -16,13 +20,27 @@ dependencies {
|
||||
|
||||
runtimeOnly(libs.logback)
|
||||
|
||||
bots.forEach {
|
||||
implementation(project(it.path))
|
||||
project.project(":bots").subprojects.forEach {
|
||||
bot(project(it.path))
|
||||
}
|
||||
}
|
||||
|
||||
application {
|
||||
mainClass.set("eu.jonahbauer.chat.server.Main")
|
||||
mainModule.set("eu.jonahbauer.chat.server")
|
||||
applicationDefaultJvmArgs = listOf("--enable-preview")
|
||||
}
|
||||
tasks.named<JavaCompile>("compileJava") {
|
||||
options.javaModuleMainClass = "eu.jonahbauer.chat.server.Main"
|
||||
}
|
||||
|
||||
tasks.register<JLinkTask>("jlink") {
|
||||
modules = listOf("ALL-MODULE-PATH", "jdk.crypto.ec")
|
||||
options = listOf("--no-header-files", "--no-man-pages", "--strip-debug", "--compress=zip-6")
|
||||
}
|
||||
|
||||
tasks.register<Exec>("run") {
|
||||
group = "application"
|
||||
description = "runs the application using the custom runtime image"
|
||||
|
||||
executable = project.layout.buildDirectory.file("dist/jre/bin/java").get().asFile.path
|
||||
args("--enable-preview", "-m", "eu.jonahbauer.chat.server")
|
||||
|
||||
dependsOn(tasks.named<JLinkTask>("jlink"))
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user