You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
550 B
16 lines
550 B
_template = """ |
|
load("@bazel_skylib//lib:versions.bzl", "versions") |
|
|
|
def check_bazel_version(): |
|
versions.check(minimum_bazel_version = "{version}") |
|
""".strip() |
|
|
|
def _impl(repository_ctx): |
|
repository_ctx.symlink(Label("@//:.bazelversion"), ".bazelversion") |
|
bazelversion = repository_ctx.read(".bazelversion").strip() |
|
|
|
repository_ctx.file("BUILD", executable = False) |
|
|
|
repository_ctx.file("check.bzl", executable = False, content = _template.format(version = bazelversion)) |
|
|
|
bazelisk_version = repository_rule(implementation = _impl)
|
|
|