| OLD | NEW |
| 1 // Protocol Buffers - Google's data interchange format | 1 // Protocol Buffers - Google's data interchange format |
| 2 // Copyright 2008 Google Inc. All rights reserved. | 2 // Copyright 2008 Google Inc. All rights reserved. |
| 3 // https://developers.google.com/protocol-buffers/ | 3 // https://developers.google.com/protocol-buffers/ |
| 4 // | 4 // |
| 5 // Redistribution and use in source and binary forms, with or without | 5 // Redistribution and use in source and binary forms, with or without |
| 6 // modification, are permitted provided that the following conditions are | 6 // modification, are permitted provided that the following conditions are |
| 7 // met: | 7 // met: |
| 8 // | 8 // |
| 9 // * Redistributions of source code must retain the above copyright | 9 // * Redistributions of source code must retain the above copyright |
| 10 // notice, this list of conditions and the following disclaimer. | 10 // notice, this list of conditions and the following disclaimer. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 syntax = "proto2"; | 47 syntax = "proto2"; |
| 48 package google.protobuf.compiler; | 48 package google.protobuf.compiler; |
| 49 option java_package = "com.google.protobuf.compiler"; | 49 option java_package = "com.google.protobuf.compiler"; |
| 50 option java_outer_classname = "PluginProtos"; | 50 option java_outer_classname = "PluginProtos"; |
| 51 | 51 |
| 52 option go_package = "plugin_go"; | 52 option go_package = "plugin_go"; |
| 53 | 53 |
| 54 import "google/protobuf/descriptor.proto"; | 54 import "google/protobuf/descriptor.proto"; |
| 55 | 55 |
| 56 // The version number of protocol compiler. |
| 57 message Version { |
| 58 optional int32 major = 1; |
| 59 optional int32 minor = 2; |
| 60 optional int32 patch = 3; |
| 61 // A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should |
| 62 // be empty for mainline stable releases. |
| 63 optional string suffix = 4; |
| 64 } |
| 65 |
| 56 // An encoded CodeGeneratorRequest is written to the plugin's stdin. | 66 // An encoded CodeGeneratorRequest is written to the plugin's stdin. |
| 57 message CodeGeneratorRequest { | 67 message CodeGeneratorRequest { |
| 58 // The .proto files that were explicitly listed on the command-line. The | 68 // The .proto files that were explicitly listed on the command-line. The |
| 59 // code generator should generate code only for these files. Each file's | 69 // code generator should generate code only for these files. Each file's |
| 60 // descriptor will be included in proto_file, below. | 70 // descriptor will be included in proto_file, below. |
| 61 repeated string file_to_generate = 1; | 71 repeated string file_to_generate = 1; |
| 62 | 72 |
| 63 // The generator parameter passed on the command-line. | 73 // The generator parameter passed on the command-line. |
| 64 optional string parameter = 2; | 74 optional string parameter = 2; |
| 65 | 75 |
| 66 // FileDescriptorProtos for all files in files_to_generate and everything | 76 // FileDescriptorProtos for all files in files_to_generate and everything |
| 67 // they import. The files will appear in topological order, so each file | 77 // they import. The files will appear in topological order, so each file |
| 68 // appears before any file that imports it. | 78 // appears before any file that imports it. |
| 69 // | 79 // |
| 70 // protoc guarantees that all proto_files will be written after | 80 // protoc guarantees that all proto_files will be written after |
| 71 // the fields above, even though this is not technically guaranteed by the | 81 // the fields above, even though this is not technically guaranteed by the |
| 72 // protobuf wire format. This theoretically could allow a plugin to stream | 82 // protobuf wire format. This theoretically could allow a plugin to stream |
| 73 // in the FileDescriptorProtos and handle them one by one rather than read | 83 // in the FileDescriptorProtos and handle them one by one rather than read |
| 74 // the entire set into memory at once. However, as of this writing, this | 84 // the entire set into memory at once. However, as of this writing, this |
| 75 // is not similarly optimized on protoc's end -- it will store all fields in | 85 // is not similarly optimized on protoc's end -- it will store all fields in |
| 76 // memory at once before sending them to the plugin. | 86 // memory at once before sending them to the plugin. |
| 77 repeated FileDescriptorProto proto_file = 15; | 87 repeated FileDescriptorProto proto_file = 15; |
| 88 |
| 89 // The version number of protocol compiler. |
| 90 optional Version compiler_version = 3; |
| 78 } | 91 } |
| 79 | 92 |
| 80 // The plugin writes an encoded CodeGeneratorResponse to stdout. | 93 // The plugin writes an encoded CodeGeneratorResponse to stdout. |
| 81 message CodeGeneratorResponse { | 94 message CodeGeneratorResponse { |
| 82 // Error message. If non-empty, code generation failed. The plugin process | 95 // Error message. If non-empty, code generation failed. The plugin process |
| 83 // should exit with status code zero even if it reports an error in this way. | 96 // should exit with status code zero even if it reports an error in this way. |
| 84 // | 97 // |
| 85 // This should be used to indicate errors in .proto files which prevent the | 98 // This should be used to indicate errors in .proto files which prevent the |
| 86 // code generator from generating correct code. Errors which indicate a | 99 // code generator from generating correct code. Errors which indicate a |
| 87 // problem in protoc itself -- such as the input CodeGeneratorRequest being | 100 // problem in protoc itself -- such as the input CodeGeneratorRequest being |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 // command line. | 154 // command line. |
| 142 // | 155 // |
| 143 // If |insertion_point| is present, |name| must also be present. | 156 // If |insertion_point| is present, |name| must also be present. |
| 144 optional string insertion_point = 2; | 157 optional string insertion_point = 2; |
| 145 | 158 |
| 146 // The file contents. | 159 // The file contents. |
| 147 optional string content = 15; | 160 optional string content = 15; |
| 148 } | 161 } |
| 149 repeated File file = 15; | 162 repeated File file = 15; |
| 150 } | 163 } |
| OLD | NEW |