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 c77d668709 Prepare 4.6.0 release 2023-12-14 17:18:44 +00:00
.bazelci Partial revert of 38f4d41424 2023-10-18 15:20:45 +01:00
.github Add untested workflow to publish release assets 2023-03-22 22:39:39 +00:00
android Fix typo in dict comprehension 2022-12-01 22:35:25 +00:00
buf Update buf to v1.7.0 and swap flags based on #210 2022-08-24 16:50:01 +01:00
c Apply buildifier 2023-12-14 17:12:27 +00:00
cpp Apply buildifier 2023-12-14 17:12:27 +00:00
csharp Partial revert of 38f4d41424 2023-10-18 15:20:45 +01:00
d Fix typo in dict comprehension 2022-12-01 22:35:25 +00:00
doc Remove dangling file that is unused 2022-11-22 22:15:47 +00:00
docs Prepare 4.6.0 release 2023-12-14 17:18:44 +00:00
example Align rulegen and buildifier 2023-09-08 12:20:17 +01:00
fsharp Update grpc 2023-06-04 23:57:23 +01:00
go Update grpc 2023-06-04 23:57:23 +01:00
grpc-gateway fix go plugin opts 2023-05-20 19:49:19 +02:00
internal Align rulegen and buildifier 2023-09-08 12:20:17 +01:00
java Fix typo in dict comprehension 2022-12-01 22:35:25 +00:00
js Fix typo in dict comprehension 2022-12-01 22:35:25 +00:00
objc Apply buildifier 2023-12-14 17:12:27 +00:00
php Drop transitive aspect-based compilation. Closes #137 2021-09-17 18:25:48 +00:00
protobuf Revert using pre-compiled protoc 2021-09-18 21:21:03 +00:00
python Add support for passing data attr to Python library rules, closes #257 2023-06-04 23:21:51 +01:00
ruby Update grpc 2023-06-04 23:57:23 +01:00
rust Merge branch 'master' into rust-allow-all-clippy-lints 2023-12-14 17:00:46 +00:00
scala Fix typo in dict comprehension 2022-12-01 22:35:25 +00:00
swift Fix typo in dict comprehension 2022-12-01 22:35:25 +00:00
test_workspaces Update docs and readme for 4.5.0 2023-09-12 13:04:37 +01:00
third_party Remove orphaned file 2023-06-05 00:27:37 +01:00
tools Prepare 4.6.0 release 2023-12-14 17:18:44 +00:00
.bazelignore
.gitignore
.readthedocs.yaml
BUILD.bazel Add bzl_library build targets. 2023-01-31 21:13:09 -08:00
LICENSE
Makefile Replace rust rules with new prost and tonic rules 2023-06-05 22:28:40 -07:00
README.md Prepare 4.6.0 release 2023-12-14 17:18:44 +00:00
WORKSPACE Use tonic for rust proto and grpc. Updates to handle dependency chains. 2023-06-05 22:28:40 -07:00
defs.bzl Export proto_compile, see #240 2023-03-22 21:22:23 +00:00
repositories.bzl Remove platforms repo, see #263 2023-09-11 13:38:00 +01:00

README.md

Protobuf and gRPC rules for Bazel

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

Announcements 📣

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 release

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
Android android_proto_compile Generates an Android protobuf .jar file (example)
Android android_grpc_compile Generates Android protobuf and gRPC .jar files (example)
Android android_proto_library Generates an Android protobuf library using android_library from rules_android (example)
Android android_grpc_library Generates Android protobuf and gRPC library using android_library from rules_android (example)
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)
C# csharp_proto_compile Generates C# protobuf .cs files (example)
C# csharp_grpc_compile Generates C# protobuf and gRPC .cs files (example)
C# csharp_proto_library Generates a C# protobuf library using csharp_library from rules_dotnet. Note that the library name must end in .dll (example)
C# csharp_grpc_library Generates a C# protobuf and gRPC library using csharp_library from rules_dotnet. Note that the library name must end in .dll (example)
D d_proto_compile Generates D protobuf .d files (example)
D d_proto_library Generates a D protobuf library using d_library from rules_d (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)
F# fsharp_proto_compile Generates F# protobuf .fs files (example)
F# fsharp_grpc_compile Generates F# protobuf and gRPC .fs files (example)
F# fsharp_proto_library Generates a F# protobuf library using fsharp_library from rules_dotnet. Note that the library name must end in .dll (example)
F# fsharp_grpc_library Generates a F# protobuf and gRPC library using fsharp_library from rules_dotnet. Note that the library name must end in .dll (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_validate_compile Generates Go protobuf and gRPC validation .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)
Go go_validate_library Generates a Go protobuf and gRPC validation 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)
JavaScript js_proto_compile Generates JavaScript protobuf .js and .d.ts files (example)
JavaScript js_grpc_node_compile Generates JavaScript protobuf and gRPC-node .js and .d.ts files (example)
JavaScript js_grpc_web_compile Generates JavaScript protobuf and gRPC-Web .js and .d.ts files (example)
JavaScript js_proto_library Generates a JavaScript protobuf library using js_library from rules_nodejs (example)
JavaScript js_grpc_node_library Generates a Node.js protobuf + gRPC-node library using js_library from rules_nodejs (example)
JavaScript js_grpc_web_library Generates a JavaScript protobuf + gRPC-Web library using js_library from rules_nodejs (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)
PHP php_proto_compile Generates PHP protobuf .php files (example)
PHP php_grpc_compile Generates PHP protobuf and gRPC .php files (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)
Ruby ruby_proto_compile Generates Ruby protobuf .rb files (example)
Ruby ruby_grpc_compile Generates Ruby protobuf and gRPC .rb files (example)
Ruby ruby_proto_library Generates a Ruby protobuf library using ruby_library from rules_ruby (example)
Ruby ruby_grpc_library Generates a Ruby protobuf and gRPC library using ruby_library from rules_ruby (example)
Rust rust_prost_proto_compile Generates Rust protobuf .rs files using prost (example)
Rust rust_tonic_grpc_compile Generates Rust protobuf and gRPC .rs files using prost and tonic (example)
Rust rust_prost_proto_library Generates a Rust prost protobuf library using rust_library from rules_rust (example)
Rust rust_tonic_grpc_library Generates a Rust prost protobuf and tonic gRPC library using rust_library from rules_rust (example)
Scala scala_proto_compile Generates a Scala protobuf .jar file (example)
Scala scala_grpc_compile Generates Scala protobuf and gRPC .jar file (example)
Scala scala_proto_library Generates a Scala protobuf library using scala_library from rules_scala (example)
Scala scala_grpc_library Generates a Scala protobuf and gRPC library using scala_library from rules_scala (example)
Swift swift_proto_compile Generates Swift protobuf .swift files (example)
Swift swift_grpc_compile Generates Swift protobuf and gRPC .swift files (example)
Swift swift_proto_library Generates a Swift protobuf library using swift_library from rules_swift (example)
Swift swift_grpc_library Generates a Swift protobuf and gRPC library using swift_library from rules_swift (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