Skip to content

Commit bc98dd0

Browse files
committed
Add more details to Readme
1 parent 9e15d17 commit bc98dd0

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ Or, for convenience, let the plugin pick the target fitting the machine you run
105105

106106
There are some additional configuration options that can be used if needed.
107107
All options have a default. Only configure what you need in addition.
108+
For more information about the available options, consult the
109+
[jpackage](https://docs.oracle.com/en/java/javase/24/docs/specs/man/jpackage.html) and
110+
[jlink](https://docs.oracle.com/en/java/javase/24/docs/specs/man/jlink.html)
111+
(for `jlinkOptions`) documentation.
108112

109113
```kotlin
110114
javaModulePackaging {
@@ -219,6 +223,46 @@ To avoid re-compilation of the Java code on each of the runners, you can run a
219223
The [java-module-system](https://github.com/jjohannes/java-module-system) project is an example that
220224
uses GitHub actions with a Gradle remote build cache.
221225

226+
## FAQ
227+
228+
### How does the plugin interact with the `jpackage` command?
229+
230+
By default, dhe plugin calls `jpackage` in two steps:
231+
232+
1. Build `--type app-image` as a package-type independent image folder. This is where `jlink` is involved.
233+
2. Build OS-specific packages via `--type <package-type>`.
234+
This may be called several times for the same target (e.g. `exe` and `msi` on Windows).
235+
236+
OS-independent options can be configured through the extension:
237+
238+
```kotlin
239+
javaModulePackaging {
240+
applicationName = "app" // defaults to project name
241+
applicationVersion = "1.0" // defaults to project version
242+
applicationDescription = "Awesome App"
243+
vendor = "My Company"
244+
copyright = "(c) My Company"
245+
jlinkOptions.addAll("--no-header-files", "--no-man-pages", "--bind-services")
246+
addModules.addAll("additional.module.to.include")
247+
verbose = false
248+
}
249+
```
250+
251+
OS-specific options can be defined inside a target:
252+
253+
```kotlin
254+
javaModulePackaging {
255+
target("windows2020") { // address target by name
256+
options.addAll("--win-dir-chooser", "--win-shortcut", "--win-menu")
257+
}
258+
targetsWithOs("windows") { // all targets of for a certain os
259+
// ...
260+
}
261+
}
262+
```
263+
264+
You can tell the plugin to perform packaging in one step by setting the `singleStepPackaging = true` option on a target.
265+
222266
# Disclaimer
223267

224268
Gradle and the Gradle logo are trademarks of Gradle, Inc.

0 commit comments

Comments
 (0)