Skip to content
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

Fix the build issues when using the Xcode 9 GM. #55

Closed

Conversation

ehyche
Copy link

@ehyche ehyche commented Sep 14, 2017

This change fixes this issue: #51

The build issues include:

  • KeyPath class was added in Swift 4, which collides with the KeyPath defined in JSONUtilies.
    This was fixed by disambiguating the type by specifying "JSONUtilities.KeyPath" instead of just "KeyPath".
  • DecodingError was added in Swift 4, which collides with DecodingError defined in JSONUtilities.
    This was fixed by disambiguating the type by specifying "JSONUtilities.DecodingError" instead of just "DecodingError".
  • There were several places where xcodeproj was expecint [String] and the code was calling it with Set. Apparently this worked in Swift 3.2, but no longer works in Swift 4. So these places were corrected by:
    • Not creating a Set() when an array was needed
    • Calling .sorted() on the Set to produce an array

The build issues include:

- KeyPath class was added in Swift 4, which collides with the KeyPath defined in JSONUtilies.
  This was fixed by disambiguating the type by specifying "JSONUtilities.KeyPath" instead of just "KeyPath".
- DecodingError was added in Swift 4, which collides with DecodingError defined in JSONUtilities.
  This was fixed by disambiguating the type by specifying "JSONUtilities.DecodingError" instead of just "DecodingError".
- There were several places where xcodeproj was expecint [String] and the code was calling it with Set<String>. Apparently this worked in Swift 3.2, but no longer works in Swift 4. So these places were corrected by:
  - Not creating a Set() when an array was needed
  - Calling .sorted() on the Set to produce an array
@yonaskolb
Copy link
Owner

Thanks for the PR @ehyche! Unfortunately you're about an hour late! 😄
The Swift 4 #52 has already been merged.

In terms of the xcodeproj changes, that's because you must have linked to a new version as Swift 4 doesn't read Package.pins anymore so it upgraded itself. I noticed that as well and actually locked it to the previous version in that PR. I'm now going to do the xcodeproj update

@yonaskolb yonaskolb closed this Sep 14, 2017
@ehyche
Copy link
Author

ehyche commented Sep 14, 2017

@yonaskolb : Wow - I looked at the open PRs before I started mine, but I guess you had already merged by then!

By the way, I also noticed that Spectre also did not build on Swift4, so I submitted a PR against that project to fix it: kylef/Spectre#29. However, it looks like there was already a PR open since June to fix the same issues. So I'm not sure if that project is still being maintained or not.

@yonaskolb
Copy link
Owner

Spectre builds ok for me. There are some warnings in Swift 4 which is what I think you're referring to, but that's not a breaking issue for this repo 👍

@yonaskolb
Copy link
Owner

The upgrade to xcodeproj 0.1.2 has also now been merged in #56

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.

2 participants