|
|
@@ -65,6 +65,8 @@ struct GRPCSwiftPlugin {
|
|
|
var server: Bool?
|
|
|
/// Whether client code is generated.
|
|
|
var client: Bool?
|
|
|
+ /// Whether reflection data is generated.
|
|
|
+ var reflectionData: Bool?
|
|
|
/// Determines whether the casing of generated function names is kept.
|
|
|
var keepMethodCasing: Bool?
|
|
|
}
|
|
|
@@ -186,6 +188,10 @@ struct GRPCSwiftPlugin {
|
|
|
protocArgs.append("--grpc-swift_opt=Client=\(generateClientCode)")
|
|
|
}
|
|
|
|
|
|
+ if let generateReflectionData = invocation.reflectionData {
|
|
|
+ protocArgs.append("--grpc-swift_opt=ReflectionData=\(generateReflectionData)")
|
|
|
+ }
|
|
|
+
|
|
|
if let keepMethodCasingOption = invocation.keepMethodCasing {
|
|
|
protocArgs.append("--grpc-swift_opt=KeepMethodCasing=\(keepMethodCasingOption)")
|
|
|
}
|
|
|
@@ -207,6 +213,14 @@ struct GRPCSwiftPlugin {
|
|
|
|
|
|
// Add the outputPath as an output file
|
|
|
outputFiles.append(protobufOutputPath)
|
|
|
+
|
|
|
+ if invocation.reflectionData == true {
|
|
|
+ // Remove .swift extension and add .reflection extension
|
|
|
+ file.removeLast(5)
|
|
|
+ file.append("reflection")
|
|
|
+ let reflectionOutputPath = outputDirectory.appending(file)
|
|
|
+ outputFiles.append(reflectionOutputPath)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// Construct the command. Specifying the input and output paths lets the build
|