A plugin for Gradle that adds tasks to download, extract and interact with GraalVM tooling.
Find a file
Daniel Mühlbachler 2a5dfceb69
Merge pull request #2 from cosminpolifronie/issue/239
Add automatic detection of Visual Studio installation
2020-03-17 09:20:22 +01:00
.baseline Excavator: Upgrades Baseline to the latest version (#235) 2019-11-19 19:58:02 +00:00
.circleci fix #239 - require JDK 8 and JDK 11 tests 2020-01-21 12:29:08 +01:00
.github Excavator: stale-bot closes PRs after 14 days of inactivity (#212) 2019-10-10 20:15:37 +00:00
gradle Excavator: Upgrades gradle wrapper to the latest version (#232) 2019-11-07 02:59:57 +00:00
src add automatic detection of Visual Studio installation 2020-02-27 22:45:16 +02:00
.bulldozer.yml Excavator: Render Bulldozer Bot config file (#173) 2019-09-19 14:52:43 +00:00
.changelog.yml Excavator: Render changelog-app config file (#203) 2019-10-02 23:15:51 +00:00
.excavator.yml Excavator: Auto-label some excavator PRs (#172) 2019-09-19 11:46:45 -04:00
.gitignore Create a basic wrapper around Graal and support the native-image task 2018-08-29 18:12:56 -07:00
.policy.yml Excavator: Update policy-bot config (#248) 2019-12-04 22:13:48 +00:00
build.gradle Excavator: Upgrades Baseline to the latest version (#254) 2019-12-09 15:56:51 +00:00
gradle.properties Apply GCV to fix publications (#191) 2019-09-19 15:46:40 +00:00
gradlew Excavator: Upgrades gradle wrapper to the latest version (#140) 2019-08-23 16:47:41 +00:00
gradlew.bat Excavator: Upgrades gradle wrapper to the latest version (#140) 2019-08-23 16:47:41 +00:00
LICENSE Create a basic wrapper around Graal and support the native-image task 2018-08-29 18:12:56 -07:00
README.md update readme.md for the new GraalVM 19.3+ support 2020-02-27 22:45:55 +02:00
settings.gradle Create a basic wrapper around Graal and support the native-image task 2018-08-29 18:12:56 -07:00
versions.lock Excavator: Upgrade dependencies (#245) 2019-12-02 22:13:16 +00:00
versions.props Excavator: Upgrade dependencies (#245) 2019-12-02 22:13:16 +00:00

Autorelease

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 to 20.0.0)
  • downloadBaseUrl: the base download URL to use (defaults to https://github.com/oracle/graal/releases/download/)
  • javaVersion: the Java version to use (can be either 8 or 11, defaults to 8)
    • 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)
      • vsVersion: the version of Visual Studio to use (can be either 2017 or 2019, by default a search will be performed and the newest will be selected)
      • vsEdition: the edition of Visual Studio to use (can be either Community, Professional or Enterprise, by default a search will be performed and the biggest will be selected)
      • vsVarsPath: path to vcvars64.bat (optional, if it's set it will disable the 2 searches for vsVersion and vsEdition)

native-image controls

  • outputName: the name to use for the image output
  • mainClass: the main class entry-point for the image to run
  • option: additional native-image options https://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.