Skip to content

Commit

Permalink
Upgrade google/protobuf to v3.1.0 and gRPC 1.0.0+.
Browse files Browse the repository at this point in the history
- Upgrades proto compiler to latest release (3.1.0).
- Upgrades grpc/grpc to a post 1.0.0 commit.
- Fixes wrong label for to objc plugin.
- Apply sorting of rules.
- Apply buildifier.
- Bump to 0.6.2.
  • Loading branch information
pcj committed Oct 3, 2016
1 parent a9db1bb commit 0e65d2a
Show file tree
Hide file tree
Showing 15 changed files with 144 additions and 96 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ was limited exposed and documented proto generation capabilities in
the main bazel repository. This is a moving target. The main goals
of this project are to:

1. Provide `protoc`, the protocol buffer compiler ([v3.0.0](https://github.com/google/protobuf/releases/tag/v3.0.0)).
1. Provide `protoc`, the protocol buffer compiler ([v3.1.0](https://github.com/google/protobuf/releases/tag/v3.1.0)).

2. Provide the language-specific plugins.

Expand All @@ -40,17 +40,17 @@ of this project are to:

| Language | Compile <sup>1</sup> | Build <sup>2</sup> | gRPC <sup>3</sup> |
| ---------------------------: | -----------: | --------: | -------- |
| [C++](cpp) | [cc_proto_compile](cpp#cc_proto_compile) | [cc_proto_library](cpp#cc_proto_library) | [v0.15.2](https://github.com/grpc/grpc/releases/tag/v0.15.2) |
| [C++](cpp) | [cc_proto_compile](cpp#cc_proto_compile) | [cc_proto_library](cpp#cc_proto_library) | [v1.0.0<sup>673f</sup>](https://github.com/grpc/grpc/commit/673fa6c88b8abd542ae50c4480de92880a1e4777) |
| [C#](csharp) | [csharp_proto_compile](csharp#csharp_proto_compile) | [csharp_proto_library](csharp#csharp_proto_library) | [1.0.0](https://www.nuget.org/packages/Grpc/) |
| [Closure](closure) | [closure_proto_compile](js#closure_proto_compile) | [closure_proto_library](js#closure_proto_library) | |
| [Go](go) | [go_proto_compile](go#go_proto_compile) | [go_proto_library](go#go_proto_library) | [v1.0.0](https://github.com/grpc/grpc-go/releases/tag/v1.0.0) |
| [Go (gogo)](gogo) | [gogo_proto_compile](gogo#gogo_proto_compile) | [gogo_proto_library](gogo#gogo_proto_library) | [v1.0.0](https://github.com/grpc/grpc-go/releases/tag/v1.0.0) |
| [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) |
| [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) |
| [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) |
| [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) |
| [Python](python) | [py_proto_compile](python#py_proto_compile) | | [v0.15.2](https://github.com/grpc/grpc/releases/tag/v0.15.2) |
| [Ruby](ruby) | [ruby_proto_compile](ruby#ruby_proto_compile) | | [v0.15.2](https://github.com/grpc/grpc/releases/tag/v0.15.2) |
| [Objective-C](objc) | [objc_proto_compile](objc#objc_proto_compile) | [objc_proto_library](objc#objc_proto_library) <sup>4</sup> | [v1.0.0<sup>673f</sup>](https://github.com/grpc/grpc/commit/673fa6c88b8abd542ae50c4480de92880a1e4777) |
| [Python](python) | [py_proto_compile](python#py_proto_compile) | | [v1.0.0<sup>673f</sup>](https://github.com/grpc/grpc/commit/673fa6c88b8abd542ae50c4480de92880a1e4777) |
| [Ruby](ruby) | [ruby_proto_compile](ruby#ruby_proto_compile) | | [v1.0.0<sup>673f</sup>](https://github.com/grpc/grpc/commit/673fa6c88b8abd542ae50c4480de92880a1e4777) |
| Custom [proto_language](protobuf#proto_language) | [proto_compile](protobuf#proto_compile) | | |

1. Support for generation of protoc outputs via `proto_compile()`
Expand Down Expand Up @@ -89,7 +89,7 @@ language-specific `*_proto_repositories` rule(s):
git_repository(
name = "org_pubref_rules_protobuf",
remote = "https://github.com/pubref/rules_protobuf",
tag = "v0.6.1",
tag = "v0.6.2",
)

load("@org_pubref_rules_protobuf//java:rules.bzl", "java_proto_repositories")
Expand Down
25 changes: 22 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ closure_repositories()

git_repository(
name = "io_bazel_rules_dotnet",
remote = "https://github.com/pcj/rules_dotnet.git",
commit = "b23e796dd0be27f35867590309d79ffe278d4eeb",
remote = "https://github.com/pcj/rules_dotnet.git",
)

load("@io_bazel_rules_dotnet//dotnet:csharp.bzl", "csharp_repositories")
csharp_repositories(use_local_mono = False)

csharp_repositories(use_local_mono = False)

# ================================================================
# node_proto_library support requires rules_node
Expand All @@ -54,41 +54,60 @@ csharp_repositories(use_local_mono = False)

git_repository(
name = "org_pubref_rules_node",
commit = "d93a80ac4920c52da8adccbca66a3118a27018fd", # Oct 2, 2016
remote = "https://github.com/pubref/rules_node.git",
commit = "d93a80ac4920c52da8adccbca66a3118a27018fd", # Oct 2, 2016
)

load("@org_pubref_rules_node//node:rules.bzl", "node_repositories")

node_repositories()

# ================================================================
# Specific Languages Support
# ================================================================

load("//protobuf:rules.bzl", "proto_repositories")

proto_repositories()

load("//cpp:rules.bzl", "cpp_proto_repositories")

cpp_proto_repositories()

load("//csharp:rules.bzl", "csharp_proto_repositories")

csharp_proto_repositories()

load("//java:rules.bzl", "java_proto_repositories", "nano_proto_repositories")

java_proto_repositories()

nano_proto_repositories()

load("//go:rules.bzl", "go_proto_repositories")

go_proto_repositories()

load("//gogo:rules.bzl", "gogo_proto_repositories")

gogo_proto_repositories()

load("//grpc_gateway:rules.bzl", "grpc_gateway_proto_repositories")

grpc_gateway_proto_repositories()

load("//node:rules.bzl", "node_proto_repositories")

node_proto_repositories()

load("//objc:rules.bzl", "objc_proto_repositories")

objc_proto_repositories()

load("//python:rules.bzl", "py_proto_repositories")

py_proto_repositories()

load("//ruby:rules.bzl", "ruby_proto_repositories")

ruby_proto_repositories()
10 changes: 5 additions & 5 deletions examples/helloworld/csharp/GreeterClient/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ csharp_binary(
"Program.cs",
],
deps = [
":Helloworld",
"@nuget_google_protobuf//:libnet45",
"@nuget_grpc//:core",
"@nuget_grpc//:runtime_osx",
":Helloworld",
"@nuget_google_protobuf//:libnet45",
"@nuget_grpc//:core",
"@nuget_grpc//:runtime_osx",
],
)

Expand All @@ -24,9 +24,9 @@ csharp_proto_library(
with_grpc = True,
)


csharp_nunit_test(
name = "GreeterClientTest",
size = "small",
srcs = [
"GreeterClientTest.cs",
],
Expand Down
10 changes: 5 additions & 5 deletions examples/helloworld/csharp/GreeterServer/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ csharp_binary(
"Program.cs",
],
deps = [
":Helloworld",
"@nuget_google_protobuf//:libnet45",
"@nuget_grpc//:core",
"@nuget_grpc//:runtime_osx",
"@nuget_grpc//:system_interactive_async",
":Helloworld",
"@nuget_google_protobuf//:libnet45",
"@nuget_grpc//:core",
"@nuget_grpc//:runtime_osx",
"@nuget_grpc//:system_interactive_async",
],
)

Expand Down
5 changes: 4 additions & 1 deletion examples/helloworld/go/client/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package(default_visibility = ["//visibility:public"])

load("@io_bazel_rules_go//go:def.bzl", "go_binary")
load("//go:rules.bzl", GO_GRPC_COMPILE_DEPS = "GRPC_COMPILE_DEPS")
load(
"//go:rules.bzl",
GO_GRPC_COMPILE_DEPS = "GRPC_COMPILE_DEPS",
)
#load("//gogo:rules.bzl", GOGO_GRPC_COMPILE_DEPS = "GRPC_COMPILE_DEPS")

go_binary(
Expand Down
1 change: 1 addition & 0 deletions examples/helloworld/go/greeter_test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ go_test(
name = "greeter_test",
size = "small",
srcs = ["greeter_test.go"],
tags = ["exclusive"],
deps = [
"//examples/helloworld/proto:go",
"//examples/helloworld/go/server:greeter",
Expand Down
16 changes: 8 additions & 8 deletions examples/helloworld/grpc_gateway/BUILD
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package(default_visibility = ["//visibility:public"])

load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_test")

load("//grpc_gateway:rules.bzl",
"grpc_gateway_proto_compile",
"grpc_gateway_proto_library",
"grpc_gateway_swagger_compile",
"grpc_gateway_binary",
"GRPC_GATEWAY_DEPS",
load(
"//grpc_gateway:rules.bzl",
"grpc_gateway_proto_compile",
"grpc_gateway_proto_library",
"grpc_gateway_swagger_compile",
"grpc_gateway_binary",
"GRPC_GATEWAY_DEPS",
)

# grpc_gateway_proto_library(
Expand All @@ -30,11 +30,11 @@ grpc_gateway_binary(
go_test(
name = "greeter_test",
size = "small",
tags = ["exclusive"],
srcs = [
"greeter.go",
"greeter_test.go",
],
tags = ["exclusive"],
deps = [
":gateway",
"//examples/helloworld/go/server:greeter",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ java_test(
name = "netty_test",
size = "small",
srcs = ["HelloWorldClientTest.java"],
tags = ["exclusive"],
test_class = "org.pubref.rules_protobuf.examples.helloworld.client.HelloWorldClientTest",
runtime_deps = [
"//java:netty_runtime_deps",
Expand Down
12 changes: 6 additions & 6 deletions examples/helloworld/node/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ load("@org_pubref_rules_node//node:rules.bzl", "node_binary")
node_binary(
name = "client",
main = "greeter_client.js",
deps = [
"//examples/helloworld/proto:node",
],
modules = [
"@npm_protobuf_stack//:modules",
"@npm_grpc//:modules",
],
deps = [
"//examples/helloworld/proto:node",
],
)

node_binary(
name = "server",
main = "greeter_server.js",
deps = [
"//examples/helloworld/proto:node",
],
modules = [
"@npm_protobuf_stack//:modules",
"@npm_grpc//:modules",
],
deps = [
"//examples/helloworld/proto:node",
],
)
86 changes: 47 additions & 39 deletions examples/helloworld/proto/BUILD
Original file line number Diff line number Diff line change
@@ -1,18 +1,41 @@
package(default_visibility = ["//visibility:public"])

load("//protobuf:rules.bzl", "proto_compile")
load("//cpp:rules.bzl", "cc_proto_library")
load("//csharp:rules.bzl", "csharp_proto_library")
load("//go:rules.bzl", "go_proto_library")
load("//gogo:rules.bzl", "gogo_proto_library")
load("//java:rules.bzl", "java_proto_library")
load("//csharp:rules.bzl", "csharp_proto_library")
load("//node:rules.bzl", "node_proto_library")
load("//objc:rules.bzl", "objc_proto_compile")
load("//protobuf:rules.bzl", "proto_compile")
load("//python:rules.bzl", "py_proto_compile")
load("//ruby:rules.bzl", "ruby_proto_compile")

filegroup(
name = "protos",
srcs = ["helloworld.proto"],
)

cc_proto_library(
name = "cpp",
proto_deps = [
"//examples/proto:cpp",
],
protos = [":protos"],
verbose = 0,
with_grpc = True,
)

csharp_proto_library(
name = "Helloworld",
proto_deps = [
"//examples/proto:csharp",
],
protos = [":protos"],
verbose = 0,
with_grpc = True,
)

go_proto_library(
name = "go",
proto_deps = [
Expand All @@ -23,6 +46,16 @@ go_proto_library(
with_grpc = True,
)

java_proto_library(
name = "java",
proto_deps = [
"//examples/proto:java",
],
protos = [":protos"],
verbose = 0,
with_grpc = True,
)

# Commented out as this conflicts with go (same output file).
#
# gogo_proto_library(
Expand All @@ -35,16 +68,6 @@ go_proto_library(
# with_grpc = True,
# )

cc_proto_library(
name = "cpp",
proto_deps = [
"//examples/proto:cpp",
],
protos = [":protos"],
verbose = 0,
with_grpc = True,
)

node_proto_library(
name = "node",
proto_deps = [
Expand All @@ -55,44 +78,29 @@ node_proto_library(
with_grpc = True,
)

java_proto_library(
name = "java",
proto_deps = [
"//examples/proto:java",
],
objc_proto_compile(
name = "objc",
protos = [":protos"],
with_grpc = True,
verbose = 0,
deps = [
"//examples/proto:objc",
],
)

proto_compile(
py_proto_compile(
name = "py",
langs = ["//python"],
protos = [":protos"],
with_grpc = True,
verbose = 1,
deps = [
"//examples/proto:py",
],
)

proto_compile(
ruby_proto_compile(
name = "ruby",
langs = ["//ruby"],
protos = [":protos"],
with_grpc = True,
)

proto_compile(
name = "objc",
langs = ["//objc"],
protos = [":protos"],
with_grpc = True,
)

csharp_proto_library(
name = "Helloworld",
proto_deps = [
"//examples/proto:csharp",
deps = [
"//examples/proto:ruby",
],
protos = [":protos"],
verbose = 0,
with_grpc = True,
)
Loading

0 comments on commit 0e65d2a

Please sign in to comment.