Move descriptor.proto to google/protobuf directory where it belongs.
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>
Wed, 12 Feb 2014 17:43:04 +0000 (19:43 +0200)
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>
Wed, 12 Feb 2014 17:43:04 +0000 (19:43 +0200)
This fixes some interoperability problems when trying to compile
nanopb.proto for e.g. the Google's C++ library.

Update issue 104
Status: FixedInGit

generator/nanopb_generator.py
generator/proto/Makefile
generator/proto/google/protobuf/descriptor.proto [moved from generator/proto/descriptor.proto with 100% similarity]
generator/proto/nanopb.proto
generator/proto/plugin.proto

index 2f2e853..7c60ebe 100755 (executable)
@@ -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)
     
index ee1390a..89bfe52 100644 (file)
@@ -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=. $<
index 2ea011f..2be2f80 100644 (file)
@@ -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";
 
index d8b515e..651ed10 100644 (file)
@@ -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 {