-
Notifications
You must be signed in to change notification settings - Fork 306
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 podspec #20
Add podspec #20
Conversation
Can one of the admins verify this patch? |
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.
Thanks for your PR! I can't take this right now yet because this claims version 0.0.1
but we haven't tagged a version yet (but will soon after Swift 5 gets released).
Regarding the podspec: Do we need to check the podspec in? We could just use a script like SwiftNIO does which automatically generates & uploads the podspecs with versions from SwiftPM. Otherwise we'll have to manage the versions in two places: the git tags for SwiftPM as well as the podspec file, no?
@weissi You generally need to check the podspec in because a Podfile can reference a git repo, in which case it will look in the root for a podspec.
|
@chrisballinger what’s wrong with the way NIO does it? The pods look just fine to me: https://cocoapods.org/pods/SwiftNIO The reason I don’t want to check it in is that there’s then two places for the version information: the git tags and the podspec and that’s not good. |
In addition to publishing the podspec in the spec repo, it is used for one more purpose: direct git pod integration. Right now, I'm referring to swift-log in my Podfile like so: pod 'Logging', git: 'https://github.com/igor-makarov/swift-log.git', branch: 'add-podspec' This way, the podspec is retrieved directly from the repo and the version tags are ignored, allowing for usage of latest dev version. |
9af83c0
to
42c32ce
Compare
Hi! It's been a long time but I've been recently doing similar integration with I think it covers all cases and is compatible with SwiftPM versioning, in a way. Let me know what you think! |
Wow, this looks great. I’m +1 on this. |
Thank you! |
Logging.podspec
Outdated
def self.infer_version_from_git | ||
return nil unless Dir.exist?('.git') | ||
|
||
`git tag --list '*.*.*' --sort=committerdate`.split.select do |tag| |
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.
Couldn’t we sort this ‘by version’? Just in case we tag 1.2.0 and later we need to add a 1.1.2. I think sort
can sort by version and git might be able to too?
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.
Thanks for pointing it out!
I've replaced it with a git command that correctly looks for the tags in the current commit tree only.
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.
This way if you have 1.2.0 and you later branch 1.1.2, if will get handled correctly.
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.
Thank you, looks great to me. You might want to remove the old build_podspec script or maybe have it just use this podspec.
I've removed the old podspec builder as suggested. |
Any updates on getting this merged? |
@weissi i know we added https://github.com/apple/swift-log/blob/master/scripts/build_podspec.sh instead, have we pushed the podspec? |
@danramteke / @tomerd yes, the podspec is live as cocoapods.org/pods/Logging |
@weissi thanks for the direct link. I was not able to find it by searching "logging" |
@danramteke yeah, the search indexer on the CP website broke a while ago, and because it's a volunteer project, nobody got around to fixing it yet. |
thanks @igor-makarov , I was wondering why it doesn't show up. |
can we close this since we are already publishing a pod? |
This is an improvement to the podspec, it removes the need for a separate script. |
@weissi do you prefer the script or the spec file? i dont have a strong opinion |
@tomerd definitely script because then there's one source of truth, right? The podspec needs to re-iterate the modules as well as the version number. So generating this from |
@tomerd actually, the podspec seems to be automatically detecting the version which we might be fine with. Still seems a little dangerous that you don't have to specify which version exactly to upload though. But better than nothing. |
I thought that it would be nice to avoid having a generator script. |
@igor-makarov well, the thing is that there might be new modules in the future. In that case we'd need to remember to change both the podspec and the |
The current generator doesn't read from My original problem was that if there's no podspec in the git repo, there's no way to integrate the latest |
0b1d450
to
f7a2c68
Compare
Did a rebase to clean up the commit history. |
@weissi This should be merged because even though the problem is semi-resolved by having a podspec version published to pod 'Logging', git: 'https://github.com/apple/swift-log.git', branch: 'master' |
Any updates on this? |
@weissi that sounds reasonable, would it infer the version as per this PR or would the script just have to be run after tagging a new version? |
Oh man, I forgot about the version :. Could it use |
Yes: inferring from git is one of the changes proposed by this PR. |
Cool! If we now get a generator script that generates exactly what this PR proposes and add that to the CI to double check it's not wrong, then I'm cool with this. |
we do version inference in the jazzy docs generation script, you can steal it from there |
Sounds good to me 👍 |
I'm going to be the bearer or news and close this ticket then I guess. 2 years ago, most of projects we maintain have stopped supporting CocoaPods - https://forums.swift.org/t/swiftnio-is-dropping-support-for-cocoapods/56840 - ever since SwiftPM and its ecosystem has kept growing, and we don't have the expertise to maintain pods to begin with. I'm going to close this PR given the above context and lack of action on it since a long time. |
because `Logging` framework no longer supports CocoaPods. See apple/swift-log#20.
because `Logging` framework no longer supports CocoaPods. See apple/swift-log#20.
Hi, this PR adds a
.podspec
file to the package.The podspec has been tested with a working app and is functioning.
I've also run
pod lib lint
which integrates the pod into a blank app target and executes its tests. This also passes.This closes #19.