Commit 1ded8a0f authored by Samuel E. Giddins's avatar Samuel E. Giddins

[Resolver] Allow pre-release spec versions when a requirement has an external source

Closes https://github.com/CocoaPods/CocoaPods/issues/2768.
parent b31a373e
...@@ -4,6 +4,16 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides ...@@ -4,6 +4,16 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
To install release candidates run `[sudo] gem install cocoapods --pre` To install release candidates run `[sudo] gem install cocoapods --pre`
## Master
##### Bug Fixes
* Allows pre-release spec versions when a requirement has an external source
specified.
[Samuel Giddins](https://github.com/segiddins)
[#2768](https://github.com/CocoaPods/CocoaPods/issues/2768)
## 0.35.0.rc1 ## 0.35.0.rc1
##### Highlighted Enhancements That Need Testing ##### Highlighted Enhancements That Need Testing
......
...@@ -181,7 +181,10 @@ module Pod ...@@ -181,7 +181,10 @@ module Pod
else else
requirement.requirement.satisfied_by? spec.version requirement.requirement.satisfied_by? spec.version
end end
requirement_satisfied && !(spec.version.prerelease? && existing_vertices.flat_map(&:requirements).none?(&:prerelease?)) requirement_satisfied && !(
spec.version.prerelease? &&
existing_vertices.flat_map(&:requirements).none? { |r| r.prerelease? || r.external_source }
)
end end
# Sort dependencies so that the ones that are easiest to resolve are first. # Sort dependencies so that the ones that are easiest to resolve are first.
......
...@@ -257,6 +257,25 @@ module Pod ...@@ -257,6 +257,25 @@ module Pod
) )
end end
it 'allows pre-release spec versions when a requirement has an ' \
'external source' do
@podfile = Podfile.new do
platform :ios
pod 'MainSpec', :git => 'GIT-URL'
end
spec = Spec.new do |s|
s.name = 'MainSpec'
s.version = '1.2.3-pre'
s.platform = :ios
end
config.sandbox.expects(:specification).with('MainSpec').returns(spec)
resolver = Resolver.new(config.sandbox, @podfile, empty_graph, SourcesManager.all)
specs = resolver.resolve.values.flatten.map(&:to_s).sort
specs.should == [
'MainSpec (1.2.3-pre)'
]
end
it "marks a specification's version to be a HEAD version" do it "marks a specification's version to be a HEAD version" do
podfile = Podfile.new do podfile = Podfile.new do
platform :ios platform :ios
......
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