diff --git a/terra/build.gradle.kts b/terra/build.gradle.kts index 947d328..cf0e504 100644 --- a/terra/build.gradle.kts +++ b/terra/build.gradle.kts @@ -6,6 +6,7 @@ plugins { id("dev.jacksonbailey.wheel.shut-up-javadoc") id("io.freefair.lombok") version "8.6" id("io.spring.dependency-management") version "1.1.5" + id("org.panteleyev.jpackageplugin") version "1.6.0" id("org.springframework.boot") version "3.3.0" } @@ -43,3 +44,37 @@ tasks.getByName("bootJar") { // TODO Does this mess up publishing somehow? this.archiveFileName.set("${archiveBaseName.get()}.${archiveExtension.get()}") } + +// TODO Is there a way to get the "into" of a copy task programmatically? +val jpackageInputDirectory = "${layout.buildDirectory.asFile.get().path}/jpackage/input" + +val copyBootJar = task("copyBootJar", Copy::class) { + // TODO Is dependsOn needed when from is a task? + dependsOn(tasks.bootJar) + from(tasks.bootJar).into(jpackageInputDirectory) +} + +/* + * This works! When the DMG is installed and ran, it works. It does not show any console and the + * icon on the taskbar just jumps non-stop, but this works! I will look into it more later. + */ +tasks.jpackage { + // Only *really* needs to depend on copyBootJar, but it feels odd to not build everything + dependsOn(copyBootJar, tasks.build) + + input = jpackageInputDirectory + destination = "${layout.buildDirectory.asFile.get().path}/distributions" + + mainJar = tasks.bootJar.get().archiveFileName.get() + // Remember, the *real* main class in the boot jar is the JarLauncher + mainClass = "org.springframework.boot.loader.launch.JarLauncher" + + arguments = listOf("--spring.profiles.active=live") + + mac { + // For Bundler Mac DMG Package, valid versions are one to three integers separated by dots. + // The first number in an app-version cannot be zero or negative. The default for this would + // be the project's version. Therefore, 0.1.0-SNAPSHOT will not work, so I just set it to 1. + appVersion = "1" + } +} diff --git a/terra/lessons-learned.md b/terra/lessons-learned.md index 436322c..07dad54 100644 --- a/terra/lessons-learned.md +++ b/terra/lessons-learned.md @@ -102,3 +102,11 @@ public JDABuilder jdaBuilder(ObjectProvider listenerProvider) { return builder; } ``` + +## Semantic Line Breaks + +I installed the Grazie Pro plugin. (Very confusingly named, it has a few features even without a +subscription.) It suggests "structural line breaks" and points to +[Semantic Line Breaks](https://sembr.org/). It's interesting. It suggests wrapping text lines in +things like Markdown at the end of sentences/clauses/thoughts. I'll consider it but will likely +pass.