• Home
  • Raw
  • Download

Lines Matching +full:- +full:- +full:proto +full:- +full:path

3 load("@rules_proto//proto:defs.bzl", "ProtoInfo")
6 def _GetPath(ctx, path):
8 return ctx.label.workspace_root + "/" + path
10 return path
14 # bazel-out/local-fastbuild/genfiles/external/repo/foo
16 # ../repo/bazel-out/local-fastbuild/genfiles/foo
21 # We are using the fact that Bazel 0.4.4+ provides repository-relative paths
23 return ctx.genfiles_dir.path + (
28 # Either way, appending the source path to the genfiles dir works.
41 ret = [s[:-len(".proto")] + ".pb.h" for s in srcs]
43 ret += [s[:-len(".proto")] + ".grpc.pb.h" for s in srcs]
47 ret = [s[:-len(".proto")] + ".pb.cc" for s in srcs]
49 ret += [s[:-len(".proto")] + ".grpc.pb.cc" for s in srcs]
56 ret = [s[:-len(".proto")] + "_pb2.py" for s in srcs]
58 ret += [s[:-len(".proto")] + "_pb2_grpc.py" for s in srcs]
61 def _RelativeOutputPath(path, include, dest = ""):
63 return path
65 if not path.startswith(include):
66 fail("Include path %s isn't part of the path %s." % (include, path))
68 if include and include[-1] != "/":
70 if dest and dest[-1] != "/":
73 path = path[len(include):]
74 return dest + path
87 import_flags += ["-I" + source_dir]
89 import_flags += ["-I."]
93 import_flags += ["-I" + gen_dir]
98 if type(dep.proto.import_flags) == "list":
99 import_flags = depset(transitive=[import_flags], direct=dep.proto.import_flags)
101 import_flags = depset(transitive=[import_flags, dep.proto.import_flags])
102 if type(dep.proto.deps) == "list":
103 deps = depset(transitive=[deps], direct=dep.proto.deps)
105 deps = depset(transitive=[deps, dep.proto.deps])
109 proto = struct(
119 in_gen_dir = src.root.path == gen_dir
123 path = f.replace("-I", "")
124 import_flags_real.append("-I$(realpath -s %s)" % path)
130 args += [("--cpp_out=" + path_tpl) % gen_dir]
133 args += [("--python_out=" + path_tpl) % gen_dir]
142 if not lang and plugin.basename.startswith("protoc-gen-"):
143 lang = plugin.basename[len("protoc-gen-"):]
151 args += [("--plugin=protoc-gen-%s=" + path_tpl) % (lang, plugin.path)]
152 args += ["--%s_out=%s" % (lang, outdir)]
160 arguments = args + import_flags.to_list() + [src.path],
168 ["$(realpath %s)" % ctx.executable.protoc.path] + args +
175 "cd -",
178 if generated_out != out.path:
179 command += ";mv %s %s" % (generated_out, out.path)
190 proto = struct(
200 "deps": attr.label_list(providers = ["proto"]),
229 srcs: Protocol Buffers definition files (.proto) to run the protocol compiler
231 deps: a list of dependency labels; must be other proto libraries.
232 includes: a list of include paths to .proto files.
248 proto = struct(
250 …import_flags = ["-I{}".format(path) for dep in deps for path in dep.transitive_proto_path.to_list(…
276 """Bazel rule to create a C++ protobuf library from proto source files
284 srcs: the .proto files of the cc_proto_library.
288 include: a string indicating the include path of the .proto files.
291 when processing the proto files.
342 java_out = "lite:%s" % srcjar.path
346 args.add("--java_out", java_out)
352 "--descriptor_set_in",
359 args.add_all([src.path for src in dep.direct_sources])
363 args.add_all([src.path[offset:] for src in dep.direct_sources])
404 out = "lite:%s" % srcjar.path
408 args.add("--kotlin_out", out)
414 "--descriptor_set_in",
421 args.add_all([src.path for src in dep.direct_sources])
425 args.add_all([src.path[offset:] for src in dep.direct_sources])
470 strip_prefix: Path to the root of the files to copy.
505 """Bazel rule to create a Python protobuf library from proto source files
513 srcs: the .proto files of the py_proto_library.
519 include: a string indicating the include path of the .proto files.
524 when processing the proto files.