Commit Graph

26 Commits

Author SHA1 Message Date
vam db7fd70166 Fix examples (forgot to rename usages of the renamed target) 2019-05-06 10:44:34 -07:00
vam f4affeec66 Merge remote-tracking branch 'upstream/master' 2019-05-03 16:49:50 -07:00
vam 4269ce08f4 Make cc_grpc_library compatible with native proto_library and cc_proto_library rules.
This is needed to comply with bazel best practices (each proto file is first processed by proto_library: https://docs.bazel.build/versions/master/be/protocol-buffer.html#proto_library) and generally bring cc_grcp_library rule up to date with latest Bazel changes (the rule hasn't gotten much updates since 2016).

Detailed description.

Bazel has native `cc_proto_library` rule, but it does not have `cc_grpc_library`. The rule in cc_grpc_library in this repo seems like the best candidate.

This change makes possible using `cc_grpc_library` to generate on grpc library, and consume protobuf protion as dependencies. The typical `BUILD.bazel` file configuraiton now should look like the following:

```python
proto_library(
   name = "my_proto",
   srcs = ["my.proto"],
 )

cc_proto_library(
   name = "my_cc_proto",
   deps = [":my_proto"]
)

cc_grpc_library(
    name = "my_cc_grpc",
    srcs = [":my_proto"],
    deps = [":my_cc_proto"]
)
```

This allows to decouple all thre phases: proto descriptors generation (`proto_library`), protobuf messages library creation (`cc_proto_library`), grpc library creatio (`cc_grpc_library`).

Notice how `cc_grpc_library` depends on `proto_library` (as `src`) and on `cc_proto_library` (as `deps`). Currently cc_grpc_library is designed in a way that it encapsulates all of the above and directly accepts .proto files as srcs.

The previous version (before this PR) of cc_proto_library was encapsulating all of the 3 phases inside single `cc_proto_library` and also was doing it manually (without relying on the native `cc_proto_library`).

The `cc_proto_library` is kept backward-compatible with the old version.
2019-05-03 16:43:54 -07:00
Richard Belleville 930cec4e27 Revert "Merge pull request #18912 from grpc/revert-bazel-changes"
This reverts commit c9a259aa3a, reversing
changes made to 9c882bc725.
2019-04-30 11:17:11 -07:00
Richard Belleville 50b5240d0a Revert "Merge pull request #18859 from grpc/internal_py_proto_library"
This reverts commit 5b720f19c1, reversing
changes made to a64ae3c0d5.
2019-04-29 17:47:56 -07:00
Richard Belleville 05f37c8143 Remove dependency on pubref/rules_proto.
This commit resolves #18331.
This commit resolves #18256.
This commit resolves... another TODO that apparently didn't have an
associated github issue.

We swap out pubref's implementation of py_proto_library with our own,
which more closely mirrors the interface of the internal
py_proto_library, taking the descriptor file output of a proto_library
rule as input.

One minor change in behavior was introduced for simplicity. When a
py_proto_library depends on a proto_library with a source proto file in
a subdirectory of the bazel package, the import module of the resultant
python library will reflect the package, *not* the full directory of the
proto file, including both the bazel package and the subdirectories, as
pubref did previously. This behavior also more closely mirrors google
internal behavior.

This commit also introduces a slightly more stringent bazel format
script. Buildifier on its own will not take care of long lines, but by
running yapf first, we end up with a more legible file. At the moment,
there is no sanity check associated with this formatter.
2019-04-24 17:36:08 -07:00
rmstar 82040c8d77
Merge pull request #17727 from rmstar/examples_bazel
Added bazel build targets for cpp examples
2019-03-28 22:11:19 -07:00
Prashant Jaikumar 4f2d8a0014 Fix bazel build for examples
Fixed the bazel build for some code in the examples directory.
2019-03-28 18:59:14 -07:00
Lidi Zheng d7429dbb4a Fix the proto rules conflict 2019-03-25 14:18:35 -07:00
Yash Tibrewal 6e94552a30 Add a caching interceptor to the keyvaluestore example 2019-01-10 17:00:49 -08:00
Yash Tibrewal 7a5a9544ef Add a naive client server implementation 2019-01-10 13:20:30 -08:00
Yash Tibrewal 9f85ead667 Add new proto in examples 2019-01-09 12:07:44 -08:00
Juanli Shen 1600fde6b6 Add Bazel targets for compression example 2018-12-19 12:22:00 -08:00
Juanli Shen c771009320 Merge remote-tracking branch 'upstream/master' into lb_example 2018-12-19 10:43:18 -08:00
Juanli Shen 33a4b502c4 Add LB example 2018-12-19 10:40:13 -08:00
hcaseyal 93151145c2
Revert "Revert "Metadata tutorial"" 2018-12-17 12:09:11 -08:00
Juanli Shen 951254151b
Revert "Metadata tutorial" 2018-12-17 10:12:50 -08:00
Hope Casey-Allen 580d43d03f Address reviewer comments and remove binary files 2018-12-14 14:19:40 -08:00
Vijay Pai dd0f006416 Fix examples build file 2017-11-28 11:53:55 -08:00
Nicolas "Pixel" Noble 5d80dc4985 Merge branch 'master' of https://github.com/grpc/grpc into import 2017-06-26 22:01:11 +02:00
Jan Tattermusch 7897ae9308 auto-fix most of licenses 2017-06-08 11:22:41 +02:00
Craig Tiller a753371f05 Rework well_known_protos attr, and some other fixes 2017-05-16 13:09:33 -07:00
Nicolas "Pixel" Noble d2ac59f1aa Merge failure: mangled the examples BUILD file. 2017-05-12 17:19:46 +02:00
Nicolas "Pixel" Noble eb36b8ac77 Merge branch 'master' of https://github.com/grpc/grpc into import 2017-05-11 23:24:37 +02:00
Makarand Dharmapurikar be0fb725f6 fixed target name so bazel basic build passes 2017-04-24 16:22:49 -07:00
Makarand Dharmapurikar 4c0620b7df consolidated BUILD files from example into one
it is also a way to test that this change works as expected.
2017-04-18 09:48:08 -07:00