Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andyscott/rules_graal
Bazel rules to make JVM binaries into native binaries
https://github.com/andyscott/rules_graal
Last synced: about 1 month ago
JSON representation
Bazel rules to make JVM binaries into native binaries
- Host: GitHub
- URL: https://github.com/andyscott/rules_graal
- Owner: andyscott
- License: apache-2.0
- Created: 2019-04-26T03:52:27.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-12-19T22:45:46.000Z (about 1 year ago)
- Last Synced: 2024-10-12T16:29:22.255Z (3 months ago)
- Language: Starlark
- Homepage:
- Size: 41 KB
- Stars: 43
- Watchers: 6
- Forks: 17
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
# rules_graal
> [!WARNING]
> This repository covers GraalVM releases up to the recent distribution change with Oracle GraalVM / GraalVM CE, and Bazel up to Bazel 6. If you need newer releases, try [`rules_graalvm`](https://github.com/sgammon/rules_graalvm).Turn a JVM binary into a native binary.
## Usage
You'll need to first load the rules in your WORKSPACE file.
``` python
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")http_archive(
name = "rules_graal",
sha256 = "",
strip_prefix = "rules_graal-master",
urls = [
"https://github.com/andyscott/rules_graal/archive/.zip",
],
)load("@rules_graal//graal:graal_bindist.bzl", "graal_bindist_repository")
graal_bindist_repository(
name = "graal",
java_version = "11", # 17 is also a valid option. 8 is an option in earlier versions.
version = "21.3.0",
)
```Then, in a build file:
```python
load("@rules_graal//graal:graal.bzl", "graal_binary")
load("@rules_java//java:defs.bzl", "java_library")java_library(
name = "main",
srcs = glob(["Main.java"]),
)graal_binary(
name = "main-native",
deps = [":main"],
main_class = "Main",
)
```