From a39ababb7cf8839d96b3347e0da87fbcc3d512e8 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Thu, 13 Aug 2015 12:01:41 +0100 Subject: Allow public access to descriptor.proto as a dependency. With this in place, generating APIs on github.com/google/googleapis works - previously annotations.proto failed. Currently there's no access to the annotations (stored as extensions) but we could potentially expose those at a later date. --- csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'csharp/src') diff --git a/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs index 500e467c..bad58faa 100644 --- a/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs @@ -368,5 +368,20 @@ namespace Google.Protobuf.Reflection { return "FileDescriptor for " + proto.Name; } + + /// + /// Returns the file descriptor for descriptor.proto. + /// + /// + /// This is used for protos which take a direct dependency on descriptor.proto, typically for + /// annotations. While descriptor.proto is a proto2 file, it is built into the Google.Protobuf + /// runtime for reflection purposes. The messages are internal to the runtime as they would require + /// proto2 semantics for full support, but the file descriptor is available via this property. The + /// C# codegen in protoc automatically uses this property when it detects a dependency on descriptor.proto. + /// + /// + /// The file descriptor for descriptor.proto. + /// + public static FileDescriptor DescriptorProtoFileDescriptor { get { return DescriptorProtoFile.Descriptor; } } } } \ No newline at end of file -- cgit v1.2.3