File tree Expand file tree Collapse file tree 6 files changed +51
-3
lines changed
Expand file tree Collapse file tree 6 files changed +51
-3
lines changed Original file line number Diff line number Diff line change 11load ("//bzl:base/class.bzl" , BASE = "CLASS" )
22load ("//bzl:cpp/class.bzl" , CPP = "CLASS" )
3+ load ("//bzl:csharp/class.bzl" , CSHARP = "CLASS" )
34load ("//bzl:go/class.bzl" , GO = "CLASS" )
45load ("//bzl:python/class.bzl" , PYTHON = "CLASS" )
56load ("//bzl:ruby/class.bzl" , RUBY = "CLASS" )
@@ -10,6 +11,7 @@ load("//bzl:grpc_gateway/class.bzl", GATEWAY = "CLASS")
1011CLASSES = {
1112 BASE .name : BASE ,
1213 CPP .name : CPP ,
14+ CSHARP .name : CSHARP ,
1315 GATEWAY .name : GATEWAY ,
1416 JAVA .name : JAVA ,
1517 JAVANANO .name : JAVANANO ,
Original file line number Diff line number Diff line change 55| --- | --- |
66| ` csharp_proto_library ` | Generates and compiles protobuf source files. |
77
8- Support for C# is limited to the proto_compile rule. Semantics are
9- identical to ` cc_proto_compile ` .
8+ ** Experimental * . Support for C# is limited to the proto_compile rule.
9+ Semantics are identical to ` cc_proto_compile ` .
Original file line number Diff line number Diff line change 1+ load ("//bzl:base/class.bzl" , BASE = "CLASS" )
2+
3+ def csharp_library (** kwargs ):
4+ """Dummy implementation."""
5+ pass
6+
7+
8+ CLASS = struct (
9+ parent = BASE ,
10+ name = "csharp" ,
11+
12+ protobuf = struct (
13+ file_extensions = ["_pb.rb" ],
14+ compile_deps = [],
15+ ),
16+
17+ library = csharp_library ,
18+ )
Original file line number Diff line number Diff line change 1+ load ("//bzl:base/rules.bzl" , "proto_library" )
2+ load ("//bzl:protoc.bzl" , "implement" )
3+ load ("//bzl:csharp/class.bzl" , CSHARP = "CLASS" )
4+
5+ SPEC = [CSHARP ]
6+
7+ csharp_proto_compile = implement (SPEC )
8+
9+ def csharp_proto_library (name , ** kwargs ):
10+ proto_library (name ,
11+ proto_compile = csharp_proto_compile ,
12+ spec = SPEC ,
13+ ** kwargs )
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ def protobuf_repositories(
88 overrides = {},
99 verbose = 0 ,
1010 with_cpp = False ,
11+ with_csharp = False ,
1112 with_go = False ,
1213 with_java = False ,
1314 with_javanano = False ,
@@ -48,6 +49,8 @@ def protobuf_repositories(
4849
4950 if with_cpp :
5051 classes += ["cpp" ]
52+ if with_csharp :
53+ classes += ["csharp" ]
5154 if with_python :
5255 classes += ["python" ]
5356 if with_go :
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package(default_visibility = ["//visibility:public"])
33load ("//bzl:cpp/rules.bzl" , "cc_proto_library" )
44load ("//bzl:go/rules.bzl" , "go_proto_library" )
55load ("//bzl:ruby/rules.bzl" , "ruby_proto_library" )
6+ load ("//bzl:csharp/rules.bzl" , "csharp_proto_library" )
67
78filegroup (
89 name = "protos" ,
@@ -23,10 +24,21 @@ cc_proto_library(
2324 verbose = 1 ,
2425)
2526
26- # This must be called with ':rb.pb' due to lack of implementing library rule for the moment.
27+ # Work-in-progress. This must be called with ':rb.pb' due to lack of
28+ # implementing library rule for the moment.
2729#
2830ruby_proto_library (
2931 name = "rb" ,
3032 protos = [":protos" ],
3133 verbose = 1 ,
3234)
35+
36+ # Work-in-progress. This must be called with ':cs.pb' due to lack of
37+ # implementing library rule for the moment. It also gets placed in
38+ # the outdir directly rather than the package dir.
39+ #
40+ # csharp_proto_library(
41+ # name = "csharp",
42+ # protos = [":protos"],
43+ # verbose = 1,
44+ # )
You can’t perform that action at this time.
0 commit comments