From 034c34dede2465b5eb1be2dd9bda5303a1560e45 Mon Sep 17 00:00:00 2001 From: badmannersteam Date: Wed, 17 Jan 2024 17:35:45 +0100 Subject: [PATCH] Option to pack jars as uber JAR. Docs --- .../README.md | 31 +++++++++++++------ 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/tutorials/Native_distributions_and_local_execution/README.md b/tutorials/Native_distributions_and_local_execution/README.md index c822be3286..ffc91c4904 100755 --- a/tutorials/Native_distributions_and_local_execution/README.md +++ b/tutorials/Native_distributions_and_local_execution/README.md @@ -596,15 +596,16 @@ that is developed by [Guardsquare](https://www.guardsquare.com/). The Gradle plugin provides a *release* task for each corresponding *default* packaging task: -Default task (w/o ProGuard)| Release task (w. ProGuard) |Description ----------------------------|----------------------------------|----------- -`createDistributable` | `createReleaseDistributable` |Creates an application image with bundled JDK & resources -`runDistributable` | `runReleaseDistributable` |Runs an application image with bundled JDK & resources -`run` | `runRelease` |Runs a non-packaged application `jar` using Gradle JDK -`package` | `packageRelease` |Packages an application image into a `` file -`packageForCurrentOS` | `packageReleaseForCurrentOS` |Packages an application image into a format compatible with current OS -`notarize` | `notarizeRelease` |Uploads a `` application image for notarization (macOS only) -`checkNotarizationStatus` | `checkReleaseNotarizationStatus` |Checks if notarization succeeded (macOS only) + Default task (w/o ProGuard) | Release task (w. ProGuard) | Description +-----------------------------------|------------------------------------------|-------------------------------------------------------------------------- + `createDistributable` | `createReleaseDistributable` | Creates an application image with bundled JDK & resources + `runDistributable` | `runReleaseDistributable` | Runs an application image with bundled JDK & resources + `run` | `runRelease` | Runs a non-packaged application `jar` using Gradle JDK + `package` | `packageRelease` | Packages an application image into a `` file + `packageDistributionForCurrentOS` | `packageReleaseDistributionForCurrentOS` | Packages an application image into a format compatible with current OS + `packageUberJarForCurrentOS` | `packageReleaseUberJarForCurrentOS` | Packages an application image into an uber (fat) JAR + `notarize` | `notarizeRelease` | Uploads a `` application image for notarization (macOS only) + `checkNotarizationStatus` | `checkReleaseNotarizationStatus` | Checks if notarization succeeded (macOS only) The default configuration adds a few ProGuard rules: * an application image is minified, i.e. non-used classes are removed; @@ -650,3 +651,15 @@ compose.desktop { } } ``` + +Joining to the uber JAR is disabled by default - ProGuard produces the corresponding JAR for every input JAR. +To enable it, set the following property via Gradle DSL: +``` +compose.desktop { + application { + buildTypes.release.proguard { + joinOutputJars.set(true) + } + } +} +```