summaryrefslogtreecommitdiff
path: root/repository_defs.bzl
diff options
context:
space:
mode:
authorJoshua Haberman <jhaberman@gmail.com>2019-05-13 12:27:59 -0500
committerGitHub <noreply@github.com>2019-05-13 12:27:59 -0500
commit04350e1d1b7ff5457b1a36150d98d5a5efc0ed89 (patch)
tree875acb49ee5507ea9ad2bcc5146fb3c7c7d31eac /repository_defs.bzl
parentb08819749e6c2a6d8d771f954f6162933a8ba648 (diff)
parentf0605283962ca61f35587d542c4cd684548168bd (diff)
Merge pull request #166 from haberman/bazel25
Compatibility with Bazel 0.25.2 and 0.24.1.
Diffstat (limited to 'repository_defs.bzl')
-rw-r--r--repository_defs.bzl16
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,
+)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback