-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[Installer] Use user defined swift version #5540
Conversation
|
||
# TODO: Assert only 1 or 0 unique Swift Versions declared | ||
|
||
declared_swift_versions.first |
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.
If I had a user project with 3 targets, two on 2.3
and 1 on 3.0
won't this always pick up the first in the set? As it goes back to the global list in the user project, and then makes a list of them all, and all their targets.
Perhaps a select
after .flat_map(&:native_targets)
to scope it to only the initially named targets?
This may also have to assert if they have different swift values too alas
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.
Which you did kinda cover in that comment 👍
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.
@orta @dantoml Just wanted to point out that, according to Apple's blog post on the matter, an app cannot use Swift 2.3 and 3.0 together, due to the binary incompatibility. First, Swift 2.3 and Swift 3 are not binary compatible so your app's entire code base needs to pick one version of Swift.
So I'm thinking this can really just be a check of whatever version of Swift the project is using can be set on all of the pods.
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.
An app can't but CocoaPods can set up targets across multiple apps, and Xcode projects - so it's feasible that you could have 2.3 and 3.0 in the same codebase
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.
@orta, are you saying there's a way for a single app to use a Swift 2.3 pod and a Swift 3.0 pod simultaneously? How would the podfile be structured?
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.
No, it's not possible, LLVM does not allow that.
It's possible that an app uses 3.0 and extension could use 2.3 - they would be in the same xcodeproject. Assuming they shared source-compatible swift... Which is a use case I was saying might be worth being aware of.
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.
Ahh got it!
c927693
to
810fbf4
Compare
1453f58
to
8d2e058
Compare
👍 this looks great @dantoml ! |
9da5ed5
to
7c3de25
Compare
efcdc1e
to
c8b5a86
Compare
@@ -32,6 +32,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre` | |||
[Mark Schall](https://github.com/maschall) | |||
[#5572](https://github.com/CocoaPods/CocoaPods/pull/5572) | |||
|
|||
* [Installer] Use user defined swift version |
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.
Set the SWIFT_VERSION for CocoaPods-generated targets
?
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.
👍
c8b5a86
to
7aa8c4b
Compare
point this back to core master and this is good to go! |
3f4b31c
to
021e753
Compare
021e753
to
0ea0d99
Compare
👍 |
…om target being integrated into. See: <CocoaPods/CocoaPods#5540>. See: <ikesyo/Himotoki@7c539c4>.
Depends on CocoaPods/Core#342
Closes #5521