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

Improve determination whether a pod supports Swift Package Manager (SPM) #29

Open
MattLewin opened this issue Feb 10, 2017 · 5 comments

Comments

@MattLewin
Copy link

I originally submitted this issue against https://github.com/CocoaPods/cocoapods.org, but I realize this is probably the more appropriate repo. I'll close it over there. Sorry for any confusion.

When preparing my new pod for submission to the master spec repo, I wanted to support the SPM if possible. My pod is for iOS and uses UIKit. Last I had checked, the SPM did not support packages for anything but host platforms. (i.e., macOS and Linux) (SO post)

To my surprise, I found T-Pham/UILocalNotification-RemotePayload, which, according to its quality page, supports the SPM.

Given that UILocalNotification-RemotePayload relies upon UIKit, I was super-excited that the SPM might now support iOS packages. I spent the next hour confirming (repeatedly) that it still does not.

What does this mean?

Well, my conclusion is that the author of UILocalNotification-RemotePayload dropped a "Package.swift" file into his repo so that he could get an extra 10 "quality points."

While I won't comment on his gaming the system, I will point out that this kind of activity undermines the effectiveness of the Cocoapods quality metrics.

In addition -- and more important, in my mind -- this kind of thing leads to confusion for people discovering the repo. As was the case when I discovered this repo with its Package.swift, it can easily lead to someone thinking the SPM now supports iOS. That can, in turn, trigger a wild goose chase trying to determine why your own package doesn't seem to work with the SPM.

I propose we improve the quality metrics code to withhold the 10 points granted for supporting the SPM for projects that cannot possibly support it. As of today (2017-02-10), this means any projects that target iOS, watchOS, and tvOS. I think it may also mean any Cocoa apps, too, but I haven't tried that.

@orta
Copy link
Member

orta commented Feb 13, 2017

Personally I'd rather be encouraging best practices (which SwiftPM support is and will be more important in the future) even if it's being abused occasionally.

Once SwiftPM becomes more usable, I'm happy for someone to improve CocoaDocs to actually run swiftpm on the project like we do for Carthage support.

@kylef
Copy link
Contributor

kylef commented Feb 14, 2017

I do believe it would be possible to use Swift PM in conjunction with iOS. It's not 100% straightforward and I have been planning to write a blog post about it after exploring it further. You should be able to use the generated Xcode project from Swift PM to integrate the framework as a sub project. I've been successful with a initial POC.

@orta
Copy link
Member

orta commented Feb 14, 2017

👍 it's looking pretty soon that product-types like iOS apps will be built into SwiftPM too, swiftlang/swift-package-manager#953

@MattLewin
Copy link
Author

MattLewin commented Feb 14, 2017 via email

@MattLewin
Copy link
Author

MattLewin commented Feb 14, 2017 via email

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

3 participants