google / promises

Promises is a modern framework that provides a synchronization construct for Swift and Objective-C.
Apache License 2.0
3.8k stars 294 forks source link

Fix Xcode Swift 5 conversion warning #121

Closed AnderGoig closed 5 years ago

AnderGoig commented 5 years ago

After the update to Swift 5 the swift_version was deleted from PromisesSwift.podspec (70c337e196c81f795eedb5d7a42cf966f07cdc3d). But now, Xcode keeps showing the "Conversion to Swift 5 is available" warning:

Screenshot 2019-07-07 at 19 03 40

Putting it back will make the warning disappear.

googlebot commented 5 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

AnderGoig commented 5 years ago

I signed it!

googlebot commented 5 years ago

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

ghost commented 5 years ago

Hi Ander, Thank you for the PR!

Can you provide some more details on how you verified this? Xcode version? Swift version for project?

Also, did you test this with Xcode 10.1 and Swift 4.2 to make sure that specifying s.swift_version = '5.0' doesn't cause any issues for developers who are still using 4.2?

Another option could be to specify s.swift_versions = ['4.2', '5.0'], but may not be needed if swift_version = '5.0' doesn't cause any issues for devs still using 4.2.

Thank you!

AnderGoig commented 5 years ago

Hi @temrich,

You're right, I have tried with Xcode 10.1 and it won't work, I forgot this library still supports 4.2.

Also, specifying s.swift_versions = ['4.2', '5.0'] won't make so much difference, as developers using Swift 4.2, as far as I know, still will have to specify the Swift version in their Podfile's post_install, something like:

post_install do |installer|
    installer.pods_project.targets.each do |target|
        if ['PromisesSwift'].include? target.name
            target.build_configurations.each do |config|
                config.build_settings['SWIFT_VERSION'] = '4.2'
            end
        end
    end
end

So maybe it is not worth it at all, thanks for your help anyway!

ghost commented 5 years ago

Thank you for testing this out! I also think that swift_versions was recently added to CocoaPods, so would probably require developers to update to the latest version (some devs may not be able to do that).

AnderGoig commented 5 years ago

Yes, it was added on 1.7.0 (pretty recently). I'm closing this for now, thanks!

pxlRider commented 1 year ago

Hi, I have same issue when using Firebase which uses this package (through SPM). If looking at Package.swift file at top version is specified as // swift-tools-version:4.2 In file it should probably be swiftLanguageVersions: [.v4, .v4_2, .version("5")] line?