Bazel rules for building Protobuf and gRPC code and libraries from proto_library targets https://rules-proto-grpc.com/en/4.5.0
Go to file
Adam Liddell 96a96ed657
Merge pull request #360 from LM-SR/patch-1
Fix typo
2024-09-26 15:56:42 +00:00
.bazelci Merge branch 'master' into prefix_path 2024-07-31 14:44:49 +01:00
.github Add warnings when Renovate attempts to update packages that can be skewed 2024-08-03 19:12:40 +01:00
docs Update docs build deps 2024-07-31 18:53:39 +01:00
examples Revert "Test re-enabling Java" 2024-07-26 16:08:36 +01:00
modules Fix typo 2024-09-26 17:22:32 +02:00
test_workspaces Update dependency rules_go to v0.50.1 2024-09-05 16:04:05 +00:00
tools Update dependency rules_go to v0.50.1 2024-09-05 16:04:05 +00:00
.bazelignore Add java 2024-02-19 22:04:39 +00:00
.gitignore Remove dupe entry in gitignore 2024-07-31 15:32:19 +01:00
.readthedocs.yaml Fix RTD config 2023-12-15 11:38:20 +00:00
LICENSE Replace license reference with full license text 2019-07-18 18:55:36 +00:00
MODULE.bazel Update dependency rules_go to v0.50.1 2024-09-05 16:04:05 +00:00
Makefile Remove ref and sha256 from rulegen, removing need for index.rst gen 2023-12-14 20:12:30 +00:00
README.md Update readme 2024-07-31 14:42:13 +01:00
WORKSPACE 🔥🔥🔥🔥🔥🔥 2023-09-12 13:57:11 +01:00

README.md

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

[!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

Language Rule Description
Buf buf_proto_breaking_test Checks .proto files for breaking changes (example)
Buf buf_proto_lint_test Lints .proto files (example)
C c_proto_compile Generates C protobuf .h & .c files (example)
C c_proto_library Generates a C protobuf library using cc_library, with dependencies linked (example)
C++ cpp_proto_compile Generates C++ protobuf .h & .cc files (example)
C++ cpp_grpc_compile Generates C++ protobuf and gRPC .h & .cc files (example)
C++ cpp_proto_library Generates a C++ protobuf library using cc_library, with dependencies linked (example)
C++ cpp_grpc_library Generates a C++ protobuf and gRPC library using cc_library, with dependencies linked (example)
Documentation doc_docbook_compile Generates DocBook .xml documentation file (example)
Documentation doc_html_compile Generates .html documentation file (example)
Documentation doc_json_compile Generates .json documentation file (example)
Documentation doc_markdown_compile Generates Markdown .md documentation file (example)
Documentation doc_template_compile Generates documentation file using Go template file (example)
Go go_proto_compile Generates Go protobuf .go files (example)
Go go_grpc_compile Generates Go protobuf and gRPC .go files (example)
Go go_proto_library Generates a Go protobuf library using go_library from rules_go (example)
Go go_grpc_library Generates a Go protobuf and gRPC library using go_library from rules_go (example)
gRPC-Gateway gateway_grpc_compile Generates gRPC-Gateway .go files (example)
gRPC-Gateway gateway_openapiv2_compile Generates gRPC-Gateway OpenAPI v2 .json files (example)
gRPC-Gateway gateway_grpc_library Generates gRPC-Gateway library files (example)
Java java_proto_compile Generates a Java protobuf srcjar file (example)
Java java_grpc_compile Generates a Java protobuf and gRPC srcjar file (example)
Java java_proto_library Generates a Java protobuf library using java_library (example)
Java java_grpc_library Generates a Java protobuf and gRPC library using java_library (example)
Objective-C objc_proto_compile Generates Objective-C protobuf .m & .h files (example)
Objective-C objc_grpc_compile Generates Objective-C protobuf and gRPC .m & .h files (example)
Objective-C objc_proto_library Generates an Objective-C protobuf library using objc_library (example)
Objective-C objc_grpc_library Generates an Objective-C protobuf and gRPC library using objc_library (example)
Python python_proto_compile Generates Python protobuf .py files (example)
Python python_grpc_compile Generates Python protobuf and gRPC .py files (example)
Python python_grpclib_compile Generates Python protobuf and grpclib .py files (supports Python 3 only) (example)
Python python_proto_library Generates a Python protobuf library using py_library from rules_python (example)
Python python_grpc_library Generates a Python protobuf and gRPC library using py_library from rules_python (example)
Python python_grpclib_library Generates 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