Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Bazel rules to make JVM binaries into native binaries

License

Notifications You must be signed in to change notification settings

adam-singer/rules_graal

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Turn a JVM binary into a native binary.

Usage

You'll need to first load the rules in your WORKSPACE file.

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "rules_graal",
    sha256 = "<zip file sha256sum>",
    strip_prefix = "rules_graal-master",
    urls = [
        "https://github.com/andyscott/rules_graal/archive/<git commit sha>.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:

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",
)

About

Bazel rules to make JVM binaries into native binaries

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Starlark 83.1%
  • Shell 16.4%
  • Java 0.5%