jlink-gradle-plugin

0
месяц назад
месяц назад
10 месяцев назад
10 месяцев назад
10 месяцев назад
10 месяцев назад
README.md

JLink Gradle Plugin

Gradle plugin for jlink.

License Gradle Plugin Portal Gradle JDK

Plugin searches for

jlink
executable using the following priority list:

  1. Configured toolchain

  2. java.home
    system property.

Though rarely required it is possible to override toolchain for particular

jlink
task:

Configuration

Parameters

ParameterTypejlink argument
addModulesListProperty<String>--add-modules
bindServicesProperty<Boolean>--bind-services
endianProperty<Endian>--endian
generateCdsArchiveProperty<Boolean>--generate-cds-archive
ignoreSigningInformationProperty<Boolean>--ignore-signing-information
includeLocalesListProperty<String>--include-locales
limitModulesListProperty<String>--limit-modules
modulePathsConfigurableFileCollection--module-path
noHeaderFilesProperty<Boolean>--no-header-files
noManPagesProperty<Boolean>--no-man-pages
outputDirectoryProperty--output
stripDebugProperty<Boolean>--strip-debug
verboseProperty<Boolean>--verbose

Endian

Plugin Valuejlink Value
LITTLElittle
BIGbig

Output Directory

jlink
utility fails if output directory already exists. At the same time gradle always creates plugin output directory.

In order to work around this behaviour plugin always tries to delete directory specified by

output
before launching
jlink
.

For safety reasons

output
must point to the location inside
${layout.buildDirectory}
.

Logging

Plugin uses

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

Dry Run Mode

To execute plugin tasks in dry run mode without calling

jlink
set property
jlink.dryRun
to true.

Example:

Configuration Cache

This plugin should be compatible with Gradle configuration cache.

Configuration Example

References

The jlink Command