Commit 15f101a0 authored by Samuel E. Giddins's avatar Samuel E. Giddins

Ensure that HEAD pods are treated properly by using a new Specification::Set subclass

parent 72c47a6f
......@@ -22,6 +22,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
* We no longer require git version 1.7.5 or greater.
[Kyle Fuller](https://github.com/kylef)
* Fix the usage of `:head` pods.
[Samuel Giddins](https://github.com/segiddins)
[#2789](https://github.com/CocoaPods/CocoaPods/issues/2789)
## 0.35.0.rc1
......
......@@ -15,7 +15,7 @@ gem 'json', '1.7.7'
group :development do
cp_gem 'claide', 'CLAide'
cp_gem 'cocoapods-core', 'Core'
cp_gem 'cocoapods-core', 'Core', 'seg-fix-head-pods'
cp_gem 'cocoapods-downloader', 'cocoapods-downloader'
cp_gem 'cocoapods-plugins', 'cocoapods-plugins'
cp_gem 'cocoapods-trunk', 'cocoapods-trunk'
......
......@@ -7,8 +7,8 @@ GIT
GIT
remote: https://github.com/CocoaPods/Core.git
revision: d77623b7f79b9ec20176f0744aaed4495797e12d
branch: master
revision: 78f630f516bf39f59403c148ba6395362a3baa4d
branch: seg-fix-head-pods
specs:
cocoapods-core (0.35.0.rc1)
activesupport (>= 3.2.15)
......
......@@ -79,7 +79,7 @@ module Pod
sort_by(&:name).
each do |spec|
validate_platform(spec, target)
sandbox.store_head_pod(spec.name) if spec.version.head
sandbox.store_head_pod(spec.name) if spec.version.head?
end
end
specs_by_target
......@@ -105,15 +105,12 @@ module Pod
@search ||= {}
@search[dependency] ||= begin
requirement = Requirement.new(dependency.requirement.as_list << requirement_for_locked_pod_named(dependency.name))
specs = find_cached_set(dependency).
find_cached_set(dependency).
all_specifications.
select { |s| requirement.satisfied_by? s.version }.
map { |s| s.subspec_by_name(dependency.name, false) }.
compact
specs.
reverse.
each { |s| s.version.head = dependency.head? }
compact.
reverse
end
@search[dependency].dup
end
......@@ -323,7 +320,9 @@ module Pod
#
def requirement_for_locked_pod_named(name)
if vertex = locked_dependencies.vertex_named(name)
vertex.payload.requirement
if dependency = vertex.payload
dependency.requirement
end
end
end
......
......@@ -23,7 +23,7 @@ module Pod
end
def specification
@specification ||= source.specification(name, version)
@specification ||= source.specification(name, version.version)
end
end
......@@ -50,9 +50,9 @@ module Pod
map { |v| "- #{v}" }.join("\n")
end
versions_by_source.map do |source, versions|
versions_by_source.flat_map do |source, versions|
versions.map { |version| LazySpecification.new(name, version, source) }
end.flatten
end
end
end
end
......
......@@ -203,6 +203,22 @@ module Pod
describe 'Downloading dependencies' do
it 'installs head pods' do
podfile = Podfile.new do
platform :osx, '10.10'
pod 'AFNetworking/NSURLSession', :head
end
@installer.stubs(:podfile).returns(podfile)
@installer.stubs(:lockfile).returns(nil)
Downloader::Git.any_instance.expects(:download_head).once
Downloader::Git.any_instance.expects(:checkout_options).returns({})
@installer.prepare
@installer.resolve_dependencies
@installer.send(:root_specs).map(&:version).map(&:head?).should == [true]
@installer.download_dependencies
UI.output.should.include 'HEAD based on 2.4.1'
end
describe '#install_pod_sources' do
it 'installs all the Pods which are marked as needing installation' 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