|
| 1 | +# Copyright 2021-2025 Buf Technologies, Inc. |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +"Bazel module definition for bzlmod" |
| 16 | + |
| 17 | +module( |
| 18 | + name = "rules_buf", |
| 19 | + version = "0.4.0", |
| 20 | + compatibility_level = 1, |
| 21 | +) |
| 22 | + |
| 23 | +bazel_dep(name = "platforms", version = "0.0.10") |
| 24 | +bazel_dep(name = "protobuf", version = "29.1", repo_name = "com_google_protobuf") |
| 25 | +bazel_dep(name = "rules_proto", version = "7.0.2") |
| 26 | +bazel_dep(name = "rules_go", version = "0.42.0", repo_name = "io_bazel_rules_go") |
| 27 | +bazel_dep(name = "bazel_skylib", version = "1.7.1") |
| 28 | + |
| 29 | +bazel_dep(name = "stardoc", version = "0.7.1", dev_dependency = True, repo_name = "io_bazel_stardoc") |
| 30 | + |
| 31 | +# We depend on gazelle at runtime to generate our proto_library rules |
| 32 | +bazel_dep(name = "gazelle", version = "0.34.0", repo_name = "bazel_gazelle") |
| 33 | + |
| 34 | +go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps") |
| 35 | +go_deps.from_file(go_mod = "//:go.mod") |
| 36 | +use_repo( |
| 37 | + go_deps, |
| 38 | + "com_github_bazelbuild_buildtools", |
| 39 | + "com_github_stretchr_testify", |
| 40 | + "in_gopkg_yaml_v3", |
| 41 | +) |
| 42 | + |
| 43 | +# ... and then reach inside to get the gazelle binary from this repository |
| 44 | +non_module_deps = use_extension("@bazel_gazelle//internal/bzlmod:non_module_deps.bzl", "non_module_deps") |
| 45 | +use_repo(non_module_deps, "bazel_gazelle_go_repository_tools") |
| 46 | + |
| 47 | +ext = use_extension("//buf:extensions.bzl", "buf") |
| 48 | +use_repo(ext, "rules_buf_toolchains") |
| 49 | + |
| 50 | +register_toolchains("@rules_buf_toolchains//:all") |
0 commit comments