aboutsummaryrefslogtreecommitdiff
path: root/protobuf.bzl
diff options
context:
space:
mode:
authorFahrzin Hemmati <fahhem@users.noreply.github.com>2017-11-28 14:24:53 -0800
committerFahrzin Hemmati <fahhem@appliedintuition.com>2017-12-04 15:12:08 -0800
commit35119e39a07f426f3c48a1bfb41d862994223742 (patch)
tree88a83f067a1de2ba58ff7543801a50fd959d2ef1 /protobuf.bzl
parent6de51caed52d798815954646b230c5aef3e4d2fc (diff)
downloadprotobuf-35119e39a07f426f3c48a1bfb41d862994223742.tar.gz
protobuf-35119e39a07f426f3c48a1bfb41d862994223742.tar.bz2
protobuf-35119e39a07f426f3c48a1bfb41d862994223742.zip
Add a check_protobuf_required_bazel_version() for use in WORKSPACEs
Diffstat (limited to 'protobuf.bzl')
-rw-r--r--protobuf.bzl12
1 files changed, 12 insertions, 0 deletions
diff --git a/protobuf.bzl b/protobuf.bzl
index 23380bab..6aed44a4 100644
--- a/protobuf.bzl
+++ b/protobuf.bzl
@@ -400,3 +400,15 @@ def internal_protobuf_py_tests(
srcs=[s],
main=s,
**kargs)
+
+
+def check_protobuf_required_bazel_version():
+ """For WORKSPACE files, to check the installed version of bazel.
+
+ This ensures bazel supports our approach to proto_library() depending on a
+ copied filegroup. (Fixed in bazel 0.5.4)
+ """
+ expected = apple_common.dotted_version("0.5.4")
+ current = apple_common.dotted_version(native.bazel_version)
+ if current.compare_to(expected) < 0:
+ fail("Bazel must be newer than 0.5.4")