[PR #429] [MERGED] Enable swift build by SwiftPM #628

Closed
opened 2026-03-03 16:49:48 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/OAuthSwift/OAuthSwift/pull/429
Author: @koher
Created: 1/11/2018
Status: Merged
Merged: 1/13/2018
Merged by: @phimage

Base: masterHead: enable-swiftpm


📝 Commits (1)

  • 415253c Fix Package.swift for Swift 4

📊 Changes

1 file changed (+9 additions, -1 deletions)

View changed files

📝 Package.swift (+9 -1)

📄 Description

It enables swift build.

Currently swift build fails for the master branch ( 9a8536d8a8 ). Package.swift needs to be updated.

$ swift build
Compile Swift Module 'OAuthSwift' (24 sources)
/path/to/OAuthSwift/Sources/OAuthSwiftURLHandlerType.swift:36:25: error: method 'shared' was used as a property; add () to call it
            NSWorkspace.shared.open(url)
                        ^
                              ()
/path/to/OAuthSwift/Sources/OAuthSwiftHTTPRequest.swift:239:42: error: 'filter' is unavailable
            finalParameters = parameters.filter { key, _ in !key.hasPrefix("oauth_") }
                                         ^~~~~~
Swift.Dictionary:390:17: note: 'filter' was introduced in Swift 4.0
    public func filter(_ isIncluded: (Dictionary.Element) throws -> Bool) rethrows -> [Dictionary.Key : Dictionary.Value]
                ^
/path/to/OAuthSwift/Sources/OAuthWebViewController.swift:123:52: error: argument labels '(rawValue:)' do not match any available overloads
                    p.performSegue(withIdentifier: NSStoryboardSegue.Identifier(rawValue: segueIdentifier), sender: self) // The segue must display self.view
                                                   ^                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~
/path/to/OAuthSwift/Sources/OAuthWebViewController.swift:123:52: note: overloads for 'NSStoryboardSegue.Identifier' exist with these partially matching parameter lists: (coder: NSCoder), (stringLiteral: StaticString), (format: NSString, CVarArg...), (string: NSString), (utf8String: UnsafePointer<Int8>), (UTF8String: UnsafePointer<Int8>), (string: String), (contentsOfFile: String), (contentsOf: URL), (contentsOfURL: URL), (cString: UnsafePointer<Int8>), (CString: UnsafePointer<Int8>)
                    p.performSegue(withIdentifier: NSStoryboardSegue.Identifier(rawValue: segueIdentifier), sender: self) // The segue must display self.view
                                                   ^
error: terminated(1): /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /path/to/OAuthSwift/.build/debug.yaml main

NOTE: Even after this PR is merged, swift test still fails to build the tests because it lacks dependencies on Swifter and Erik. Although I tried to add those dependencies to Package.swift,

  • OAuthSwift/swifter could not be built by SwiftPM
  • original httpswift/swifter could be build by Swift PM, but I am not sure if it is OK to change the dependency
  • Erik could not be build by SwiftPM

and so I gave up.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/OAuthSwift/OAuthSwift/pull/429 **Author:** [@koher](https://github.com/koher) **Created:** 1/11/2018 **Status:** ✅ Merged **Merged:** 1/13/2018 **Merged by:** [@phimage](https://github.com/phimage) **Base:** `master` ← **Head:** `enable-swiftpm` --- ### 📝 Commits (1) - [`415253c`](https://github.com/OAuthSwift/OAuthSwift/commit/415253c7ea1b1115c0390ebde333651f739a312b) Fix Package.swift for Swift 4 ### 📊 Changes **1 file changed** (+9 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `Package.swift` (+9 -1) </details> ### 📄 Description It enables `swift build`. Currently `swift build` fails for the `master` branch ( 9a8536d8a8f9d6673fe622f9bfb59e9c79334bcb ). Package.swift needs to be updated. ``` $ swift build Compile Swift Module 'OAuthSwift' (24 sources) /path/to/OAuthSwift/Sources/OAuthSwiftURLHandlerType.swift:36:25: error: method 'shared' was used as a property; add () to call it NSWorkspace.shared.open(url) ^ () /path/to/OAuthSwift/Sources/OAuthSwiftHTTPRequest.swift:239:42: error: 'filter' is unavailable finalParameters = parameters.filter { key, _ in !key.hasPrefix("oauth_") } ^~~~~~ Swift.Dictionary:390:17: note: 'filter' was introduced in Swift 4.0 public func filter(_ isIncluded: (Dictionary.Element) throws -> Bool) rethrows -> [Dictionary.Key : Dictionary.Value] ^ /path/to/OAuthSwift/Sources/OAuthWebViewController.swift:123:52: error: argument labels '(rawValue:)' do not match any available overloads p.performSegue(withIdentifier: NSStoryboardSegue.Identifier(rawValue: segueIdentifier), sender: self) // The segue must display self.view ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~ /path/to/OAuthSwift/Sources/OAuthWebViewController.swift:123:52: note: overloads for 'NSStoryboardSegue.Identifier' exist with these partially matching parameter lists: (coder: NSCoder), (stringLiteral: StaticString), (format: NSString, CVarArg...), (string: NSString), (utf8String: UnsafePointer<Int8>), (UTF8String: UnsafePointer<Int8>), (string: String), (contentsOfFile: String), (contentsOf: URL), (contentsOfURL: URL), (cString: UnsafePointer<Int8>), (CString: UnsafePointer<Int8>) p.performSegue(withIdentifier: NSStoryboardSegue.Identifier(rawValue: segueIdentifier), sender: self) // The segue must display self.view ^ error: terminated(1): /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /path/to/OAuthSwift/.build/debug.yaml main ``` **NOTE:** Even after this PR is merged, `swift test` still fails to build the tests because it lacks dependencies on Swifter and Erik. Although I tried to add those dependencies to Package.swift, - OAuthSwift/swifter could not be built by SwiftPM - original httpswift/swifter could be build by Swift PM, but I am not sure if it is OK to change the dependency - Erik could not be build by SwiftPM and so I gave up. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 16:49:48 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/OAuthSwift#628
No description provided.