Commit 0da6c35f authored by Eloy Durán's avatar Eloy Durán

When operating on all pods, make them unique. Fixes #376.

parent 5690b44c
...@@ -23,7 +23,7 @@ module Pod ...@@ -23,7 +23,7 @@ module Pod
# Add all source files to the project grouped by pod # Add all source files to the project grouped by pod
pod.relative_source_files_by_spec.each do |spec, paths| pod.relative_source_files_by_spec.each do |spec, paths|
parent_group = pod.local? ? @project.local_pods : @project.pods parent_group = pod.local? ? @project.local_pods : @project.pods
group = @project.add_spec_to_group(pod.name, parent_group) group = @project.add_spec_group(pod.name, parent_group)
paths.each do |path| paths.each do |path|
group.files.new('path' => path.to_s) group.files.new('path' => path.to_s)
end end
...@@ -186,7 +186,7 @@ module Pod ...@@ -186,7 +186,7 @@ module Pod
# @return [Array<LocalPod>] A list of LocalPod instances for each # @return [Array<LocalPod>] A list of LocalPod instances for each
# dependency that is not a download-only one. # dependency that is not a download-only one.
def pods def pods
pods_by_target.values.flatten pods_by_target.values.flatten.uniq
end end
def pods_by_target def pods_by_target
......
...@@ -40,11 +40,11 @@ module Pod ...@@ -40,11 +40,11 @@ module Pod
end end
# Adds a group as child to the `Pods' group namespacing subspecs. # Adds a group as child to the `Pods' group namespacing subspecs.
def add_spec_to_group(name, parent_group) def add_spec_group(name, parent_group)
groups = parent_group.groups groups = parent_group.groups
group = nil group = nil
name.split('/').each do |name| name.split('/').each do |name|
group = groups.find { |g| g.name == name } || groups.new({ 'name' => name }) group = groups.find { |g| g.name == name } || groups.new('name' => name)
groups = group.groups groups = group.groups
end end
group group
......
Subproject commit 6116b0a386a0313d7183ea219be1b51d56962546 Subproject commit 28e0d9209ab777d227783f1f0cad6ce096d0d6a8
...@@ -75,8 +75,8 @@ module Pod ...@@ -75,8 +75,8 @@ module Pod
group.files.map(&:name).should == ["Reachability.h", "Reachability.m"] group.files.map(&:name).should == ["Reachability.h", "Reachability.m"]
end end
it "it list a pod only once" do it "lists a pod only once" do
reachability_pods = @installer.pods.map(&:to_s).select{|s| s.include?('Reachability')} reachability_pods = @installer.pods.map(&:to_s).select{|s| s.include?('Reachability') }
reachability_pods.count.should == 1 reachability_pods.count.should == 1
end end
......
...@@ -12,7 +12,7 @@ describe 'Pod::Project' do ...@@ -12,7 +12,7 @@ describe 'Pod::Project' do
end end
it "adds a group to the `Pods' group" do it "adds a group to the `Pods' group" do
group = @project.add_spec_to_group('JSONKit', @project.pods) group = @project.add_spec_group('JSONKit', @project.pods)
@project.pods.child_references.should.include group.uuid @project.pods.child_references.should.include group.uuid
find_object({ find_object({
'isa' => 'PBXGroup', 'isa' => 'PBXGroup',
...@@ -23,7 +23,7 @@ describe 'Pod::Project' do ...@@ -23,7 +23,7 @@ describe 'Pod::Project' do
end end
it "namespaces subspecs in groups" do it "namespaces subspecs in groups" do
group = @project.add_spec_to_group('JSONKit/Subspec', @project.pods) group = @project.add_spec_group('JSONKit/Subspec', @project.pods)
@project.pods.groups.find { |g| g.name == 'JSONKit' }.child_references.should.include group.uuid @project.pods.groups.find { |g| g.name == 'JSONKit' }.child_references.should.include group.uuid
find_object({ find_object({
'isa' => 'PBXGroup', 'isa' => 'PBXGroup',
......
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