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

[Installer] Use user defined swift version #5540

Merged
merged 1 commit into from
Jul 5, 2016

Conversation

endocrimes
Copy link
Member

@endocrimes endocrimes commented Jun 19, 2016

Depends on CocoaPods/Core#342
Closes #5521


# TODO: Assert only 1 or 0 unique Swift Versions declared

declared_swift_versions.first
Copy link
Member

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

Copy link
Member

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 👍

Copy link

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.

Copy link
Member

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

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?

Copy link
Member

@orta orta Jun 22, 2016

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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh got it!

@segiddins
Copy link
Member

👍 this looks great @dantoml !

@endocrimes endocrimes changed the title [WIP] [Installer] Use user defined swift version [Installer] Use user defined swift version Jul 4, 2016
@endocrimes endocrimes force-pushed the dan_swift_version branch 2 times, most recently from efcdc1e to c8b5a86 Compare July 4, 2016 19:29
@@ -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
Copy link
Member

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 ?

Copy link
Member Author

@endocrimes endocrimes Jul 5, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@segiddins
Copy link
Member

point this back to core master and this is good to go!

@endocrimes endocrimes force-pushed the dan_swift_version branch 2 times, most recently from 3f4b31c to 021e753 Compare July 5, 2016 18:44
@orta
Copy link
Member

orta commented Jul 5, 2016

👍

@orta orta merged commit 4fdb40b into CocoaPods:master Jul 5, 2016
@endocrimes endocrimes deleted the dan_swift_version branch July 5, 2016 23: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.

5 participants