Commit 23a2e68e authored by Jean Regisser's avatar Jean Regisser
parent 6112aba0
...@@ -19,7 +19,7 @@ module Pod ...@@ -19,7 +19,7 @@ module Pod
elsif !name_and_version_requirements.empty? && block.nil? elsif !name_and_version_requirements.empty? && block.nil?
if name_and_version_requirements.last.is_a?(Hash) if name_and_version_requirements.last.is_a?(Hash)
@external_source = ExternalSources.from_params(name_and_version_requirements[0], name_and_version_requirements.pop) @external_source = ExternalSources.from_params(name_and_version_requirements[0].split('/').first, name_and_version_requirements.pop)
end end
super(*name_and_version_requirements) super(*name_and_version_requirements)
......
...@@ -49,7 +49,11 @@ module Pod ...@@ -49,7 +49,11 @@ module Pod
# that's being used behind the scenes, but passing it anyways for # that's being used behind the scenes, but passing it anyways for
# completeness sake. # completeness sake.
specification = external_source.specification_from_sandbox(@sandbox, platform) specification = external_source.specification_from_sandbox(@sandbox, platform)
Specification::Set::External.new(specification) set = Specification::Set::External.new(specification)
if dependency.subspec_dependency?
@cached_sets[dependency.top_level_spec_name] ||= set
end
set
else else
@cached_sources.search(dependency) @cached_sources.search(dependency)
end end
......
...@@ -25,6 +25,14 @@ describe "Pod::Podfile" do ...@@ -25,6 +25,14 @@ describe "Pod::Podfile" do
dep = podfile.dependency_by_top_level_spec_name('SomeExternalPod') dep = podfile.dependency_by_top_level_spec_name('SomeExternalPod')
dep.external_source.params.should == { :git => 'GIT-URL', :commit => '1234' } dep.external_source.params.should == { :git => 'GIT-URL', :commit => '1234' }
end end
it "adds a subspec dependency on a Pod repo outside of a spec repo (the repo is expected to contain a podspec)" do
podfile = Pod::Podfile.new do
dependency 'MainSpec/FirstSubSpec', :git => 'GIT-URL', :commit => '1234'
end
dep = podfile.dependency_by_top_level_spec_name('MainSpec')
dep.external_source.name.should == 'MainSpec'
end
it "adds a dependency on a library outside of a spec repo (the repo does not need to contain a podspec)" do it "adds a dependency on a library outside of a spec repo (the repo does not need to contain a podspec)" do
podfile = Pod::Podfile.new do podfile = Pod::Podfile.new do
......
...@@ -90,5 +90,35 @@ describe "Pod::Resolver" do ...@@ -90,5 +90,35 @@ describe "Pod::Resolver" do
cocoa-oauth cocoa-oauth
} }
end end
it "resolves subspecs with external constraints" do
@podfile = Pod::Podfile.new do
platform :ios
dependency 'MainSpec/FirstSubSpec', :git => 'GIT-URL'
end
spec = Pod::Spec.new do |s|
s.name = 'MainSpec'
s.version = '1.2.3'
s.platform = :ios
s.license = 'MIT'
s.author = 'Joe the Plumber'
s.summary = 'A spec with subspecs'
s.source = { :git => '/some/url' }
s.requires_arc = true
s.subspec 'FirstSubSpec' do |fss|
fss.source_files = 'some/file'
fss.subspec 'SecondSubSpec' do |sss|
end
end
end
@podfile.dependencies.first.external_source.stubs(:specification_from_sandbox).returns(spec)
resolver = Pod::Resolver.new(@podfile, stub('sandbox'))
resolver.resolve.values.flatten.map(&:name).sort.should == %w{
MainSpec
MainSpec/FirstSubSpec
}
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