Quick and Nimble don't support Swift 3

Created on 15 Jun 2016  路  17Comments  路  Source: Quick/Quick

There are many changes in Swift 3. It will take some time to migrate Quick and Nimble to Swift 3. There are many projects which depend on Quick and Nimble. It's a big disadvantage that Quick and Nimble don't support Swift 3. It would be great that creating swift 3 branches for Quick and Nimble.

enhancement help wanted

Most helpful comment

I spent the morning hacking & slashing around, starting with @norio-nomura's fork and ended up with both Quick and Nimble building & passing all unit tests in Xcode 8 / Swift 3. I opened PRs against @norio-nomura's fork so he can integrate the changes into the "official" swift 3 WIP PR.

Here are my forks/branches in case you need to point Carthage at a working (ish?) set of Quick/Nimble in Xcode 8 / Swift 3:

Quick: https://github.com/liscio/Quick/tree/cl-swift-3-compatibility
Nimble: https://github.com/liscio/Nimble/tree/cl-swift3-compatibility

Hope this helps!

All 17 comments

Definitely agree. I won't be able to use Xcode 8 for a while, but I can use a Swift 3 toolchain and make sure Quick builds on that.

@Quick/contributors: Should we support both Swift 2.3 and Swift 3.0 at the same time, using compile-time version checks such as #if swift(>=3.0), or should we maintain separate branches? I think I'd prefer the former, but it might be super hard to pull off.

Note that @norio-nomura has been maintaining a branch with much of this work for a long time: https://github.com/Quick/Quick/pull/510

My understanding is that the changes in Swift 3.0 around the external parameter names make it _very_ difficult to expose an equivalent API to both language versions without branching. I'd be happy to be shown wrong about that though!

510 got stuck on difficulty of supporting swift package manager on darwin. 馃槵

Now, I updated #510.

  1. Swift 2.3/3.0 migration tool
    I have used Xcode 8 beta to converted a couple of projects to Swift 2.3 and Swift 3.0, it's convenient, it can save a lot of time. There are some cases that Xcode 8 can't handle, for instance, some protocols are updated and added more required methods, developers have to implement them manually.
  2. Swift 3.0 uses new API Design Guidelines
    There are many changes in Swift 3.0, and it makes developers possible to write swift code like English. There is no need to rewrite all of code, but new code could be written this way to improve clarity.

https://swift.org/documentation/api-design-guidelines/#fundamentals
https://developer.apple.com/videos/play/wwdc2016/403/

Should we change enums to lowercase?

@norio-nomura I think it's a good idea. It's once and for all, because the migrator is lowercasing enums declared by the user, to match them with the new guidelines.

I tried using migrator on Nimble, but I got many leakage of converting to lowercase on usage of enum's case. 馃槥

I think it could be caused by Deployment Target settings. To use Swift 3 but not Swift 2.3, I use OS X 10.11 as deployment target of Nimble-OSX.

I spent the morning hacking & slashing around, starting with @norio-nomura's fork and ended up with both Quick and Nimble building & passing all unit tests in Xcode 8 / Swift 3. I opened PRs against @norio-nomura's fork so he can integrate the changes into the "official" swift 3 WIP PR.

Here are my forks/branches in case you need to point Carthage at a working (ish?) set of Quick/Nimble in Xcode 8 / Swift 3:

Quick: https://github.com/liscio/Quick/tree/cl-swift-3-compatibility
Nimble: https://github.com/liscio/Nimble/tree/cl-swift3-compatibility

Hope this helps!

I updated my forks of Nimble and Quick.

Should we change enums to lowercase?

I didn't change enums to lowercase on them.

@liscio I have cloned your Quick and Nimble for Swift 3. I have built Quick and Nimble frameworks for macOS and I can execute test cases of my project in Swift 3. Thanks!
`Test Suite 'All tests' passed at 2016-06-25
Executed 5 tests, with 0 failures (0 unexpected) in 0.119 (0.120) seconds

Can you please tell me when should I expect Quick to work with Swift 3.0? It is crucial to me and my team :)

In Xcode 8 beta 2, https://github.com/Quick/Quick/pull/510 is already expected to work with Swift 3.0.
In Swift Package Manager on Linux, I can't tell when it would be.
In Swift Package Manager on OS X, I think it will not be.

Will Swift 2.3 be supported as well?

@hashier The latest versions of Quick and Nimble both support Swift 2.3. However, if you have a specific problem please be sure to open an issue on GitHub!

FYI: (I think I rather found a pods problem. Pod says it has version 0.9.3 but doesn't build. If I look at Quick tag 0.9.3 the source code is different than what I have locally _puzzled_. So in short Quick 0.9.3 works with Swift 2.3 for me as well, but apparently not when installed through pods)

Quick now supports Swift 3. Closing.

Was this page helpful?
0 / 5 - 0 ratings