jpackage-gradle-plugin

Форк
0

README.md

JPackage Gradle Plugin

Gradle plugin for jpackage tool available since JDK-14.

Gradle Plugin Portal Gradle Java GitHub

Finding jpackage

Plugin searches for jpackage executable using the following priority list:

  1. Configured toolchain

  2. java.home system property.

Configuration

There are generic jpackage parameters as well as OS-specific parameters for OS X, Linux, Windows. OS-specific parameters are processed when build is done on the corresponding OS.

If some generic parameters should have different values based on OS then they should be placed into configuration blocks:

  • windows
  • mac
  • linux

Example:

// Windows specific parameters will be processed only during Windows build
winMenu = true
winDirChooser = true
mac {
// Generic parameter value for OS X build
icon = "icons/icons.icns"
}
windows {
// Generic parameter value for Windows build
icon = "icons/icons.ico"
}

Parameters

ParameterTypeJPackage ArgumentMin VersionMax Version
Generic
aboutUrlString--about-url <url>17*
addModulesList<String>--add-modules <module>[,<module>]14*
appDescriptionString--description <description string>14*
appContentList<String> (*)--app-content additional-content[,additional-content...]18*
appImageString (*)--app-image <name>14*
appNameString--name <name>14*
appVersionString--app-version <version>14*
argumentsList<String>--arguments <main class arguments>14*
bindServicesBoolean--bind-services1415
copyrightString--copyright <copyright string>14*
destinationString (*)--dest <destination path>14*
fileAssociationsList<String> (*)--file-associations <file association property file>14*
iconString (*)--icon <icon file path>14*
inputString (*)--input <input path>14*
installDirString--install-dir <file path>14*
javaOptionsList<String>--java-options <options>14*
jLinkOptionsList<String>--jlink-options <options>16*
launchersList<Launcher> (*)--add-launcher <name>=<property file>14*
launcherAsServiceBoolean--launcher-as-service19*
licenseFileString (*)--license-file <license file path>14*
mainClassString--main-class <class name>14*
mainJarString--main-jar <main jar file>14*
moduleString--module <module name>[/<main class>]14*
modulePathsList<String> (*)--module-path <module path>14*
resourceDirString (*)--resource-dir <resource dir path>14*
runtimeImageString (*)--runtime-image <file path>14*
tempString (*)--temp <temp dir path>14*
typeImageType--type <type>14*
vendorString--vendor <vendor string>14*
verboseBoolean--verbose14*
Windows
winConsoleBoolean--win-console14*
winDirChooserBoolean--win-dir-chooser14*
winHelpUrlString--win-help-url <url>17*
winMenuBoolean--win-menu14*
winMenuGroupString--win-menu-group <menu group name>14*
winPerUserInstallBoolean--win-per-user-install14*
winShortcutBoolean--win-shortcut14*
winShortcutPromptBoolean--win-shortcut-prompt17*
winUpdateUrlString--win-update-url <url>17*
winUpgradeUuidString--win-upgrade-uuid <id string>14*
OS X
macAppCategoryString-mac-app-category <category string>17*
macAppStoreBoolean--mac-app-store17*
macBundleSigningPrefixString--mac-bundle-signing-prefix <prefix string>1416
macDmgContentList<String> (*)--mac-dmg-content additional-content[,additional-content...]18*
macEntitlementsString (*)--mac-entitlements <file path>17*
macPackageIdentifierString--mac-package-identifier <ID string>14*
macPackageNameString--mac-package-name <name string>14*
macPackageSigningPrefixString--mac-package-signing-prefix <prefix string>17*
macSignBoolean--mac-sign14*
macSigningKeychainString (*)--mac-signing-keychain <file path>14*
macSigningKeyUserNameString--mac-signing-key-user-name <team name>14*
Linux
linuxAppCategoryString--linux-app-category <category value>14*
linuxAppReleaseString--linux-app-release <release value>14*
linuxDebMaintainerString--linux-deb-maintainer <email address>14*
linuxMenuGroupString--linux-menu-group <menu-group-name>14*
linuxPackageNameString--linux-package-name <package name>14*
linuxPackageDepsBoolean--linux-package-deps14*
linuxRpmLicenseTypeString--linux-rpm-license-type <type string>14*
linuxShortcutBoolean--linux-shortcut14*

(*) - these parameters represent file or directory path and are resolved relative to the project root unless they contain an absolute path.

Image Type

Plugin ValueJPackage Type
DEFAULTDefault image type, OS specific
APP_IMAGEapp-image
DMGdmg
PKGpkg
EXEexe
MSImsi
RPMrpm
DEBdeb

Default Command-Line Arguments

Default command line arguments are passed to the main class when the application is started without providing arguments.

Example:

arguments = listOf(
"SomeArgument",
"Argument with spaces",
"Argument with \"quotes\""
)

JVM Options

Options that are passed to the JVM when the application is started.

Example:

javaOptions = listOf(
"-Xms2m",
"-Xmx10m"
)

Options that are passed to underlying jlink call.

Example:

jLinkOptions = listOf(
"--strip-native-commands",
"--strip-debug"
)

jpackage Environment Variables

Optionally environment variables can be passed to jpackage executable process.

Example:

jpackageEnvironment = mapOf(
"GRADLE_DIR" to project.projectDir.absolutePath,
"BUILD_DIR" to project.buildDir.absolutePath
)

null values as well as null or empty keys are ignored.

Logging

Plugin uses LogLevel.INFO to print various information about toolchain, jpackage parameters, etc. Use gradle option --info to check this output.

Dry Run Mode

To execute plugin tasks in dry run mode without calling jpackage set propertyjpackage.dryRun to true.

Example:

$ ./gradlew clean build jpackage --info -Djpackage.dryRun=true

Configuration Cache

This plugin is not compatible with Gradle configuration cache.

Examples

References

Packaging Tool User's Guide

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.