forked from rules-proto-grpc/rules_proto_grpc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test repo for issue rules-proto-grpc#25
- Loading branch information
1 parent
65b3876
commit ca22d03
Showing
5 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package(default_visibility = ["//visibility:private"]) | ||
|
||
load("@rules_proto_grpc//cpp:defs.bzl", "cpp_proto_library") | ||
|
||
# Use the same base proto in two different trees. The rules should not tread | ||
# on each other and try to write the same file. | ||
|
||
proto_library( | ||
name = "proto_lib_a", | ||
srcs = ["common.proto"], | ||
deps = ["@com_google_protobuf//:descriptor_proto"], | ||
) | ||
|
||
proto_library( | ||
name = "proto_lib_b", | ||
srcs = ["demo.proto"], | ||
deps = [":proto_lib_a"], | ||
) | ||
|
||
cpp_proto_library( | ||
name = "cpp_lib_a", | ||
deps = ["proto_lib_a"], | ||
) | ||
|
||
cpp_proto_library( | ||
name = "cpp_lib_b", | ||
deps = ["proto_lib_b"], | ||
) | ||
|
||
cc_test( | ||
name = "test", | ||
srcs = ["test.cc"], | ||
deps = [ | ||
# Depend on both -- this is typically due to a "diamond" pattern in | ||
# some other transitive include graph, rather than "direct" redundant | ||
# dependencies. | ||
"cpp_lib_a", | ||
"cpp_lib_b", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
local_repository( | ||
name = "rules_proto_grpc", | ||
path = "../../", | ||
) | ||
|
||
load("@rules_proto_grpc//:repositories.bzl", "rules_proto_grpc_toolchains", "rules_proto_grpc_repos") | ||
rules_proto_grpc_toolchains() | ||
rules_proto_grpc_repos() | ||
|
||
load("@rules_proto_grpc//cpp:repositories.bzl", "cpp_repos") | ||
cpp_repos() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
syntax = "proto3"; | ||
|
||
import "google/protobuf/descriptor.proto"; | ||
|
||
extend google.protobuf.MethodOptions { | ||
bool foo = 50001; | ||
} | ||
|
||
message CommonProto{ | ||
string field = 1; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
syntax = "proto3"; | ||
|
||
import "common.proto"; | ||
|
||
message demo { | ||
CommonProto field = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include "demo.pb.h" | ||
|
||
int main() { | ||
demo x; | ||
return x.ByteSize(); | ||
} |