Commit 808789a5 authored by Eloy Durán's avatar Eloy Durán

Merge pull request #5136 from CocoaPods/orta-resolvinger

Improve 1.0 error messages around not-found dependencies
parents 7b845e7f a7cf048e
...@@ -13,6 +13,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -13,6 +13,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Samuel Giddins](https://github.com/segiddins) [Samuel Giddins](https://github.com/segiddins)
[CocoaPods#5113](https://github.com/CocoaPods/CocoaPods/issues/5113) [CocoaPods#5113](https://github.com/CocoaPods/CocoaPods/issues/5113)
* Improved error messages, around the 1.0 changes when we cannot find a dependency
in local sources, noting that CP > 1 doesnt run `pod repo update`
[Orta Therox](https://github.com/orta)
[CocoaPods#5135](https://github.com/CocoaPods/CocoaPods/issues/5135)
##### Bug Fixes ##### Bug Fixes
* None. * None.
......
...@@ -420,11 +420,14 @@ module Pod ...@@ -420,11 +420,14 @@ module Pod
elsif !conflict.existing elsif !conflict.existing
conflict.requirements.values.flatten.each do |r| conflict.requirements.values.flatten.each do |r|
if search_for(r).empty? if search_for(r).empty?
# There is no existing specification inside any of the spec repos with given requirements. # There are no existing specification inside any of the spec repos with given requirements.
message << "\n\nNone of the spec sources contain a spec satisfying the `#{r}` dependency." \ message << "\n\nNone of your spec sources contain a spec satisfying the dependency: `#{r}`." \
"\nYou have either; mistyped the name or version," \ "\n\nYou have either:" \
' not added the source repo that hosts the Podspec to your Podfile,' \ "\n * out-of-date source repos which you can update with `pod repo update`." \
' or not got the latest versions of your source repos.' "\n * mistyped the name or version." \
"\n * not added the source repo that hosts the Podspec to your Podfile." \
"\n\nNote: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default."
else else
message << "\n\nSpecs satisfying the `#{r}` dependency were found, " \ message << "\n\nSpecs satisfying the `#{r}` dependency were found, " \
'but they required a higher minimum deployment target.' 'but they required a higher minimum deployment target.'
......
...@@ -361,10 +361,12 @@ module Pod ...@@ -361,10 +361,12 @@ module Pod
e = lambda { resolver.resolve }.should.raise Informative e = lambda { resolver.resolve }.should.raise Informative
e.message.should.match(/Unable to satisfy the following requirements/) e.message.should.match(/Unable to satisfy the following requirements/)
e.message.should.match(/`AFNetworking \(= 3.0.1\)` required by `Podfile`/) e.message.should.match(/`AFNetworking \(= 3.0.1\)` required by `Podfile`/)
e.message.should.match(/None of the spec sources contain a spec satisfying the `AFNetworking \(= 3.0.1\)` dependency./) e.message.should.match(/None of your spec sources contain a spec satisfying the dependency: `AFNetworking \(= 3.0.1\)`./)
e.message.should.match(/You have either; mistyped the name or version,/) e.message.should.match(/You have either:/)
e.message.should.match(/ not added the source repo that hosts the Podspec to your Podfile,/) e.message.should.match(/ * out-of-date source repos which you can update with `pod repo update`/)
e.message.should.match(/ or not got the latest versions of your source repos./) e.message.should.match(/ * not added the source repo that hosts the Podspec to your Podfile./)
e.message.should.match(/ * out-of-date source repos which you can update with `pod repo update`/)
e.message.should.match(/Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default./)
end end
it 'takes into account locked dependencies' do it 'takes into account locked dependencies' do
...@@ -533,7 +535,7 @@ module Pod ...@@ -533,7 +535,7 @@ module Pod
sources = SourcesManager.sources(%w(master)) sources = SourcesManager.sources(%w(master))
resolver = Resolver.new(config.sandbox, podfile, empty_graph, sources) resolver = Resolver.new(config.sandbox, podfile, empty_graph, sources)
e = lambda { resolver.resolve }.should.raise Informative e = lambda { resolver.resolve }.should.raise Informative
e.message.should.match(/None of the spec sources contain a spec satisfying/) e.message.should.match(/None of your spec sources contain a spec/)
e.message.should.match(/JSONKit/) e.message.should.match(/JSONKit/)
e.message.should.match(/\= 1.5pre/) e.message.should.match(/\= 1.5pre/)
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment