Updating for swift 4.x and Xcode 10.1#295
Conversation
|
I have a |
|
@AliSoftware let me know if you have any issues with this or if there's anything I can do to get travis running. |
AliSoftware
left a comment
There was a problem hiding this comment.
Thanks a lot for the PR!
This seems file at first (only looked at it in GitHub web UI for now), so except the point I was wondering about for LaunchKey, should be good to go.
PS: Note though that tbh, I've fallen back a little on my maintenance on OHHTTPStubs lately, with some prior PRs that should have been ready to merge for a while, but for which I haven't found time to check everything and revalidate them to release an official version yet… So I might need to find the time to merge those older PRs first, then do a 6.x. release with their changes, to finally merge yours afterwards (which would indeed bump to 7.0); so might take a few days for me to find the time where I can have a Mac nearby and do all that properly 😉
There was a problem hiding this comment.
I haven't tested, but I think this change would need a extension UIApplication { typealias LaunchOptionKey = UIApplicationLaunchOptionKey } inside some #if swift(>…) to be able to still work with older Swift versions which did not have the new namespacing of that type before?
|
Note that for some time now, Travis-CI hasn't been very reliable on OHHTTPStubs especially due to some timing tests randomly failing (depending on the CI CPU speed I think), but also sometimes travis failing to kick in and trigger the VM and tests… (I'm willing to migrate to CircleCI for a while but didn't yet). It's always fun to have to regularly restart the CI jobs when that happens, so don't be too surprised by that CI state, it might not be related to your PR specifically… |
|
This totally makes sense @AliSoftware . Let me know if I can help with any of this. FYI - I read the Xcode 10.2 beta release notes today, and Swift 3 won't be supported.
|
|
Hey @AliSoftware @jeffctown, what's left here to get this one merged in? |
|
👋 @sunshinejr . I'm happy to help out, but I'm waiting on next steps from @AliSoftware. Since the existing code compiles fine in Swift 4.2, once I updated my test target to Swift 4.2 and ran |
|
@AliSoftware Maybe I can help on this one too? Xcode 10.2 is coming closer very fast would be a shame to have to stick to 10.1 because of our beloved OHHTTPStubs :) |
|
I have to be honest I just started a new job, in a new country… so pretty swamped those days in it's not gonna get better until a few weeks I think. I happy to hand over and give push access to anyone willing to help, so if you're interested in becoming a co-maintainer and help with merging PRs and doing releases I'll be happy to make it happen so that someone can make those move forward while I'm busy 😅 |
@AliSoftware totally understandable. I’d be happy to help merge and release. Sent with GitHawk |
|
@jeffctown Just added you as contributor with push access ;) I trust you'll review other pending PRs too (checking if some need to be merged first before this one? then rebase this one, etc) so everything is ready for release 👍 |
Updating for version 7.0.0. Updating to swift 4.2 (but retaining compatibility with swift 2.3 & 3x & 4.x. Updating deployment target to iOS 8.0 since Xcode 10.1 doesn’t support iOS 7 anymore. Updating example projects. Updating README badges. Updating CHANEGLOG. Updating Rakefile for Xcode 10.1.
| [](https://github.com/Carthage/Carthage) | ||
| [](https://travis-ci.org/AliSoftware/OHHTTPStubs) | ||
| [](https://swift.org) | ||
| [](https://swift.org) |
There was a problem hiding this comment.
At that point maybe it's not worth it to list them all as it'll get pretty long 😅, maybe just 2.3 to 4.2 or 2.x & 3.x & 4.x?
There was a problem hiding this comment.
Here is something i wonder about. Why/How many Swift Versions should be kept? IMHO: Its not worth to keep so many Versions around. If someone needs an older Swift Version they can get an older Version of OHHTTPStubs?
| * Updating project settings for Xcode 10.1. | ||
| [@jeffctown](https://github.com/jeffctown) | ||
| * Updating example projects for new version. | ||
| [@jeffctown](https://github.com/jeffctown) |
There was a problem hiding this comment.
Might be nice to also reference all the people who submitted a PR for updating to all those successive Xcode/Swift versions (even though we ended up not merging then because I was so late on my OSS time to merge them but since they made the effort…)
| [self setImageView:nil]; | ||
| [self setDelaySwitch:nil]; | ||
| [super viewDidUnload]; | ||
| } |
|
|
||
| target 'OHHTTPStubs iOS Lib Tests' do | ||
| platform :ios, '7.0' | ||
| platform :ios, '8.0' |
There was a problem hiding this comment.
We should mention that minimum certain requirement bump in the CHANGELOG too, after all it's a breaking change
|
|
||
| ## [Future Release] | ||
|
|
||
| * Updating default Swift Version to 4.2, but keeping code compiling in Swift 2.3, 3.x, and 4.x. |
There was a problem hiding this comment.
Would be interesting to mention that only 4.x+ is tested on CI so 2.3 compatibility for example isn't guaranteed by tests and might break at any time because we don't test it anymore.
(Might actually be simpler to just drop the mention of 2.x altogether anyway and stop mentioning it tbh)
There was a problem hiding this comment.
Updated in c9b28c9. I went with the path of removing 2.x mentions.
| * either use an older Xcode version | ||
| * or use the previous version of `OHHTTPStubs` (6.2.0) — whose `master` branch uses `3.0` | ||
| * or fork the repo just to change the `SWIFT_VERSION` build setting to `3.0` | ||
|
|
There was a problem hiding this comment.
Might also add well remove the paragraph about 2.3 too here and make that paragraph about 3.x just replace it (instead of being in addition of it).
Also I'm not sure we did Swift-3.x branches back in the day, branches was just used during the 2 to 3 transition. So might just as well start that paragraph directly with "If you want…"
AliSoftware
left a comment
There was a problem hiding this comment.
Apart from the last nitpick LGTM
| typealias LaunchOptionsKey = UIApplication.LaunchOptionsKey | ||
| #else | ||
| typealias LaunchOptionsKey = UIApplicationLaunchOptionsKey | ||
| #endif |
There was a problem hiding this comment.
I usually only declare the typealias for old versions so that by the time we drop those old version we'll only have to delete the typealias 😉
#if !swift(>=4.0)
extension UIApplication {
typealias LaunchOptionKey = UIApplicationLaunchOptionKey
}
#endifThere was a problem hiding this comment.
Good point. Updated.
Updating for version 7.0.0.
Updating to swift 4.2 (but retaining compatibility with swift 2.3 & 3x & 4.x.
Updating deployment target to iOS 8.0 since Xcode 10.1 doesn’t support iOS 7 anymore.
Updating example projects.
Updating README badges.
Updating CHANEGLOG.
Updating Rakefile for Xcode 10.1.
Checklist
Description
Updated for Swift 4.x and Xcode 10.1.
Motivation and Context
This change resolves compilation issues for projects using Swift 4.x and Xcode 10.1. The current version of Xcode (10.1) also does not support iOS 7, so I removed support for that.
I tested this change by compiling the two examples projects and running them to make sure they function as before. I also ran all 3 sets of unit tests.