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

Unified Diff: tools/protoc_wrapper/protoc_wrapper.py

Issue 2646123002: Option added to protobuf build for import directories (Closed)
Patch Set: Comments addressed. 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..7dffbb0ba9c633559386a730ae14e59e88b05684 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='*', default=[],
scottmg 2017/01/23 16:53:11 I have no idea why this script uses " everywhere,
Ramin Halavati 2017/01/24 08:38:33 Done.
+ help="Name of extra import directories for protos.")
scottmg 2017/01/23 16:53:11 nit; "Extra import directories for protos." would
xyzzyz 2017/01/23 17:53:56 Just like my comment in the other file, please ren
Ramin Halavati 2017/01/24 08:38:33 Done. Help corrected, name did not change as it no
parser.add_argument("protos", nargs="+",
help="Input protobuf definition file(s).")
@@ -122,6 +123,10 @@ def main(argv):
protoc_cmd += ["--proto_path", proto_dir]
protoc_cmd += [os.path.join(proto_dir, name) for name in protos]
+
+ for path in options.import_dir:
xyzzyz 2017/01/23 17:53:56 This loop should probably be between lines 124 and
Ramin Halavati 2017/01/24 08:38:33 Done.
+ protoc_cmd += ["--proto_path", path]
+
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