| module( | |
| name = "grpc-client-server", | |
| version = "0.0.0", | |
| ) | |
| ############################################################################### | |
| # B A Z E L C E N T R A L R E G I S T R Y # https://registry.bazel.build/ | |
| ############################################################################### | |
| # https://github.com/bazelbuild/rules_rust/releases | |
| bazel_dep(name = "rules_rust", version = "0.0.0") | |
| local_path_override( | |
| module_name = "rules_rust", | |
| path = "../..", | |
| ) | |
| bazel_dep(name = "rules_rust_prost", version = "0.0.0") | |
| local_path_override( | |
| module_name = "rules_rust_prost", | |
| path = "../../extensions/prost", | |
| ) | |
| # | |
| # Rules for protobuf / gRPC | |
| # https://github.com/bazelbuild/rules_proto/releases | |
| bazel_dep(name = "rules_proto", version = "7.1.0") | |
| # https://registry.bazel.build/modules/protobuf | |
| bazel_dep(name = "protobuf", version = "34.1", repo_name = "com_google_protobuf") | |
| # Required for Bazel 9 support when building Protobuf | |
| bazel_dep(name = "rules_android", version = "0.7.1", dev_dependency = True) | |
| bazel_dep(name = "rules_go", version = "0.60.0", dev_dependency = True) | |
| ############################################################################### | |
| # T O O L C H A I N S | |
| ############################################################################### | |
| # Rust toolchain | |
| RUST_EDITION = "2021" | |
| RUST_VERSION = "1.90.0" | |
| rust = use_extension("@rules_rust//rust:extensions.bzl", "rust") | |
| rust.toolchain( | |
| edition = RUST_EDITION, | |
| versions = [RUST_VERSION], | |
| ) | |
| use_repo(rust, "rust_toolchains") | |
| register_toolchains("@rust_toolchains//:all") | |
| # Custom Prost toolchain | |
| register_toolchains( | |
| "//tools/prost_toolchain", | |
| "//tools/proto_toolchain", | |
| ) | |
| ############################################################################### | |
| # R U S T C R A T E S | |
| ############################################################################### | |
| crate = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate") | |
| # | |
| # protobuf / gRPC dependencies | |
| crate.spec( | |
| package = "prost", | |
| version = "0.13.1", | |
| ) | |
| crate.spec( | |
| default_features = False, | |
| package = "prost-types", | |
| version = "0.13.1", | |
| ) | |
| crate.spec( | |
| features = ["transport"], | |
| package = "tonic", | |
| version = "0.12.1", | |
| ) | |
| crate.spec( | |
| package = "tonic-build", | |
| version = "0.12.1", | |
| ) | |
| crate.spec( | |
| package = "protoc-gen-prost", | |
| version = "0.4.0", | |
| ) | |
| crate.annotation( | |
| crate = "protoc-gen-prost", | |
| gen_binaries = ["protoc-gen-prost"], | |
| ) | |
| crate.spec( | |
| package = "protoc-gen-tonic", | |
| version = "0.4.0", | |
| ) | |
| crate.annotation( | |
| crate = "protoc-gen-tonic", | |
| gen_binaries = ["protoc-gen-tonic"], | |
| ) | |
| # | |
| # External crates | |
| crate.spec( | |
| default_features = False, | |
| features = [ | |
| "macros", | |
| "net", | |
| "rt-multi-thread", | |
| "signal", | |
| ], | |
| package = "tokio", | |
| version = "1.39.3", | |
| ) | |
| crate.from_specs( | |
| cargo_lockfile = "//:Cargo.Bazel.lock", | |
| ) | |
| use_repo(crate, "crates") |