diff options
author | Joshua Haberman <jhaberman@gmail.com> | 2019-05-13 10:07:06 -0700 |
---|---|---|
committer | Joshua Haberman <jhaberman@gmail.com> | 2019-05-13 10:07:06 -0700 |
commit | 0fea70b4d9e6c0fd95420893607f462c7308e490 (patch) | |
tree | 611b4a6c86f736642be314f09afd3d114d371206 /repository_defs.bzl | |
parent | cbe051a09c19f868b7682477755011ec681ce6cb (diff) |
Works with Bazel 0.24.1 and Bazel 0.25.2!
Diffstat (limited to 'repository_defs.bzl')
-rw-r--r-- | repository_defs.bzl | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/repository_defs.bzl b/repository_defs.bzl new file mode 100644 index 0000000..5bbc9cb --- /dev/null +++ b/repository_defs.bzl @@ -0,0 +1,16 @@ + +# A hacky way to work around the fact that native.bazel_version is only +# available from WORKSPACE macros, not BUILD macros or rules. +# +# Hopefully we can remove this if/when this is fixed: +# https://github.com/bazelbuild/bazel/issues/8305 + +def _impl(repository_ctx): + s = "bazel_version = \"" + native.bazel_version + "\"" + repository_ctx.file("bazel_version.bzl", s) + repository_ctx.file("BUILD", "") + +bazel_version_repository = repository_rule( + implementation=_impl, + local=True, +) |