Categorygithub.com/rules-proto-grpc/rules_proto_grpc
module
0.0.0-20241117200157-d17b5b16c8b1
Repository: https://github.com/rules-proto-grpc/rules_proto_grpc.git
Documentation: pkg.go.dev

# README

Protobuf and gRPC rules for Bazel

Bazel rules for building Protobuf and gRPC code and libraries from proto_library targets

If you or your company find these rules useful, please consider supporting the building and maintenance of these rules :coffee:

[!IMPORTANT] The master branch now contains the Bzlmod-only update of the rules released in version 5.0.0. If you need to see the WORKSPACE based rules used in version 4.x.x, please see the legacy branch

Announcements 📣

2024/07/31 - Version 5.0.0

Version 5.0.0 has been released, which rewrites the rules to support Bzlmod only. Moving to Bzlmod provides a huge improvement in the stability and maintainability of these rules, as third-party transitive dependency management has been handed off to Bazel and new versions of gRPC and Protobuf should hopefully be able to be supported more rapidly.

At present not all languages supported by the 4.x.x are supported by this release, with support for the remaining languages being tracked here. For these unsupported languages - or for WORKSPACE repos - it is recommended you continue using the 4.x.x releases.

The way you use these rules is largely unchanged, but unfortunately the paths used for load of the rules will have changed due to the splitting into language-specific modules. Please see the docs for details of how to migrate your usage to these new rules, in particular the release notes.

2023/12/14 - Version 4.6.0

Version 4.6.0 has been released, which contains a few bug fixes for Bazel 7 support. Note that this is likely to be the last WORKSPACE supporting release of rules_proto_grpc, as new Bzlmod supporting rules are introduced in the next major version

2023/09/12 - Version 4.5.0

Version 4.5.0 has been released, which contains a number of version updates, bug fixes and usability improvements over 4.4.0. Additionally, the Rust rules contain a major change of underlying gRPC and Protobuf library; the rules now use Tonic and Prost respectively

Usage

Full documentation for the current and previous versions can be found here

Rules

LanguageRuleDescription
Bufbuf_proto_breaking_testChecks .proto files for breaking changes (example)
Bufbuf_proto_lint_testLints .proto files (example)
Cc_proto_compileGenerates C protobuf .h & .c files (example)
Cc_proto_libraryGenerates a C protobuf library using cc_library, with dependencies linked (example)
C++cpp_proto_compileGenerates C++ protobuf .h & .cc files (example)
C++cpp_grpc_compileGenerates C++ protobuf and gRPC .h & .cc files (example)
C++cpp_proto_libraryGenerates a C++ protobuf library using cc_library, with dependencies linked (example)
C++cpp_grpc_libraryGenerates a C++ protobuf and gRPC library using cc_library, with dependencies linked (example)
Documentationdoc_docbook_compileGenerates DocBook .xml documentation file (example)
Documentationdoc_html_compileGenerates .html documentation file (example)
Documentationdoc_json_compileGenerates .json documentation file (example)
Documentationdoc_markdown_compileGenerates Markdown .md documentation file (example)
Documentationdoc_template_compileGenerates documentation file using Go template file (example)
Gogo_proto_compileGenerates Go protobuf .go files (example)
Gogo_grpc_compileGenerates Go protobuf and gRPC .go files (example)
Gogo_proto_libraryGenerates a Go protobuf library using go_library from rules_go (example)
Gogo_grpc_libraryGenerates a Go protobuf and gRPC library using go_library from rules_go (example)
gRPC-Gatewaygateway_grpc_compileGenerates gRPC-Gateway .go files (example)
gRPC-Gatewaygateway_openapiv2_compileGenerates gRPC-Gateway OpenAPI v2 .json files (example)
gRPC-Gatewaygateway_grpc_libraryGenerates gRPC-Gateway library files (example)
Javajava_proto_compileGenerates a Java protobuf srcjar file (example)
Javajava_grpc_compileGenerates a Java protobuf and gRPC srcjar file (example)
Javajava_proto_libraryGenerates a Java protobuf library using java_library (example)
Javajava_grpc_libraryGenerates a Java protobuf and gRPC library using java_library (example)
Objective-Cobjc_proto_compileGenerates Objective-C protobuf .m & .h files (example)
Objective-Cobjc_grpc_compileGenerates Objective-C protobuf and gRPC .m & .h files (example)
Objective-Cobjc_proto_libraryGenerates an Objective-C protobuf library using objc_library (example)
Objective-Cobjc_grpc_libraryGenerates an Objective-C protobuf and gRPC library using objc_library (example)
Pythonpython_proto_compileGenerates Python protobuf .py files (example)
Pythonpython_grpc_compileGenerates Python protobuf and gRPC .py files (example)
Pythonpython_grpclib_compileGenerates Python protobuf and grpclib .py files (supports Python 3 only) (example)
Pythonpython_proto_libraryGenerates a Python protobuf library using py_library from rules_python (example)
Pythonpython_grpc_libraryGenerates a Python protobuf and gRPC library using py_library from rules_python (example)
Pythonpython_grpclib_libraryGenerates a Python protobuf and grpclib library using py_library from rules_python (supports Python 3 only) (example)

License

This project is derived from stackb/rules_proto under the Apache 2.0 license and this project therefore maintains the terms of that license

# Packages

No description provided by the author
No description provided by the author
No description provided by the author