Commit ff81e75b authored by Samuel E. Giddins's avatar Samuel E. Giddins

Merge pull request #2793 from CocoaPods/seg-fix-head-pods

Fix :head pods
parents 2fbc18f3 0df25272
...@@ -22,6 +22,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -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. * We no longer require git version 1.7.5 or greater.
[Kyle Fuller](https://github.com/kylef) [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 ## 0.35.0.rc1
......
...@@ -15,7 +15,7 @@ gem 'json', '1.7.7' ...@@ -15,7 +15,7 @@ gem 'json', '1.7.7'
group :development do group :development do
cp_gem 'claide', 'CLAide' 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-downloader', 'cocoapods-downloader'
cp_gem 'cocoapods-plugins', 'cocoapods-plugins' cp_gem 'cocoapods-plugins', 'cocoapods-plugins'
cp_gem 'cocoapods-trunk', 'cocoapods-trunk' cp_gem 'cocoapods-trunk', 'cocoapods-trunk'
......
...@@ -7,8 +7,8 @@ GIT ...@@ -7,8 +7,8 @@ GIT
GIT GIT
remote: https://github.com/CocoaPods/Core.git remote: https://github.com/CocoaPods/Core.git
revision: d77623b7f79b9ec20176f0744aaed4495797e12d revision: 78f630f516bf39f59403c148ba6395362a3baa4d
branch: master branch: seg-fix-head-pods
specs: specs:
cocoapods-core (0.35.0.rc1) cocoapods-core (0.35.0.rc1)
activesupport (>= 3.2.15) activesupport (>= 3.2.15)
......
...@@ -79,7 +79,7 @@ module Pod ...@@ -79,7 +79,7 @@ module Pod
sort_by(&:name). sort_by(&:name).
each do |spec| each do |spec|
validate_platform(spec, target) 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
end end
specs_by_target specs_by_target
...@@ -105,15 +105,12 @@ module Pod ...@@ -105,15 +105,12 @@ module Pod
@search ||= {} @search ||= {}
@search[dependency] ||= begin @search[dependency] ||= begin
requirement = Requirement.new(dependency.requirement.as_list << requirement_for_locked_pod_named(dependency.name)) 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. all_specifications.
select { |s| requirement.satisfied_by? s.version }. select { |s| requirement.satisfied_by? s.version }.
map { |s| s.subspec_by_name(dependency.name, false) }. map { |s| s.subspec_by_name(dependency.name, false) }.
compact compact.
reverse
specs.
reverse.
each { |s| s.version.head = dependency.head? }
end end
@search[dependency].dup @search[dependency].dup
end end
...@@ -306,6 +303,9 @@ module Pod ...@@ -306,6 +303,9 @@ module Pod
else else
set = create_set_from_sources(dependency) set = create_set_from_sources(dependency)
end end
if dependency.head?
set = Specification::Set::Head.new(set.specification)
end
cached_sets[name] = set cached_sets[name] = set
unless set unless set
raise Molinillo::NoSuchDependencyError.new(dependency) # rubocop:disable Style/RaiseArgs raise Molinillo::NoSuchDependencyError.new(dependency) # rubocop:disable Style/RaiseArgs
...@@ -320,7 +320,9 @@ module Pod ...@@ -320,7 +320,9 @@ module Pod
# #
def requirement_for_locked_pod_named(name) def requirement_for_locked_pod_named(name)
if vertex = locked_dependencies.vertex_named(name) if vertex = locked_dependencies.vertex_named(name)
vertex.payload.requirement if dependency = vertex.payload
dependency.requirement
end
end end
end end
......
...@@ -23,7 +23,7 @@ module Pod ...@@ -23,7 +23,7 @@ module Pod
end end
def specification def specification
@specification ||= source.specification(name, version) @specification ||= source.specification(name, version.version)
end end
end end
...@@ -50,9 +50,9 @@ module Pod ...@@ -50,9 +50,9 @@ module Pod
map { |v| "- #{v}" }.join("\n") map { |v| "- #{v}" }.join("\n")
end end
versions_by_source.map do |source, versions| versions_by_source.flat_map do |source, versions|
versions.map { |version| LazySpecification.new(name, version, source) } versions.map { |version| LazySpecification.new(name, version, source) }
end.flatten end
end end
end end
end end
......
...@@ -203,6 +203,23 @@ module Pod ...@@ -203,6 +203,23 @@ module Pod
describe 'Downloading dependencies' do describe 'Downloading dependencies' do
it 'installs head pods' do
podfile = Podfile.new do
platform :osx, '10.10'
pod 'CargoBay', '2.1.0'
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).sort_by(&:name).map(&:version).map(&:head?).should == [true, nil]
@installer.download_dependencies
UI.output.should.include 'HEAD based on 2.4.1'
end
describe '#install_pod_sources' do describe '#install_pod_sources' do
it 'installs all the Pods which are marked as needing installation' 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