-
Notifications
You must be signed in to change notification settings - Fork 174
Added support for swift 3.0 (DEVELOPMENT-SNAPSHOT-2016-03-24-a) #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
||
| import XCTest | ||
|
|
||
| #if !swift(>=3.0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using a negative, what about about using a different comparison? I think this is more readable and clear.
#if swift(<3.0)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used #if !swift(>=3.0) because that's what seems to be common in other reps. I think the rational is that when you only have some typealias to do, you want to clean the bulk of the code to comply to the latest version, so that it's cheaper to clean when you want to drop the older version.
continuing to use that style for the other cases was a matter of consistency.
if you still prefer the #if swift(<3.0), I think keeping the other way for typealias is best. what do you think?
EDIT: forget my remark abt keeping the other way... :-o
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I just noticed this change is for the dependency CatchingFire. The changes would need to be made there and released to be added here. https://github.com/mrackwitz/CatchingFire
…ixed indentation changes.
|
Actually... swift(<3.0) doesn't seem to be legal... will revert to !swift(=>3.0)... |
|
I think the most clear one is |
|
@Danappelxx what needs to be expressed is that for any version above or equal to 3.0, the api changes apply. So using swift(>=2.2) will not work. For instance, if version 2.2.1 is released, the code will break. |
|
You should be worrying about backwards compatibility, not forwards. What you said about 2.2.1 is also wrong, the comparison only checks for major and minor version (not patch). It's definitely a matter of opinion, though - up to Kyle to make the final decision. |
|
I think the 3.0 check is better, since there could be a Swift 2.3 which would be syntax compatible with Swift 2.2. |
…24-a. The issues are due to Foundation not having been updated to the same level on the Linux platform.
|
@ratranqu I'm going to find some time one evening soon to make the tests run on Linux during CI, I'd like to test on Linux and both Swift 2.x and 3.x to ensure they both work before we move forward. |
|
@kylef: Thx. I've also submitted a PR for CatchingFire this morning. |
|
Looks like not activity at all on mrackwitz/CatchingFire#5. Anyway, I've made some changes to master to be able to run the tests on Linux and refactored some things. Would you be interested in rebasing this over from master and updating @ratranqu? If not I can take over. We can now support testing on Linux in CI using multiple versions of Swift. We can add the following to env:
- SWIFT_VERSION=2.2.1
- SWIFT_VERSION=3.0-PREVIEW-2Along with the following to switch to Linux: language: generic
sudo: required
dist: trusty |
|
if you’re willing to wait a few weeks, I will do it. I don’t want to commit to anything sooner as I’m pretty busy atm. else, please to take over. let me know.
|
Hi,
I added support for swift 3.0 (DEVELOPMENT-SNAPSHOT-2016-03-24-a) using macros checking the swift version, so should work both with 2.2 and (current) 3.0 dev.
Changes are mostly about keeping up with the swift-3-api-guidelines induced changes.