Skip to content

Commit

Permalink
fix: add bindist alias for legacy rules
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Gammon <sam@elide.ventures>
  • Loading branch information
sgammon committed Aug 26, 2023
1 parent e60d900 commit 19d6c52
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 22 deletions.
21 changes: 2 additions & 19 deletions example/integration_tests/legacy-rules/WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,17 @@ local_repository(
path = "../../..",
)

# http_archive(
# name = "rules_graal",
# sha256 = "5626b5161aa0c2fa358dc9f7daa6c1a86931003dfce79ed1068143b3f9101c01",
# strip_prefix = "rules_graal-45252cc66a85c25c1729d69e7f4751f7af7ac049",
# urls = [
# "https://github.com/andyscott/rules_graal/archive/45252cc66a85c25c1729d69e7f4751f7af7ac049.zip",
# ],
# )

# load("@rules_graal//graal:graal_bindist.bzl", "graal_bindist_repository")

# graal_bindist_repository(
# name = "graal",
# java_version = "11",
# version = "22.1.0",
# )

load("@rules_graalvm//graalvm:workspace.bzl", "register_graalvm_toolchains", "rules_graalvm_repositories")

rules_graalvm_repositories()

register_graalvm_toolchains()

load("@rules_graalvm//graalvm:repositories.bzl", "graalvm_repository")
load("@rules_graalvm//graal:graal_bindist.bzl", "graal_bindist_repository")

rules_graalvm_repositories()

graalvm_repository(
graal_bindist_repository(
name = "graalvm",
java_version = "11",
version = "22.1.0",
Expand Down
4 changes: 2 additions & 2 deletions example/legacy/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ load(
)
load(
"@rules_graalvm//graal:graal.bzl",
"native_image",
"graal_binary",
)

package(default_visibility = [
Expand All @@ -25,7 +25,7 @@ java_binary(
],
)

native_image(
graal_binary(
name = "main-native",
main_class = "Main",
deps = [":java"],
Expand Down
9 changes: 9 additions & 0 deletions graal/graal_bindist.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"Legacy repository rule alias."

load(
"//internal:graalvm_bindist.bzl",
_graalvm_repository = "graalvm_repository",
)

## Exports
graal_bindist_repository = _graalvm_repository
2 changes: 1 addition & 1 deletion internal/graalvm_bindist.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def _graal_bindist_repository_impl(ctx):
java_version = ctx.attr.java_version

# new gvm distribution check
_check_version(ctx.attr.version, ctx.attr.java_version, True)
_check_version(version, java_version, True)
ctx.report_progress("Downloading GraalVM")

dist_names = {
Expand Down

0 comments on commit 19d6c52

Please sign in to comment.