Commit 27fec6a8 authored by Eloy Duran's avatar Eloy Duran

A subspec always depends on the parent spec if the parent spec is a Subspec too.

parent a4108542
......@@ -395,7 +395,10 @@ module Pod
@dependencies, @resources, @clean_paths, @subspecs = [], [], [], []
@xcconfig = Xcodeproj::Config.new
self.part_of = top_level_parent.name, top_level_parent.version
# A subspec is _always_ part of the source of its top level spec.
self.part_of = top_level_parent.name, version
# A subspec has a dependency on the parent if the parent is a subspec too.
dependency(@parent.name, version) if @parent.is_a?(Subspec)
yield self if block_given?
end
......@@ -416,6 +419,10 @@ module Pod
@summary ? @summary : top_level_parent.summary
end
def version
top_level_parent.version
end
def source
top_level_parent.source
end
......
Subproject commit 4d304b8066a9c1d1156412d882de60eeca625659
Subproject commit d0a5f7b8b29c6cc81ff28760d756e5fb300a9e7f
......@@ -313,6 +313,12 @@ describe "A Pod::Specification subspec" do
@spec.subspecs.first.subspecs.first.part_of.should == dependency
end
it "depends on the parent spec, if it is a subspec" do
dependency = Pod::Dependency.new('MainSpec', '1.2.3').tap { |d| d.only_part_of_other_pod = true }
@spec.subspecs.first.dependencies.should == [dependency]
@spec.subspecs.first.subspecs.first.dependencies.should == [dependency, Pod::Dependency.new('MainSpec/FirstSubSpec', '1.2.3')]
end
it "automatically forwards undefined attributes to the top level parent" do
@spec.subspecs.first.summary.should == @spec.summary
@spec.subspecs.first.source.should == @spec.source
......
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