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

  % for version in supported_bazel_versions:
  - [`${version}`](https://github.com/bazelbuild/bazel/releases/tag/${version})
  % endfor