From f2c55832aa435a6861b38b306d9c60362d9b9337 Mon Sep 17 00:00:00 2001 From: Luan Gong Date: Fri, 2 Feb 2024 05:28:38 +0800 Subject: [PATCH] Use bzlmod to manage external dependencies (#186) * Use bzlmod to manage external dependencies Bzlmod is the new way to to manage external dependencies. The `--enable_bzlmod` flag was introduced in Bazel 6 and has been turned on by default since Bazel 7, so declaring external dependencies in `WORKSPACE` is considered leagcy behavior. The old `WORKSPACE`-system is planned to be disabled in Bazel 8 and to be removed altogether in Bazel 9. This commit migrates from `WORKSPACE` to bzlmod. References: - https://bazel.build/external/overview - https://bazel.build/external/migration - https://blog.bazel.build/2023/12/11/bazel-7-release.html#bzlmod * Remove lockfile MODULE.bazel.lock --- MODULE.bazel | 4 ++++ WORKSPACE.bzlmod | 2 ++ 2 files changed, 6 insertions(+) create mode 100644 MODULE.bazel create mode 100644 WORKSPACE.bzlmod diff --git a/MODULE.bazel b/MODULE.bazel new file mode 100644 index 0000000..92acf1f --- /dev/null +++ b/MODULE.bazel @@ -0,0 +1,4 @@ +module(name = "protobuf_javascript", version = "3.21.2") + +bazel_dep(name = "protobuf", version = "21.7", repo_name = "com_google_protobuf") +bazel_dep(name = "rules_pkg", version = "0.9.1") diff --git a/WORKSPACE.bzlmod b/WORKSPACE.bzlmod new file mode 100644 index 0000000..7de259e --- /dev/null +++ b/WORKSPACE.bzlmod @@ -0,0 +1,2 @@ +# When Bzlmod is enabled, this file replaces the content of the original WORKSPACE and +# makes sure no WORKSPACE prefix or suffix are added when Bzlmod is enabled.