Skip to content

Commit

Permalink
Add special-case import statement for FoundationNetworking if OS is l…
Browse files Browse the repository at this point in the history
…inux.
  • Loading branch information
Sichan Yoo committed Oct 31, 2023
1 parent 54b01c6 commit 81d8d71
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ class PresignerGenerator : SwiftIntegration {
val symbol = protoCtx.symbolProvider.toSymbol(protoCtx.service)
protoCtx.delegator.useFileWriter("./${ctx.settings.moduleName}/${symbol.name}.swift") { writer ->
renderPresignAPIInServiceClient(writer, symbol.name, op, inputType)
// Add special-case import statement for Linux
writer.write("// In Linux, Foundation.URLRequest is moved to FoundationNetworking.")
writer.write("#if canImport(FoundationNetworking)")
writer.write("import FoundationNetworking")
writer.write("#endif")
}
}
}
Expand Down

0 comments on commit 81d8d71

Please sign in to comment.