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

Add Swift Version to Podspec #57

Closed
khoogheem opened this issue Jan 5, 2019 · 7 comments
Closed

Add Swift Version to Podspec #57

khoogheem opened this issue Jan 5, 2019 · 7 comments
Assignees

Comments

@khoogheem
Copy link

khoogheem commented Jan 5, 2019

s.swift_version       = '4.0'

should be added to podSpec

@MaxDesiatov MaxDesiatov self-assigned this Jan 7, 2019
@MaxDesiatov
Copy link
Collaborator

Hi @khoogheem, many thanks for reporting this. Could you please clarify what specifically this addition to the podspec would improve? We currently have a .swift-version file that makes the Swift 4.2 requirement explicit. As far as I know, CocoaPods automatically picks up Swift version from this file, this was previously confirmed here and here.

My guest is that you might need to make XMLCoder work in a project that requires Swift 4.0, but can't support later versions, am I correct?

More details would greatly help in resolving this issue. Thanks.

@khoogheem
Copy link
Author

my understanding and from that read is that the .swift-version is just for lint and push to trunk.
The swift version inside of the spec helps with the target building version when bringing into projects

@MaxDesiatov
Copy link
Collaborator

Right, have you stumbled upon any problems with the way it is currently? Doesn't CocoaPods set the version for the integrated pod automatically to Swift 4.2?

@khoogheem
Copy link
Author

I am not sure what the current version that Pods sets as the automatic swift version. But this is something we have run into over the past. This change is a preventative change that ensures the pod is set to the correct version for Swift regardless of what the App or CocoaPod thinks.

@MaxDesiatov
Copy link
Collaborator

To clarify, I've never tested XMLCoder with Swift 4.0 or Swift 4.1 previously. Tests would almost certainly fail in 4.0 as they rely on Equatable implementations provided by the compiler, which became available in Swift 4.1. We might be ok with setting this value in the podspec to 4.1, but could you please clarify whether you've chosen specifically 4.0 in the initial report on purpose?

I'm not against adding it to the podspec, but we need to be sure it's the correct version. Also we'd need to run the tests against all possible versions. Adding s.swift_version = '4.2' instead of s.swift_version = '4.0' would make a lot of things easier.

@khoogheem
Copy link
Author

4.2 seems to make more sense.

Would then we also want to change that in the Package to use the 4.2 tools

MaxDesiatov added a commit that referenced this issue Jan 7, 2019
This sets Swift version to 4.2 for both SwiftPM and CocoaPods. A `swift test` run has been added to `.travis.yml`, which makes CI builds longer, but looks like it's the only way to make sure SwiftPM builds work and generate code coverage at the same time.

Resolves #57
@MaxDesiatov
Copy link
Collaborator

@khoogheem this is resolved in #60, which is going to be released in the imminent XMLCoder 0.3. Hope this works for you, please feel free to reopen this issue otherwise.

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

No branches or pull requests

2 participants