Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Unified Diff: tools/protoc_wrapper/protoc_wrapper.py

Issue 2388113003: Allow proto-path in the proto_library target (Closed)
Patch Set: feedback Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/protoc_wrapper/protoc_wrapper.py
diff --git a/tools/protoc_wrapper/protoc_wrapper.py b/tools/protoc_wrapper/protoc_wrapper.py
index 8eac88409c676381924f822e3d2fe924e696663a..6aa5101e5e9bd6e409f012c68a2bd62df5a43f07 100755
--- a/tools/protoc_wrapper/protoc_wrapper.py
+++ b/tools/protoc_wrapper/protoc_wrapper.py
@@ -74,6 +74,8 @@ def main(argv):
parser.add_argument("--proto-in-dir",
help="Base directory with source protos.")
+ parser.add_argument("--proto-path", action="append", default=[],
+ help="Base directory with imported protos.")
parser.add_argument("--cc-out-dir",
help="Output directory for standard C++ generator.")
parser.add_argument("--py-out-dir",
@@ -121,6 +123,9 @@ def main(argv):
]
protoc_cmd += ["--proto_path", proto_dir]
+ for extra_proto_dir in options.proto_path:
+ protoc_cmd += ["--proto_path", os.path.relpath(extra_proto_dir)]
+
protoc_cmd += [os.path.join(proto_dir, name) for name in protos]
ret = subprocess.call(protoc_cmd)
if ret != 0:
« third_party/protobuf/proto_library.gni ('K') | « third_party/protobuf/proto_library.gni ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698