Skip to content

Commit 15fbb1a

Browse files
committed
review comments
1 parent 86f8893 commit 15fbb1a

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

Plugins/GRPCProtobufGenerator/Plugin.swift

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ struct GRPCProtobufGenerator {
9797
baseDirectoryPath: configFilePath.deletingLastPathComponent(),
9898
protoDirectoryPaths: protoDirectoryPaths,
9999
protocPath: protocPath,
100-
protocGenGRPCSwiftPath: protocGenGRPCSwiftPath
100+
protocGenGRPCSwiftPath: protocGenGRPCSwiftPath,
101+
configFilePath: configFilePath
101102
)
102103
commands.append(grpcCommand)
103104
}
@@ -174,14 +175,16 @@ extension [URL: GenerationConfig] {
174175
/// - protoDirectoryPaths: The paths passed to `protoc` in which to look for imported proto files.
175176
/// - protocPath: The path to `protoc`
176177
/// - protocGenGRPCSwiftPath: The path to `protoc-gen-grpc-swift`.
178+
/// - configFilePath: The path to the config file in use.
177179
/// - Returns: The command to invoke `protoc` with the `protoc-gen-grpc-swift` plugin.
178180
func protocGenGRPCSwiftCommand(
179181
inputFile: URL,
180182
config: GenerationConfig,
181183
baseDirectoryPath: URL,
182184
protoDirectoryPaths: [String],
183185
protocPath: URL,
184-
protocGenGRPCSwiftPath: URL
186+
protocGenGRPCSwiftPath: URL,
187+
configFilePath: URL
185188
) throws -> PackagePlugin.Command {
186189
let outputPathURL = URL(fileURLWithPath: config.outputPath)
187190

@@ -205,7 +208,11 @@ func protocGenGRPCSwiftCommand(
205208
displayName: "Generating gRPC Swift files for \(inputFile.absoluteStringNoScheme)",
206209
executable: protocPath,
207210
arguments: arguments,
208-
inputFiles: [inputFile, protocGenGRPCSwiftPath],
211+
inputFiles: [
212+
inputFile,
213+
protocGenGRPCSwiftPath,
214+
configFilePath,
215+
],
209216
outputFiles: [outputFilePath]
210217
)
211218
}

Plugins/PluginsShared/PluginError.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
import Foundation
18-
1917
enum PluginError: Error {
2018
// Build plugin
2119
case incompatibleTarget(String)

0 commit comments

Comments
 (0)