Skip to content

Conversation

@ratranqu
Copy link

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.


import XCTest

#if !swift(>=3.0)
Copy link
Owner

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)

Copy link
Author

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

Copy link
Owner

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

@ratranqu
Copy link
Author

Actually... swift(<3.0) doesn't seem to be legal... will revert to !swift(=>3.0)...

@Danappelxx
Copy link

I think the most clear one is #if swift(>=2.2). Instead of saying "if
it's not 3.0", it's saying "if it's 2.2 or less" which seems to be the most
clear (and legal) way.

@ratranqu
Copy link
Author

ratranqu commented Apr 1, 2016

@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.

@Danappelxx
Copy link

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.

@kylef
Copy link
Owner

kylef commented Apr 1, 2016

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.
@kylef
Copy link
Owner

kylef commented Apr 4, 2016

@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.

@ratranqu
Copy link
Author

ratranqu commented Apr 4, 2016

@kylef: Thx. I've also submitted a PR for CatchingFire this morning.

@kylef
Copy link
Owner

kylef commented Jul 19, 2016

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 .travis.yml:

env:
- SWIFT_VERSION=2.2.1
- SWIFT_VERSION=3.0-PREVIEW-2

Along with the following to switch to Linux:

language: generic
sudo: required
dist: trusty

@ratranqu
Copy link
Author

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.

On 19 Jul 2016, at 23:54, Kyle Fuller [email protected] wrote:

Looks like not activity at all on mrackwitz/CatchingFire#5 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 https://github.com/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 .travis.yml:

env:

  • SWIFT_VERSION=2.2.1
  • SWIFT_VERSION=3.0-PREVIEW-2
    Along with the following to switch to Linux:

language: generic
sudo: required
dist: trusty

You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub #15 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/AQPPLYIUHyVHy59eFlmbn0BTEN4mjSAHks5qXUezgaJpZM4H84ec.

@kylef
Copy link
Owner

kylef commented Sep 13, 2016

Now that Swift 3.0 is out (in GM). I've finished this up via #19.

Thanks for your work here @ratranqu.

@kylef kylef closed this Sep 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants