Make buildable when using SPM in XCode 11#784
Make buildable when using SPM in XCode 11#784designatednerd merged 2 commits intoapollographql:masterfrom cheif:update-package-swift
Conversation
|
@cheif: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/ |
|
@cheif I have not seen this error in my usage of the betas - is this on a brand new project or on an existing project? |
|
@designatednerd I'm not the PR author, but I get the reported error on a brand new project. |
|
It’s on an existing project for me, I’ve been looking into migrating from CocoaPods to SPM with the arrival of a stable XCode 11. |
|
Bizarre! I wonder why this wasn't showing up in any of the betas. However, I don't see how these changes can hurt, so let's do this. |
|
Yeah, I agree that it's strange that it didn't show up in the betas, but maybe they were always building with swift 5.1 or something, since even if this could be built with swift 4.0, it wouldn't be possible to link against it from swift 5.1 due to the lack of module stability. |
I tried adding apollo to our project using SPM in XCode 11 and got some build issues.
The first issue was due to the swift version being specified to 4.0 in
Package.swift, making XCode trying to build this with the old toolchain, leading to a build error at:apollo-ios/Sources/Apollo/GraphQLHTTPResponseError.swift
Line 39 in beb6127
Due to this depending on the nil-coalescing feature in swift 5.0, changing the
swift-tools-versioninPackage.swiftfixes this.When this was fixed I got some build-errors due to
Foundationnot being imported in two files, so I added this as well.