From fc5890c17a85547bc1ba7d08798a632c52ddf9c5 Mon Sep 17 00:00:00 2001 From: Derek Mauro Date: Tue, 9 Jul 2024 12:29:31 -0400 Subject: [PATCH] Add support for Bzlmod --- .gitignore | 1 + MODULE.bazel | 37 +++++++++++++++++++++++++++++++++++++ WORKSPACE | 17 ++++++++--------- 3 files changed, 46 insertions(+), 9 deletions(-) create mode 100644 MODULE.bazel diff --git a/.gitignore b/.gitignore index 96d1e749..d1b6d112 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ # ignore all files in the bazel directories /bazel-* +MODULE.bazel.lock # ignore non-bazel build products /build diff --git a/MODULE.bazel b/MODULE.bazel new file mode 100644 index 00000000..992e04c1 --- /dev/null +++ b/MODULE.bazel @@ -0,0 +1,37 @@ +# Copyright 2024 Google Inc. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# https://bazel.build/external/overview#bzlmod + +module( + name = "cctz", + version = "head", + compatibility_level = 1, +) + +# Only direct dependencies need to be listed below. +# Please keep the versions in sync with the versions in the WORKSPACE file. + +bazel_dep(name = "google_benchmark", + version = "1.8.4", + repo_name = "com_github_google_benchmark", + dev_dependency = True) + +bazel_dep(name = "googletest", + version = "1.14.0.bcr.1", + repo_name = "com_google_googletest", + dev_dependency = True) + +bazel_dep(name = "platforms", + version = "0.0.8") diff --git a/WORKSPACE b/WORKSPACE index 16d3f2e7..705be3d7 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -5,23 +5,22 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # GoogleTest/GoogleMock framework. Used by most unit-tests. http_archive( name = "com_google_googletest", - sha256 = "353571c2440176ded91c2de6d6cd88ddd41401d14692ec1f99e35d013feda55a", - strip_prefix = "googletest-release-1.11.0", - urls = ["https://github.com/google/googletest/archive/release-1.11.0.zip"], + sha256 = "8ad598c73ad796e0d8280b082cebd82a630d73e73cd3c70057938a6501bba5d7", + strip_prefix = "googletest-1.14.0", + urls = ["https://github.com/google/googletest/archive/refs/tags/v1.14.0.tar.gz"], ) # Google Benchmark library. http_archive( name = "com_github_google_benchmark", - sha256 = "30f2e5156de241789d772dd8b130c1cb5d33473cc2f29e4008eab680df7bd1f0", - strip_prefix = "benchmark-1.5.5", - urls = ["https://github.com/google/benchmark/archive/v1.5.5.zip"], + sha256 = "3e7059b6b11fb1bbe28e33e02519398ca94c1818874ebed18e504dc6f709be45", + strip_prefix = "benchmark-1.8.4", + urls = ["https://github.com/google/benchmark/archive/refs/tags/v1.8.4.tar.gz"], ) # Bazel platform rules. http_archive( name = "platforms", - sha256 = "b601beaf841244de5c5a50d2b2eddd34839788000fa1be4260ce6603ca0d8eb7", - strip_prefix = "platforms-98939346da932eef0b54cf808622f5bb0928f00b", - urls = ["https://github.com/bazelbuild/platforms/archive/98939346da932eef0b54cf808622f5bb0928f00b.zip"], + sha256 = "8150406605389ececb6da07cbcb509d5637a3ab9a24bc69b1101531367d89d74", + urls = ["https://github.com/bazelbuild/platforms/releases/download/0.0.8/platforms-0.0.8.tar.gz"], )