-
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
Add ability to specify source with each dependency #4486
Conversation
f172105
to
6469b10
Compare
I didn't see a specific existing issue regarding this enhancement. There's some discussion here, and I can file a new issue if you want one. |
No need to file an issue |
How does this handle transitive dependencies? |
👍 this is a great improvement! |
@segiddins Transitive dependencies are handled like so:
The simplest way to summarize is that it has the exact same behavior as a podspec given using :podspec or :path. Podfile dependencies get resolved first and are cached and reused for all subsequent requirements. One small thing I noticed: as mentioned, the resolver relies on caching to make sure dependency resolutions are consistent. This works fine when calling To illustrate:
I would expect the resolver to give me back the Spec from the local path, but instead it will actually use the sources passed to the resolver constructor instead. If you call Again, I think this is all fine, but I figured I'd call it out. Root cause here seems to be that |
Also, the code has a dependency on CocoaPods/Core#278, so the tests should go green once we can point them at that. It looks like everything is pegged to HEAD, so is the standard development flow to merge the other PR first? |
6469b10
to
9959bb4
Compare
You'll need to point the Gemfile in this repo to your Core PR so the tests here can pass. |
@aggregates_by_repos ||= {} | ||
|
||
# Use the cached version if it exists. | ||
if result = @aggregates_by_repos[repos] |
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.
all this can be replaced with @aggregates_by_repos[repos] ||= Source::Aggregate.new(repos)
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.
Fixed
fa9358e
to
f2ee737
Compare
@@ -62,6 +62,19 @@ module Pod | |||
@analyzer.update_repositories | |||
end | |||
|
|||
it 'does not update sources if there are no dependencies' do |
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 is a small optimization that came along with my changes. If a Podfile has no dependencies specified, then it won't bother updating any of the sources. This seems safe to me, but I'd like confirmation from the veterans on this.
Added some transitive dependency tests. See other comments for discussion on the behavior. Also updated the Gemfile and addressed your comments. Thanks for looking it over @segiddins! |
f2ee737
to
0124950
Compare
0124950
to
1d8c703
Compare
This is ready for a review. Much appreciated! |
1d8c703
to
41d4864
Compare
[Eric Firestone](https://github.com/efirestone) | ||
[#4486](https://github.com/CocoaPods/CocoaPods/pull/4486) | ||
|
||
* Improve `pod search` performance while using _`--full`_ flag |
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 line shouldn't be there
Generally looks good to me, but I'd like someone else on the team to also have a look. |
41d4864
to
7334c0d
Compare
Comments addressed. Thanks for looking it over. |
88b4147
to
5ee82c3
Compare
@@ -20,6 +20,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre` | |||
[Marcelo Fabri](https://github.com/marcelofabri) | |||
[#4487](https://github.com/CocoaPods/CocoaPods/pull/4487) | |||
|
|||
* Add support for specifying :source with a pod dependency. |
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.
I think your changelog entry should be at the top in order to preserve historical flow.
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.
Done and done.
5ee82c3
to
7d490de
Compare
Looks good to me as well — thanks for the comprehensive comments, @efirestone 👍 |
@efirestone, it just needs a rebase to be 🚀. Thank you for your effort ! |
And you should revert the Gemfile because changes in Core repo has been merged. |
Enables specifying a :source flag with each pod dependency
7d490de
to
ccfde78
Compare
Should be good to go! Thanks all! |
Awesome, thank you 👍 |
Add ability to specify source with each dependency
This adds the ability to add a
:source
flag to pod dependencies in a Podfile. This behavior mirrors in Gemfiles, allowing a dependency to be specified as such:pod 'JSONKit', '1.4', :source => 'http://github.com/MyOrg/Specs.git'
Depends on CocoaPods/Core#278