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

Unified Diff: tools/protoc_wrapper/protoc_wrapper.py

Issue 2324823002: Reorder protobuf compiler command line arguments. (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | 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 26f3e3d5ba4bb60e73ffc28a26b1207c0b0d36be..8eac88409c676381924f822e3d2fe924e696663a 100755
--- a/tools/protoc_wrapper/protoc_wrapper.py
+++ b/tools/protoc_wrapper/protoc_wrapper.py
@@ -96,15 +96,15 @@ def main(argv):
options = parser.parse_args()
proto_dir = os.path.relpath(options.proto_in_dir)
- protoc_cmd = [
- os.path.realpath(options.protoc),
- "--proto_path", proto_dir
- ]
+ protoc_cmd = [os.path.realpath(options.protoc)]
protos = options.protos
headers = []
VerifyProtoNames(protos)
+ if options.py_out_dir:
+ protoc_cmd += ["--python_out", options.py_out_dir]
+
if options.cc_out_dir:
cc_out_dir = options.cc_out_dir
cc_options = FormatGeneratorOptions(options.cc_options)
@@ -113,9 +113,6 @@ def main(argv):
stripped_name = StripProtoExtension(filename)
headers.append(os.path.join(cc_out_dir, stripped_name + ".pb.h"))
- if options.py_out_dir:
- protoc_cmd += ["--python_out", options.py_out_dir]
-
if options.plugin_out_dir:
plugin_options = FormatGeneratorOptions(options.plugin_options)
protoc_cmd += [
@@ -123,6 +120,7 @@ def main(argv):
"--plugin_out", plugin_options + options.plugin_out_dir
]
+ protoc_cmd += ["--proto_path", proto_dir]
protoc_cmd += [os.path.join(proto_dir, name) for name in protos]
ret = subprocess.call(protoc_cmd)
if ret != 0:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698