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

Unified Diff: tools/protoc_wrapper/protoc_wrapper.py

Issue 2646123002: Option added to protobuf build for import directories (Closed)
Patch Set: Warning added. Created 3 years, 10 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
« no previous file with comments | « third_party/protobuf/proto_library.gni ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..6a25de0ed5a367cfffea3fae8dc436dc355d1f49 100755
--- a/tools/protoc_wrapper/protoc_wrapper.py
+++ b/tools/protoc_wrapper/protoc_wrapper.py
@@ -89,7 +89,9 @@ 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", action="append", default=[],
+ help="Extra import directory for protos, can be repeated."
+ )
parser.add_argument("protos", nargs="+",
help="Input protobuf definition file(s).")
@@ -121,7 +123,11 @@ def main(argv):
]
protoc_cmd += ["--proto_path", proto_dir]
+ for path in options.import_dir:
+ protoc_cmd += ["--proto_path", path]
+
protoc_cmd += [os.path.join(proto_dir, name) for name in protos]
+
ret = subprocess.call(protoc_cmd)
if ret != 0:
raise RuntimeError("Protoc has returned non-zero status: "
« no previous file with comments | « third_party/protobuf/proto_library.gni ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698