Commit a9cabe6b authored by Fabio Pelosin's avatar Fabio Pelosin

[Installer] Fix issue with subspecs and target dependencies

Closes #1170
Closes #1168
parent 5aef67a5
......@@ -339,8 +339,14 @@ module Pod
add_dependency(aggregate_target, pod_target)
pod_target.dependencies.each do |dep|
pod_dependency_target = aggregate_target.pod_targets.find { |target| target.root_spec.name == dep }
add_dependency(pod_target, pod_dependency_target)
unless dep == pod_target.pod_name
pod_dependency_target = aggregate_target.pod_targets.find { |target| target.pod_name == dep }
# TODO remove me
unless pod_dependency_target
puts "[BUG] DEP: #{dep}"
end
add_dependency(pod_target, pod_dependency_target)
end
end
end
end
......
......@@ -43,18 +43,24 @@ module Pod
specs.map { |spec| spec.consumer(platform) }
end
# @return [Specification] the root specification for the target.
# @return [Specification] The root specification for the target.
#
def root_spec
specs.first.root
end
# @return [String] The name of the Pod that this target refers to.
#
def pod_name
root_spec.name
end
# @return [Array<String>] The names of the Pods on which this target
# depends.
#
def dependencies
specs.map do |spec|
spec.consumer(platform).dependencies.map { |dep| dep.name }
spec.consumer(platform).dependencies.map { |dep| Specification.root_name(dep.name) }
end.flatten
end
......
......@@ -286,6 +286,24 @@ module Pod
#--------------------------------------#
describe "#set_target_dependencies" do
xit "sets the pod targets as dependencies of the aggregate target" do
end
xit "sets the dependecies of the pod targets" do
end
xit "is robusts against subspecs" do
end
end
#--------------------------------------#
describe "#write_pod_project" do
before do
......
......@@ -30,6 +30,10 @@ module Pod
@pod_target.root_spec.name.should == 'BananaLib'
end
it "returns the name of the Pod" do
@pod_target.pod_name.should == 'BananaLib'
end
it "returns the name of the Pods on which this target depends" do
@pod_target.dependencies.should == ["monkey"]
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