@ -8,7 +8,14 @@ We will also demonstrate how to run an application locally with the same setting
## Gradle plugin
## Gradle plugin
`org.jetbrains.compose` Gradle plugin simplifies the packaging of applications into native distributions and running an application locally.
`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
## Basic usage
@ -36,6 +43,7 @@ compose.desktop {
mainClass = "example.MainKt"
mainClass = "example.MainKt"
nativeDistributions {
nativeDistributions {
modules("java.sql")
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
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` .
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
## Available formats
The following formats available for the supported operating systems:
The following formats available for the supported operating systems: