* fix #239 - add property javaVersion to support GraalVM 19.3+ * fix download / tests that use the new Java version cache subdir * fix #239 - use VS 2019 for Java 11+ and add Java 11 E2E tests * fix #239 - add options to specify VS path * fix #239 - require JDK 8 and JDK 11 tests * add automatic detection of Visual Studio installation * update readme.md for the new GraalVM 19.3+ support * fix #239 - autodetect vs path and throw exception * fix #239 - detect vs vars path but fail when needed * fix #239 - rename VS and Windows related variables and method to contain windows for clarity * format * changelog Co-authored-by: David Kirstein <dak@batix.com> Co-authored-by: Cosmin Polifronie <cosmin.polifronie@gmail.com> Co-authored-by: Carter Kozak <ckozak@ckozak.net>
3.3 KiB
gradle-graal
A simple wrapper around GraalVM tooling that will download and locally cache a GraalVM installation and make available select parts of the GraalVM compiler for use in Gradle builds.
To use this plugin, apply com.palantir.graal
. See a full example in the
ETE tests.
Gradle Tasks
./gradlew nativeImage
: create a native image using GraalVM's native-image
tool with the configuration as specified
by the graal
Gradle extension. Outputs are produced to ${projectDir}/build/graal/
.
./gradlew sharedLibary
: create a shared library using GraalVM's native-image
tool with the configuration as specified
by the graal
Gradle extension. Outputs are produced to ${projectDir}/build/graal/
.
Configuration
Configure this plugin and its wrappers around GraalVM tools through the graal
extension with the following options:
General GraalVM controls
graalVersion
: the version string to use when downloading GraalVM (defaults to20.0.0
)downloadBaseUrl
: the base download URL to use (defaults tohttps://github.com/oracle/graal/releases/download/
)javaVersion
: the Java version to use (can be either8
or11
, defaults to8
)- for
8
: Windows SDK 7.1 will be used (C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd
) - for
11
: Visual Studio Build Tools will be used (C:\Program Files (x86)\Microsoft Visual Studio\{version}\\{edition}\\VC\\Auxiliary\\Build\\vcvars64.bat
)windowsVsVersion
: the version of Visual Studio to use (can be either2017
or2019
, by default a search will be performed and the newest will be selected)windowsVsEdition
: the edition of Visual Studio to use (can be eitherCommunity
,Professional
orEnterprise
, by default a search will be performed and the biggest will be selected)windowsVsVarsPath
: path to vcvars64.bat (optional, if it's set it will disable the 2 searches forvsVersion
andvsEdition
)
- for
native-image
controls
outputName
: the name to use for the image outputmainClass
: the main class entry-point for the image to runoption
: additional native-image optionshttps://github.com/oracle/graal/blob/master/substratevm/OPTIONS.md
Local GraalVM Tooling Cache
We maintain a number of different repositories, and rather than re-download tooling and cache it per repository, this
plugin maintains a central cache in the user's home directory (~/.gradle/caches/com.palantir.graal
). Tooling artifacts
are cached by version, so multiple projects referring to different GraalVM versions will not corrupt the cache.
No locking is performed to check the atomicity of changes to the cache, so users should not expect this plugin to be well behaved when populating the cache from parallel processes.
Contributions
Contributions are welcome. For larger feature requests or contributions, we prefer discussing the proposed change on a GitHub issue prior to a PR.
License
This plugin is made available under the Apache 2.0 License.