|
|
@ -2,7 +2,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
load("//:bazel/generate_cc.bzl", "generate_cc") |
|
|
|
load("//:bazel/generate_cc.bzl", "generate_cc") |
|
|
|
|
|
|
|
|
|
|
|
def cc_grpc_library(name, srcs, deps, proto_only, well_known_protos, generate_mock, use_external = False, **kwargs): |
|
|
|
def cc_grpc_library(name, srcs, deps, proto_only, well_known_protos, generate_mocks = False, use_external = False, **kwargs): |
|
|
|
"""Generates C++ grpc classes from a .proto file. |
|
|
|
"""Generates C++ grpc classes from a .proto file. |
|
|
|
|
|
|
|
|
|
|
|
Assumes the generated classes will be used in cc_api_version = 2. |
|
|
|
Assumes the generated classes will be used in cc_api_version = 2. |
|
|
@ -16,7 +16,7 @@ def cc_grpc_library(name, srcs, deps, proto_only, well_known_protos, generate_mo |
|
|
|
protos |
|
|
|
protos |
|
|
|
use_external: When True the grpc deps are prefixed with //external. This |
|
|
|
use_external: When True the grpc deps are prefixed with //external. This |
|
|
|
allows grpc to be used as a dependency in other bazel projects. |
|
|
|
allows grpc to be used as a dependency in other bazel projects. |
|
|
|
generate_mock: When true GMOCk code for client stub is generated. |
|
|
|
generate_mocks: When True, Google Mock code for client stub is generated. |
|
|
|
**kwargs: rest of arguments, e.g., compatible_with and visibility. |
|
|
|
**kwargs: rest of arguments, e.g., compatible_with and visibility. |
|
|
|
""" |
|
|
|
""" |
|
|
|
if len(srcs) > 1: |
|
|
|
if len(srcs) > 1: |
|
|
@ -54,7 +54,7 @@ def cc_grpc_library(name, srcs, deps, proto_only, well_known_protos, generate_mo |
|
|
|
srcs = [proto_target], |
|
|
|
srcs = [proto_target], |
|
|
|
plugin = plugin, |
|
|
|
plugin = plugin, |
|
|
|
well_known_protos = well_known_protos, |
|
|
|
well_known_protos = well_known_protos, |
|
|
|
generate_mock = generate_mock, |
|
|
|
generate_mocks = generate_mocks, |
|
|
|
**kwargs |
|
|
|
**kwargs |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|