Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rnro committed Jan 21, 2025
1 parent 86f8893 commit 15fbb1a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 10 additions & 3 deletions Plugins/GRPCProtobufGenerator/Plugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ struct GRPCProtobufGenerator {
baseDirectoryPath: configFilePath.deletingLastPathComponent(),
protoDirectoryPaths: protoDirectoryPaths,
protocPath: protocPath,
protocGenGRPCSwiftPath: protocGenGRPCSwiftPath
protocGenGRPCSwiftPath: protocGenGRPCSwiftPath,
configFilePath: configFilePath
)
commands.append(grpcCommand)
}
Expand Down Expand Up @@ -174,14 +175,16 @@ extension [URL: GenerationConfig] {
/// - protoDirectoryPaths: The paths passed to `protoc` in which to look for imported proto files.
/// - protocPath: The path to `protoc`
/// - protocGenGRPCSwiftPath: The path to `protoc-gen-grpc-swift`.
/// - configFilePath: The path to the config file in use.
/// - Returns: The command to invoke `protoc` with the `protoc-gen-grpc-swift` plugin.
func protocGenGRPCSwiftCommand(
inputFile: URL,
config: GenerationConfig,
baseDirectoryPath: URL,
protoDirectoryPaths: [String],
protocPath: URL,
protocGenGRPCSwiftPath: URL
protocGenGRPCSwiftPath: URL,
configFilePath: URL
) throws -> PackagePlugin.Command {
let outputPathURL = URL(fileURLWithPath: config.outputPath)

Expand All @@ -205,7 +208,11 @@ func protocGenGRPCSwiftCommand(
displayName: "Generating gRPC Swift files for \(inputFile.absoluteStringNoScheme)",
executable: protocPath,
arguments: arguments,
inputFiles: [inputFile, protocGenGRPCSwiftPath],
inputFiles: [
inputFile,
protocGenGRPCSwiftPath,
configFilePath,
],
outputFiles: [outputFilePath]
)
}
Expand Down
2 changes: 0 additions & 2 deletions Plugins/PluginsShared/PluginError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
* limitations under the License.
*/

import Foundation

enum PluginError: Error {
// Build plugin
case incompatibleTarget(String)
Expand Down

0 comments on commit 15fbb1a

Please sign in to comment.