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

Unified Diff: third_party/protobuf2/protobuf.gyp

Issue 1763023: Re-apply http://codereview.chromium.org/1622012 (Closed)
Patch Set: Add missing files (I thought git would do that) Created 10 years, 8 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/protobuf2/descriptor_pb2.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/protobuf2/protobuf.gyp
diff --git a/third_party/protobuf2/protobuf.gyp b/third_party/protobuf2/protobuf.gyp
index 95272e9cdffa99ef1ef86bdb2f56dfec6fa6b2cc..c812d52f6261d11040084a0e1d3d0b20fe5ecfcf 100644
--- a/third_party/protobuf2/protobuf.gyp
+++ b/third_party/protobuf2/protobuf.gyp
@@ -78,6 +78,7 @@
'defines': [
'GOOGLE_PROTOBUF_NO_RTTI',
],
+
'direct_dependent_settings': {
'include_dirs': [
'<(config_h_dir)',
@@ -218,6 +219,86 @@
'src/src',
],
},
+ {
+ # Generate the python module needed by all protoc-generated Python code.
+ 'target_name': 'py_proto',
+ 'type': 'none',
+ 'copies': [
+ {
+ 'destination': '<(PRODUCT_DIR)/pyproto/google/',
+ 'files': [
+ # google/ module gets an empty __init__.py.
+ '__init__.py',
+ ],
+ },
+ {
+ 'destination': '<(PRODUCT_DIR)/pyproto/google/protobuf',
+ 'files': [
+ 'src/python/google/protobuf/__init__.py',
+ 'src/python/google/protobuf/descriptor.py',
+ 'src/python/google/protobuf/message.py',
+ 'src/python/google/protobuf/reflection.py',
+ 'src/python/google/protobuf/service.py',
+ 'src/python/google/protobuf/service_reflection.py',
+ 'src/python/google/protobuf/text_format.py',
+
+ # TODO(ncarter): protoc's python generator treats descriptor.proto
+ # specially, but it's not possible to trigger the special treatment
+ # unless you run protoc from ./src/src (the treatment is based
+ # on the path to the .proto file matching a constant exactly).
+ # I'm not sure how to convince gyp to execute a rule from a
+ # different directory. Until this is resolved, use a copy of
+ # descriptor_pb2.py that I manually generated.
+ 'descriptor_pb2.py',
+ ],
+ },
+ {
+ 'destination': '<(PRODUCT_DIR)/pyproto/google/protobuf/internal',
+ 'files': [
+ 'src/python/google/protobuf/internal/__init__.py',
+ 'src/python/google/protobuf/internal/containers.py',
+ 'src/python/google/protobuf/internal/decoder.py',
+ 'src/python/google/protobuf/internal/encoder.py',
+ 'src/python/google/protobuf/internal/generator_test.py',
+ 'src/python/google/protobuf/internal/message_listener.py',
+ 'src/python/google/protobuf/internal/type_checkers.py',
+ 'src/python/google/protobuf/internal/wire_format.py',
+ ],
+ },
+ ],
+ # # We can't generate a proper descriptor_pb2.py -- see earlier comment.
+ # 'rules': [
+ # {
+ # 'rule_name': 'genproto',
+ # 'extension': 'proto',
+ # 'inputs': [
+ # '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)',
+ # ],
+ # 'variables': {
+ # # The protoc compiler requires a proto_path argument with the
+ # # directory containing the .proto file.
+ # 'rule_input_relpath': 'src/src/google/protobuf',
+ # },
+ # 'outputs': [
+ # '<(PRODUCT_DIR)/pyproto/google/protobuf/<(RULE_INPUT_ROOT)_pb2.py',
+ # ],
+ # 'action': [
+ # '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)',
+ # '-I./src/src',
+ # '-I./src',
+ # '--python_out=<(PRODUCT_DIR)/pyproto/google/protobuf',
+ # 'google/protobuf/descriptor.proto',
+ # ],
+ # 'message': 'Generating Python code from <(RULE_INPUT_PATH)',
+ # },
+ # ],
+ # 'dependencies': [
+ # 'protoc#host',
+ # ],
+ # 'sources': [
+ # 'src/src/google/protobuf/descriptor.proto',
+ # ],
+ },
],
}
« no previous file with comments | « third_party/protobuf2/descriptor_pb2.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698