Commit a3241de2 authored by Muhammed Yavuz Nuzumlalı's avatar Muhammed Yavuz Nuzumlalı Committed by GitHub

Merge pull request #5508 from CocoaPods/manu/fix/localPodPlatformConflict

Fix minimum deployment target error for local pods.
parents 048955d3 b8f84bb8
...@@ -14,6 +14,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -14,6 +14,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes ##### Bug Fixes
* Fix local pod platform conflict error message.
[Muhammed Yavuz Nuzumlalı](https://github.com/manuyavuz)
[#5052](https://github.com/CocoaPods/CocoaPods/issues/5052)
* Fix installing pods with `use_frameworks` when deduplication is disabled. * Fix installing pods with `use_frameworks` when deduplication is disabled.
[Samuel Giddins](https://github.com/segiddins) [Samuel Giddins](https://github.com/segiddins)
[#5481](https://github.com/CocoaPods/CocoaPods/issues/5481) [#5481](https://github.com/CocoaPods/CocoaPods/issues/5481)
......
...@@ -389,7 +389,6 @@ module Pod ...@@ -389,7 +389,6 @@ module Pod
error.conflicts.each do |name, conflict| error.conflicts.each do |name, conflict|
local_pod_parent = conflict.requirement_trees.flatten.reverse.find(&:local?) local_pod_parent = conflict.requirement_trees.flatten.reverse.find(&:local?)
lockfile_reqs = conflict.requirements[name_for_locking_dependency_source] lockfile_reqs = conflict.requirements[name_for_locking_dependency_source]
if lockfile_reqs && lockfile_reqs.last && lockfile_reqs.last.prerelease? && !conflict.existing if lockfile_reqs && lockfile_reqs.last && lockfile_reqs.last.prerelease? && !conflict.existing
message = 'Due to the previous naïve CocoaPods resolver, ' \ message = 'Due to the previous naïve CocoaPods resolver, ' \
"you were using a pre-release version of `#{name}`, " \ "you were using a pre-release version of `#{name}`, " \
...@@ -398,7 +397,7 @@ module Pod ...@@ -398,7 +397,7 @@ module Pod
'version requirement to your Podfile ' \ 'version requirement to your Podfile ' \
"(e.g. `pod '#{name}', '#{lockfile_reqs.map(&:requirement).join("', '")}'`) " \ "(e.g. `pod '#{name}', '#{lockfile_reqs.map(&:requirement).join("', '")}'`) " \
"or revert to a stable version by running `pod update #{name}`." "or revert to a stable version by running `pod update #{name}`."
elsif local_pod_parent && !specifications_for_dependency(conflict.requirement).empty? elsif local_pod_parent && !specifications_for_dependency(conflict.requirement).empty? && !conflict.possibility
# Conflict was caused by a requirement from a local dependency. # Conflict was caused by a requirement from a local dependency.
# Tell user to use `pod update`. # Tell user to use `pod update`.
message << "\n\nIt seems like you've changed the constraints of dependency `#{name}` " \ message << "\n\nIt seems like you've changed the constraints of dependency `#{name}` " \
......
...@@ -225,6 +225,21 @@ module Pod ...@@ -225,6 +225,21 @@ module Pod
message.should.match /required a higher minimum deployment target/ message.should.match /required a higher minimum deployment target/
end end
it 'raises an informative error when version conflict is caused by platform incompatibilities for local pods' do
sandbox = config.sandbox
local_spec = Specification.from_hash('name' => 'LocalPod', 'version' => '1.0', 'platforms' => { 'ios' => '8.0' })
sandbox.stubs(:specification).with('LocalPod').returns(local_spec)
@podfile = Podfile.new do
target 'SampleProject' do
platform :ios, '7.0'
pod 'LocalPod', :path => '../'
end
end
@resolver.stubs(:podfile).returns(@podfile)
message = should.raise(Informative) { @resolver.resolve }.message
message.should.match /required a higher minimum deployment target/
end
it 'raises if unable to find a specification' do it 'raises if unable to find a specification' do
Specification.any_instance.stubs(:all_dependencies).returns([Dependency.new('Windows')]) Specification.any_instance.stubs(:all_dependencies).returns([Dependency.new('Windows')])
message = should.raise Informative do message = should.raise Informative do
......
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