Unverified Commit 16162de1 authored by Samuel Giddins's avatar Samuel Giddins Committed by GitHub

Merge pull request #7337 from CocoaPods/seg-resolver-sort-external-source-first

[Resolver] Sort external source dependencies first
parents 46e5eea6 4bc68064
......@@ -27,6 +27,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Samuel Giddins](https://github.com/segiddins)
[#7031](https://github.com/CocoaPods/CocoaPods/issues/7031)
* Ensure that externally-sourced (e.g. local & git) pods are allowed to resolve
to prerelease versions.
[segiddins](https://github.com/segiddins)
## 1.4.0.rc.1 (2017-12-16)
##### Enhancements
......
......@@ -261,6 +261,7 @@ module Pod
name = name_for(dependency)
[
activated.vertex_named(name).payload ? 0 : 1,
dependency.external_source ? 0 : 1,
dependency.prerelease? ? 0 : 1,
conflicts[name] ? 0 : 1,
search_for(dependency).count,
......
......@@ -1019,6 +1019,29 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
specs = resolver.resolve.values.flatten.map(&:spec).map(&:to_s).sort
specs.should == ['PrereleaseMonkey (1.0-beta1)']
end
it 'resolves when there is no prerelease dependency on an external source pod' do
sandbox = config.sandbox
local_pod = Specification.from_hash('name' => 'LocalPod', 'version' => '1.0.0.LOCAL')
local_pod2 = Specification.from_hash('name' => 'LocalPod2', 'version' => '1.0.0.LOCAL', 'dependencies' => { 'LocalPod' => [] })
sandbox.stubs(:specification).with('LocalPod').returns(local_pod)
sandbox.stubs(:specification).with('LocalPod2').returns(local_pod2)
podfile = Podfile.new do
target 'SampleProject' do
platform :ios, '9.0'
pod 'LocalPod', :path => '../'
pod 'LocalPod2', :path => '../'
end
end
locked_graph = dependency_graph_from_array([
Dependency.new('LocalPod', '= 1.0.0.LOCAL'),
Dependency.new('LocalPod2', '= 1.0.0.LOCAL'),
])
resolver = Resolver.new(config.sandbox, podfile, locked_graph, config.sources_manager.all)
specs = resolver.resolve.values.flatten.map(&:spec).map(&:to_s).sort
specs.should == ['LocalPod (1.0.0.LOCAL)', 'LocalPod2 (1.0.0.LOCAL)']
end
end
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