Debian Codegraph @

templates/doc/bazel_support.md.template

raw
1 %YAML 1.2
2 --- |
3 # Bazel Support
4
5 ${ '##' } Basic Usage
6
7 The `grpc/grpc` repository's primary build system is Bazel. Rules are provided
8 for C++, Python, and Objective-C. While C++ supports other build systems such as
9 CMake, these rules are actually generated from the Bazel definitions.
10
11 Projects built with Bazel may use the `grpc/grpc` repo not only to add a
12 dependency on the library itself, but also to generate protobuf, stub, and
13 servicer code. To do so, one must invoke the `grpc_deps` and `grpc_extra_deps`
14 repository rules in their `WORKSPACE` file:
15
16 ```starlark
17 workspace(name = "example_workspace")
18
19 load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
20
21 http_archive(
22 name = "com_github_grpc_grpc",
23 strip_prefix = "grpc-1.45.0",
24 sha256 = "ec19657a677d49af59aa806ec299c070c882986c9fcc022b1c22c2a3caf01bcd"k
25 urls = ["https://github.com/grpc/grpc/archive/refs/tags/v1.45.0.tar.gz"],
26 )
27
28 load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
29
30 grpc_deps()
31
32 load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")
33
34 grpc_extra_deps()
35 ```
36
37 ${ '##' } Supported Versions
38
39 In general, gRPC supports building with the latest patch release of the two most
40 recent LTS versions of Bazel. However individual releases may have a broader
41 compatibility range. The currently supported versions are captured by the
42 following list:
43
44 % for version in supported_bazel_versions:
45 - [`${version}`](https://github.com/bazelbuild/bazel/releases/tag/${version})
46 % endfor