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

Unified Diff: build/protoc.gypi

Issue 9378041: Remove hand-rolled protobufs generation; enable rel paths in protoc.gypi (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: improve grammar and readability Created 8 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 | « no previous file | third_party/cacheinvalidation/cacheinvalidation.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/protoc.gypi
diff --git a/build/protoc.gypi b/build/protoc.gypi
index 555c5be45d29f3e0866eddc6aa996ec6a8a675ad..c19a05e025e35dd0463d0f019dd503f7ee9f60e4 100644
--- a/build/protoc.gypi
+++ b/build/protoc.gypi
@@ -43,6 +43,22 @@
'cc_dir': '<(SHARED_INTERMEDIATE_DIR)/protoc_out/<(proto_out_dir)',
'py_dir': '<(PRODUCT_DIR)/pyproto/<(proto_out_dir)',
'proto_in_dir%': '.',
+ 'proto_relpath%': '',
+ # protoc.gypi will place generated files into subdirectories based on the
Ryan Sleevi 2012/02/17 00:31:21 As per my previous comment, this should be placed
+ # relative path between proto_in_dir and the source protos. This is
+ # shown by the --proto_path usage below.
+ #
+ # proto_relpath exists because there are some protos which import
+ # using qualified paths, rather than the more common relative import.
+ # By using proto_relpath, projects can continue to use qualified imports
+ # instead of enforcing an import style through this gypi.
+ #
+ # For an example of such a proto implementation, see:
+ # third_party/cacheinvalidation/
+ #
+ # If provided, 'proto_relpath' must have a trailing slash, otherwise
+ # it will be concatenated with RULE_INPUT_ROOT in 'outputs' and
Ryan Sleevi 2012/02/17 00:31:21 You don't need the "otherwise" - it's an error to
+ # 'action' below.
},
'rules': [
{
@@ -52,16 +68,16 @@
'<(protoc)',
],
'outputs': [
- '<(py_dir)/<(RULE_INPUT_ROOT)_pb2.py',
- '<(cc_dir)/<(RULE_INPUT_ROOT).pb.cc',
- '<(cc_dir)/<(RULE_INPUT_ROOT).pb.h',
+ '<(py_dir)/<(proto_relpath)<(RULE_INPUT_ROOT)_pb2.py',
+ '<(cc_dir)/<(proto_relpath)<(RULE_INPUT_ROOT).pb.cc',
+ '<(cc_dir)/<(proto_relpath)<(RULE_INPUT_ROOT).pb.h',
],
'action': [
'<(protoc)',
'--proto_path=<(proto_in_dir)',
# Naively you'd use <(RULE_INPUT_PATH) here, but protoc requires
# --proto_path is a strict prefix of the path given as an argument.
- '<(proto_in_dir)/<(RULE_INPUT_ROOT)<(RULE_INPUT_EXT)',
+ '<(proto_in_dir)/<(proto_relpath)<(RULE_INPUT_ROOT)<(RULE_INPUT_EXT)',
'--cpp_out=<(cc_dir)',
'--python_out=<(py_dir)',
],
« no previous file with comments | « no previous file | third_party/cacheinvalidation/cacheinvalidation.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698