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

Unified Diff: tools/protoc_wrapper/protoc_wrapper.py

Issue 2646123002: Option added to protobuf build for import directories (Closed)
Patch Set: Created 3 years, 11 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..916508a2a06f7a15e38fed2e71f87d713e507ba8 100755
--- a/tools/protoc_wrapper/protoc_wrapper.py
+++ b/tools/protoc_wrapper/protoc_wrapper.py
@@ -89,7 +89,8 @@ def main(argv):
help="Standard C++ generator options.")
parser.add_argument("--include",
help="Name of include to insert into generated headers.")
-
+ parser.add_argument("--import-dir", nargs='*',
+ help="Name of include to insert into generated headers.")
xyzzyz 2017/01/20 18:27:40 Please update the help text.
Ramin Halavati 2017/01/23 14:27:06 Done.
parser.add_argument("protos", nargs="+",
help="Input protobuf definition file(s).")
@@ -122,6 +123,11 @@ def main(argv):
protoc_cmd += ["--proto_path", proto_dir]
protoc_cmd += [os.path.join(proto_dir, name) for name in protos]
+
+ if options.import_dir:
+ protoc_cmd += ["--proto_path"]
+ protoc_cmd += options.import_dir
xyzzyz 2017/01/20 18:27:40 Isn't options.import_dir a list? You should probab
Ramin Halavati 2017/01/23 14:27:06 Yes, it had to be changed into looping through the
+
ret = subprocess.call(protoc_cmd)
if ret != 0:
raise RuntimeError("Protoc has returned non-zero status: "
« 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