Browse Source

Updates Native Distributions documentation

Updates Native Distributions documentation to include a note about Java Modules, and how to determine necessary modules and provide them to the Gradle plugin configuration
pull/501/head
Casey Brooks 4 years ago committed by Alexey Tsvetkov
parent
commit
1e42748fd1
  1. 15
      tutorials/Native_distributions_and_local_execution/README.md

15
tutorials/Native_distributions_and_local_execution/README.md

@ -8,7 +8,14 @@ We will also demonstrate how to run an application locally with the same setting
## Gradle plugin
`org.jetbrains.compose` Gradle plugin simplifies the packaging of applications into native distributions and running an application locally.
Currently, the plugin uses [jpackage](https://openjdk.java.net/jeps/343) for packaging self-contained applications.
Currently, the plugin uses [jpackage](https://openjdk.java.net/jeps/343) for packaging distributable applications.
Distributable applications are self-contained, installable binaries which include all the Java runtime components they need,
without requiring an installed JDK on the target system.
[Jlink](https://openjdk.java.net/jeps/282) will take care of bundling only the necessary Java Modules in
the distributable package to minimize package size,
but you must still configure the Gradle plugin to tell it which modules you need.
## Basic usage
@ -36,6 +43,7 @@ compose.desktop {
mainClass = "example.MainKt"
nativeDistributions {
modules("java.sql")
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
}
}
@ -64,6 +72,11 @@ Note, that the tasks are created only if the `application` block/property is use
After a build, output binaries can be found in `${project.buildDir}/compose/binaries`.
At this time, the Gradle plugin does not automatically determine the JDK Modules necessary to run, and you must manually
determine the specific modules you need and include them in `modules()`. Failure to provide the necessary modules
will not cause compilation issues, but will lead to `ClassNotFoundException` at runtime. See issue #463 for more context
and how to determine the modules you need to include.
## Available formats
The following formats available for the supported operating systems:

Loading…
Cancel
Save