2023-09-03 23:15:21 -07:00
|
|
|
plugins {
|
|
|
|
application
|
2023-09-04 21:50:27 -07:00
|
|
|
id("gay.pizza.pork.module")
|
2023-09-03 23:15:21 -07:00
|
|
|
id("com.github.johnrengelman.shadow") version "8.1.1"
|
|
|
|
id("org.graalvm.buildtools.native") version "0.9.25"
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2023-09-11 02:34:28 -04:00
|
|
|
api(project(":minimal"))
|
2023-09-06 19:07:28 -07:00
|
|
|
api("com.github.ajalt.clikt:clikt:4.2.0")
|
2023-09-03 23:15:21 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
application {
|
2023-09-04 21:50:27 -07:00
|
|
|
applicationName = "pork"
|
2023-09-04 01:56:24 -07:00
|
|
|
mainClass.set("gay.pizza.pork.tool.MainKt")
|
2023-09-18 01:07:28 -07:00
|
|
|
applicationDefaultJvmArgs += "-XstartOnFirstThread"
|
2023-09-23 15:40:40 -07:00
|
|
|
applicationDefaultJvmArgs += "--enable-native-access=ALL-UNNAMED"
|
2023-09-03 23:15:21 -07:00
|
|
|
}
|
|
|
|
|
2023-09-04 21:50:27 -07:00
|
|
|
for (task in arrayOf(tasks.shadowDistTar, tasks.shadowDistZip, tasks.shadowJar)) {
|
|
|
|
val suffix = when {
|
|
|
|
task == tasks.shadowJar -> ""
|
|
|
|
task.name.startsWith("shadow") -> "-shadow"
|
|
|
|
else -> ""
|
|
|
|
}
|
|
|
|
task.get().archiveBaseName.set("pork${suffix}")
|
|
|
|
}
|
|
|
|
|
2023-09-03 23:15:21 -07:00
|
|
|
graalvmNative {
|
|
|
|
binaries {
|
|
|
|
named("main") {
|
|
|
|
imageName.set("pork")
|
2023-09-04 01:56:24 -07:00
|
|
|
mainClass.set("gay.pizza.pork.tool.MainKt")
|
2023-09-03 23:15:21 -07:00
|
|
|
sharedLibrary.set(false)
|
2023-09-04 22:33:38 -07:00
|
|
|
buildArgs("-march=compatibility")
|
2023-09-07 18:16:47 -07:00
|
|
|
resources {
|
|
|
|
includedPatterns.addAll(listOf(
|
|
|
|
".*/*.pork$",
|
|
|
|
".*/*.manifest$"
|
|
|
|
))
|
|
|
|
}
|
2023-09-03 23:15:21 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.run.get().outputs.upToDateWhen { false }
|