|
|
|
@ -80,6 +80,7 @@ def _proto_gen_impl(ctx): |
|
|
|
|
srcs = ctx.files.srcs |
|
|
|
|
langs = ctx.attr.langs or [] |
|
|
|
|
out_type = ctx.attr.out_type |
|
|
|
|
enable_editions = ctx.attr.enable_editions |
|
|
|
|
deps = depset(direct = ctx.files.srcs) |
|
|
|
|
source_dir = _SourceDir(ctx) |
|
|
|
|
gen_dir = _GenDir(ctx).rstrip("/") |
|
|
|
@ -130,6 +131,8 @@ def _proto_gen_impl(ctx): |
|
|
|
|
generated_files = [] |
|
|
|
|
for src in srcs: |
|
|
|
|
args = [] |
|
|
|
|
if enable_editions: |
|
|
|
|
args.append("--experimental_editions") |
|
|
|
|
|
|
|
|
|
in_gen_dir = src.root.path == gen_dir |
|
|
|
|
if in_gen_dir: |
|
|
|
@ -231,6 +234,7 @@ Args: |
|
|
|
|
srcs: Protocol Buffers definition files (.proto) to run the protocol compiler |
|
|
|
|
against. |
|
|
|
|
deps: a list of dependency labels; must be other proto libraries. |
|
|
|
|
enable_editions: if true, sets the --experimental_editions flag. |
|
|
|
|
includes: a list of include paths to .proto files. |
|
|
|
|
protoc: the label of the protocol compiler to generate the sources. |
|
|
|
|
plugin: the label of the protocol compiler plugin to be passed to the protocol |
|
|
|
@ -247,6 +251,7 @@ _proto_gen = rule( |
|
|
|
|
attrs = { |
|
|
|
|
"srcs": attr.label_list(allow_files = True), |
|
|
|
|
"deps": attr.label_list(providers = [ProtoGenInfo]), |
|
|
|
|
"enable_editions": attr.bool(), |
|
|
|
|
"includes": attr.string_list(), |
|
|
|
|
"protoc": attr.label( |
|
|
|
|
cfg = "exec", |
|
|
|
@ -655,6 +660,7 @@ def _source_proto_library( |
|
|
|
|
protoc = Label("//:protoc"), |
|
|
|
|
testonly = None, |
|
|
|
|
visibility = ["//visibility:public"], |
|
|
|
|
enable_editions = False, |
|
|
|
|
**kwargs): |
|
|
|
|
"""Bazel rule to create generated protobuf code from proto source files for |
|
|
|
|
languages not well supported by Bazel yet. This will output the generated |
|
|
|
@ -699,6 +705,7 @@ def _source_proto_library( |
|
|
|
|
srcs = proto_deps, |
|
|
|
|
protoc = protoc, |
|
|
|
|
includes = includes, |
|
|
|
|
enable_editions = enable_editions, |
|
|
|
|
) |
|
|
|
|
full_deps.append(":%s_deps_genproto" % name) |
|
|
|
|
|
|
|
|
@ -712,6 +719,7 @@ def _source_proto_library( |
|
|
|
|
protoc = protoc, |
|
|
|
|
testonly = testonly, |
|
|
|
|
visibility = visibility, |
|
|
|
|
enable_editions = enable_editions, |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
native.filegroup( |
|
|
|
|