Commit fc91353f authored by Eloy Duran's avatar Eloy Duran

Make the installer work again, now that a resolver returns specs instead of sets.

parent fccabd9f
module Pod module Pod
class Installer class Installer
module Shared module Shared
def dependent_specification_sets def dependent_specifications
@dependent_specification_sets ||= Resolver.new(@podfile, @definition ? @definition.dependencies : nil).resolve @dependent_specifications ||= Resolver.new(@podfile, @definition ? @definition.dependencies : nil).resolve
end end
def build_specifications def build_specifications
dependent_specification_sets.reject(&:only_part_of_other_pod?).map(&:specification) dependent_specifications.reject { |spec| spec.defined_in_set.only_part_of_other_pod? }
end end
def download_only_specifications def download_only_specifications
dependent_specification_sets.select(&:only_part_of_other_pod?).map(&:specification) dependent_specifications - build_specifications
end end
end end
......
...@@ -127,41 +127,7 @@ module Pod ...@@ -127,41 +127,7 @@ module Pod
end end
attr_reader :dependencies attr_reader :dependencies
class Subspec < Specification # Subspec related
attr_reader :parent
def initialize(parent, name)
@parent, @name = parent, name
# TODO a MacRuby bug, the correct super impl `initialize' is not called consistently
#super(&block)
@dependencies, @resources, @clean_paths, @subspecs = [], [], [], []
@xcconfig = Xcodeproj::Config.new
self.part_of = top_level_parent.name, top_level_parent.version
yield self if block_given?
end
undef_method :name=, :version=, :source=
def top_level_parent
top_level_parent = @parent
top_level_parent = top_level_parent.parent while top_level_parent.is_a?(Subspec)
top_level_parent
end
def name
"#{@parent.name}/#{@name}"
end
def summary
@summary ? @summary : top_level_parent.summary
end
def source
top_level_parent.source
end
end
def subspec(name, &block) def subspec(name, &block)
subspec = Subspec.new(self, name, &block) subspec = Subspec.new(self, name, &block)
...@@ -191,6 +157,9 @@ module Pod ...@@ -191,6 +157,9 @@ module Pod
# Not attributes # Not attributes
# TODO when we move to use a 'ResolveContext' this should happen there.
attr_accessor :defined_in_set
include Config::Mixin include Config::Mixin
def ==(other) def ==(other)
...@@ -421,6 +390,46 @@ module Pod ...@@ -421,6 +390,46 @@ module Pod
def post_install(target) def post_install(target)
end end
class Subspec < Specification
attr_reader :parent
def initialize(parent, name)
@parent, @name = parent, name
# TODO a MacRuby bug, the correct super impl `initialize' is not called consistently
#super(&block)
@dependencies, @resources, @clean_paths, @subspecs = [], [], [], []
@xcconfig = Xcodeproj::Config.new
self.part_of = top_level_parent.name, top_level_parent.version
yield self if block_given?
end
undef_method :name=, :version=, :source=, :defined_in_set=
def top_level_parent
top_level_parent = @parent
top_level_parent = top_level_parent.parent while top_level_parent.is_a?(Subspec)
top_level_parent
end
def name
"#{@parent.name}/#{@name}"
end
def summary
@summary ? @summary : top_level_parent.summary
end
def source
top_level_parent.source
end
def defined_in_set
top_level_parent.defined_in_set
end
end
end end
Spec = Specification Spec = Specification
......
...@@ -55,7 +55,7 @@ module Pod ...@@ -55,7 +55,7 @@ module Pod
end end
def specification def specification
@specification ||= Specification.from_file(specification_path) @specification ||= Specification.from_file(specification_path).tap { |spec| spec.defined_in_set = self }
end end
# Return the first version that matches the current dependency. # Return the first version that matches the current dependency.
...@@ -85,6 +85,7 @@ module Pod ...@@ -85,6 +85,7 @@ module Pod
class External < Set class External < Set
def initialize(specification) def initialize(specification)
@specification = specification @specification = specification
@specification.defined_in_set = self
@required_by = [] @required_by = []
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