diff options
author | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2014-02-12 19:43:04 +0200 |
---|---|---|
committer | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2014-02-12 19:43:04 +0200 |
commit | 542463dbaa3acae564e4a1eddf264e1fe226c38a (patch) | |
tree | cfca5d64513f55663fde253a104916dc316ae310 | |
parent | fe0bf121eb606d9accbc0fc8be6b1ff6fd5f6f27 (diff) |
Move descriptor.proto to google/protobuf directory where it belongs.
This fixes some interoperability problems when trying to compile
nanopb.proto for e.g. the Google's C++ library.
Update issue 104
Status: FixedInGit
-rwxr-xr-x | generator/nanopb_generator.py | 4 | ||||
-rw-r--r-- | generator/proto/Makefile | 2 | ||||
-rw-r--r-- | generator/proto/google/protobuf/descriptor.proto (renamed from generator/proto/descriptor.proto) | 0 | ||||
-rw-r--r-- | generator/proto/nanopb.proto | 2 | ||||
-rw-r--r-- | generator/proto/plugin.proto | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/generator/nanopb_generator.py b/generator/nanopb_generator.py index 2f2e8531..7c60ebe9 100755 --- a/generator/nanopb_generator.py +++ b/generator/nanopb_generator.py @@ -15,6 +15,7 @@ except: try: import google.protobuf.text_format as text_format + import google.protobuf.descriptor_pb2 as descriptor except: sys.stderr.write(''' ************************************************************* @@ -26,7 +27,7 @@ except: try: import proto.nanopb_pb2 as nanopb_pb2 - import proto.descriptor_pb2 as descriptor + import proto.plugin_pb2 as plugin_pb2 except: sys.stderr.write(''' ******************************************************************** @@ -1070,7 +1071,6 @@ def main_plugin(): msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY) msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) - import proto.plugin_pb2 as plugin_pb2 data = sys.stdin.read() request = plugin_pb2.CodeGeneratorRequest.FromString(data) diff --git a/generator/proto/Makefile b/generator/proto/Makefile index ee1390a5..89bfe528 100644 --- a/generator/proto/Makefile +++ b/generator/proto/Makefile @@ -1,4 +1,4 @@ -all: nanopb_pb2.py plugin_pb2.py descriptor_pb2.py +all: nanopb_pb2.py plugin_pb2.py %_pb2.py: %.proto protoc --python_out=. $< diff --git a/generator/proto/descriptor.proto b/generator/proto/google/protobuf/descriptor.proto index a785f79f..a785f79f 100644 --- a/generator/proto/descriptor.proto +++ b/generator/proto/google/protobuf/descriptor.proto diff --git a/generator/proto/nanopb.proto b/generator/proto/nanopb.proto index 2ea011f4..2be2f803 100644 --- a/generator/proto/nanopb.proto +++ b/generator/proto/nanopb.proto @@ -5,7 +5,7 @@ // These are used by nanopb to generate statically allocable structures // for memory-limited environments. -import "descriptor.proto"; +import "google/protobuf/descriptor.proto"; option java_package = "fi.kapsi.koti.jpa.nanopb"; diff --git a/generator/proto/plugin.proto b/generator/proto/plugin.proto index d8b515e3..651ed10c 100644 --- a/generator/proto/plugin.proto +++ b/generator/proto/plugin.proto @@ -46,7 +46,7 @@ package google.protobuf.compiler; -import "descriptor.proto"; +import "google/protobuf/descriptor.proto"; // An encoded CodeGeneratorRequest is written to the plugin's stdin. message CodeGeneratorRequest { |