Browse Source

Drop the '.txt' extension from reflection data (#1731)

Motivation:

Generated reflection data has a ".txt" extension. This isn't quite right
as the contents is base64 encdoded data. Moreover the generated
reflection data is intended as an implementation detail for the
reflection service.

Modifications:

- Change the generated reflection data extension from
  ".grpc.reflection.txt" to ".grpc.reflection".
- Fix a bug in the reflection server example where resources couldn't be
  loaded because no subdirectory was provided

Result:

Generated reflection data files don't have a ".txt" extension
George Barnett 2 years ago
parent
commit
a28f763d71
1 changed files with 2 additions and 2 deletions
  1. 2 2
      Sources/protoc-gen-grpc-swift/main.swift

+ 2 - 2
Sources/protoc-gen-grpc-swift/main.swift

@@ -144,11 +144,11 @@ func main(args: [String]) throws {
       if options.generateReflectionData {
         var binaryFile = Google_Protobuf_Compiler_CodeGeneratorResponse.File()
         let binaryFileName = uniqueOutputFileName(
-          component: "grpc.reflection",
+          component: "grpc",
           fileDescriptor: fileDescriptor,
           fileNamingOption: options.fileNaming,
           generatedFiles: &generatedFiles,
-          extension: "txt"
+          extension: "reflection"
         )
         let serializedFileDescriptorProto = try fileDescriptor.proto.serializedData()
           .base64EncodedString()