From 5611ff267b7f11615516fd6efe8373b730999a0d Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Thu, 16 May 2019 11:35:00 -0700 Subject: Moved bazel files to bazel/ directory. --- bazel/repository_defs.bzl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 bazel/repository_defs.bzl (limited to 'bazel/repository_defs.bzl') diff --git a/bazel/repository_defs.bzl b/bazel/repository_defs.bzl new file mode 100644 index 0000000..7b6e78e --- /dev/null +++ b/bazel/repository_defs.bzl @@ -0,0 +1,15 @@ +# 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, +) -- cgit v1.2.3