Skip to content

Commit a9db1bb

Browse files
committed
Use grpc/grpc cc_binary plugin targets.
Extends gRPC protobuf support to python, ruby, objective-c by using the plugin cc_binary targets.
1 parent a642ff7 commit a9db1bb

File tree

22 files changed

+127
-68
lines changed

22 files changed

+127
-68
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,20 @@ of this project are to:
4848
| [gRPC gateway](grpc_gateway) | [grpc_gateway_proto_compile](grpc_gateway#grpc_gateway_proto_compile)<br/>[grpc_gateway_swagger_compile](grpc_gateway#grpc_gateway_swagger_compile) | [grpc_gateway_proto_library](grpc_gateway#grpc_gateway_proto_library)<br/>[grpc_gateway_binary](grpc_gateway#grpc_gateway_binary) | [v1.0.0](https://github.com/grpc/grpc-go/releases/tag/v1.0.0) |
4949
| [Java](java) | [java_proto_compile](java#java_proto_compile) | [java_proto_library](java#java_proto_library) | [v1.0.1](https://github.com/grpc/grpc-java/releases/tag/v1.0.1) |
5050
| [Node](node) | [node_proto_compile](js#node_proto_compile) | [node_proto_library](js#node_proto_library) | [1.0.0](https://www.npmjs.com/package/grpc) |
51-
| [Objective-C](objc) | [objc_proto_compile](objc#objc_proto_compile) | [objc_proto_library](objc#objc_proto_library) <sup>5</sup> | <sup>4</sup> |
52-
| [Python](python) | [py_proto_compile](python#py_proto_compile) | | <sup>4</sup> |
53-
| [Ruby](ruby) | [ruby_proto_compile](ruby#ruby_proto_compile) | | <sup>4</sup> |
51+
| [Objective-C](objc) | [objc_proto_compile](objc#objc_proto_compile) | [objc_proto_library](objc#objc_proto_library) <sup>4</sup> | [v0.15.2](https://github.com/grpc/grpc/releases/tag/v0.15.2) |
52+
| [Python](python) | [py_proto_compile](python#py_proto_compile) | | [v0.15.2](https://github.com/grpc/grpc/releases/tag/v0.15.2) |
53+
| [Ruby](ruby) | [ruby_proto_compile](ruby#ruby_proto_compile) | | [v0.15.2](https://github.com/grpc/grpc/releases/tag/v0.15.2) |
5454
| Custom [proto_language](protobuf#proto_language) | [proto_compile](protobuf#proto_compile) | | |
5555

56-
1. Support for generation of protoc outputs via `proto_compile()` rule.
56+
1. Support for generation of protoc outputs via `proto_compile()`
57+
rule.
5758

58-
2. Support for generation + compilation of outputs with protobuf dependencies.
59+
2. Support for generation + compilation of outputs with protobuf
60+
dependencies.
5961

6062
3. gRPC support.
6163

62-
4. gRPC *is* supported in this language, but not currently within rules_protobuf)
63-
64-
5. Highly experimental (probably not functional yet). A
64+
4. Highly experimental (probably not functional yet). A
6565
work-in-progress for those interested in contributing further work.
6666

6767

closure/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
| [closure_proto_compile](#closure_proto_compile) | Generate closure js protobuf source files. |
77
| [closure_proto_library](#closure_proto_library) | Generate and compiles closure js source files. |
88

9-
## closure\_proto\_repositores
9+
## closure\_proto\_repositories
1010

1111
Enable closure support by loading the dependencies in your workspace.
1212

cpp/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
| [cc_proto_compile](#cc_proto_compile) | Generate protobuf source files. |
77
| [cc_proto_library](#cc_proto_library) | Generate and compiles protobuf source files. |
88

9-
## cpp\_proto\_repositores
9+
## cpp\_proto\_repositories
1010

1111
Enable C++ support by loading the dependencies in your workspace.
1212

csharp/BUILD

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ proto_language(
1111
"@nuget_google_protobuf//:libnet45",
1212
],
1313
supports_grpc = True,
14-
grpc_plugin = "@nuget_grpc_tools//:protoc-gen-grpc-csharp_bin",
1514
grpc_file_extensions = ["Grpc.cs"],
15+
grpc_plugin = "@com_github_grpc_grpc//:grpc_csharp_plugin",
16+
grpc_plugin_name = "grpc_csharp",
1617
grpc_compile_deps = [
1718
"@nuget_grpc//:core",
1819
],

csharp/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
| [csharp_proto_compile](#csharp_proto_compile) | Generate protobuf source files. |
77
| [csharp_proto_library](#csharp_proto_library) | Generate and compiles protobuf source files. |
88

9-
## csharp\_proto\_repositores
9+
## csharp\_proto\_repositories
1010

1111
Enable C# support by loading the dependencies in your workspace.
1212

csharp/rules.bzl

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
load("@io_bazel_rules_dotnet//dotnet:csharp.bzl", "nuget_package", "new_nuget_package", "csharp_library", "dll_import")
22
load("//protobuf:rules.bzl", "proto_compile", "proto_repositories", "proto_language_deps")
33

4-
54
def csharp_proto_repositories():
65
proto_repositories()
76

@@ -44,36 +43,6 @@ dll_import(
4443
srcs = glob(["Grpc.Core.1.0.0/lib/net45/**/*.dll"]),
4544
visibility = ["//visibility:public"],
4645
)
47-
"""
48-
)
49-
50-
new_nuget_package(
51-
name = "nuget_grpc_tools",
52-
package = "Grpc.Tools",
53-
version = "1.0.0",
54-
build_file_content =
55-
"""
56-
load("@io_bazel_rules_dotnet//dotnet:csharp.bzl", "dll_import", "csharp_binary")
57-
genrule(
58-
name = "protoc-gen-grpc-csharp_bin",
59-
srcs = [":grpc_csharp_plugin"],
60-
outs = ["protoc-gen-grpc-csharp"],
61-
cmd = "cp $(location :grpc_csharp_plugin) $$(pwd)/$@",
62-
executable = True,
63-
visibility = ["//visibility:public"],
64-
)
65-
filegroup(
66-
name = "grpc_csharp_plugin",
67-
srcs = select({
68-
":darwin": ["Grpc.Tools.1.0.0/tools/macosx_x64/grpc_csharp_plugin"],
69-
"//conditions:default": ["Grpc.Tools.1.0.0/tools/linux_x64/grpc_csharp_plugin"],
70-
}),
71-
)
72-
config_setting(
73-
name = "darwin",
74-
values = {"cpu": "darwin"},
75-
visibility = ["//visibility:private"],
76-
)
7746
"""
7847
)
7948

examples/helloworld/proto/BUILD

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,14 @@ proto_compile(
7777
name = "ruby",
7878
langs = ["//ruby"],
7979
protos = [":protos"],
80-
with_grpc = False,
80+
with_grpc = True,
81+
)
82+
83+
proto_compile(
84+
name = "objc",
85+
langs = ["//objc"],
86+
protos = [":protos"],
87+
with_grpc = True,
8188
)
8289

8390
csharp_proto_library(

go/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
| [go_proto_compile](#go_proto_compile) | Generate protobuf source files. |
77
| [go_proto_library](#go_proto_library) | Generate and compiles protobuf source files. |
88

9-
## go\_proto\_repositores
9+
## go\_proto\_repositories
1010

1111
Enable go support by loading the dependencies in your workspace.
1212

gogo/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
| [gogo_proto_compile](#gogo_proto_compile) | Generate protobuf source files. |
77
| [gogo_proto_library](#gogo_proto_library) | Generate and compiles protobuf source files. |
88

9-
## gogo\_proto\_repositores
9+
## gogo\_proto\_repositories
1010

1111
Enable C# support by loading the dependencies in your workspace.
1212

grpc_gateway/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
| [grpc_gateway_proto_library](#grpc_gateway_proto_library) | Generate and compiles protobuf source files. |
88
| [grpc_gateway_swagger_compile](#grpc_gateway_swagger_compile) | Generate swwagger.json source files. |
99

10-
## grpc_gateway\_proto\_repositores
10+
## grpc_gateway\_proto\_repositories
1111

1212
Enable [grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway)
1313
support by loading the dependencies in your workspace.

0 commit comments

Comments
 (0)