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
class Installer
module Shared
def dependent_specification_sets
@dependent_specification_sets ||= Resolver.new(@podfile, @definition ? @definition.dependencies : nil).resolve
def dependent_specifications
@dependent_specifications ||= Resolver.new(@podfile, @definition ? @definition.dependencies : nil).resolve
end
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
def download_only_specifications
dependent_specification_sets.select(&:only_part_of_other_pod?).map(&:specification)
dependent_specifications - build_specifications
end
end
......
......@@ -127,41 +127,7 @@ module Pod
end
attr_reader :dependencies
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=
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
# Subspec related
def subspec(name, &block)
subspec = Subspec.new(self, name, &block)
......@@ -191,6 +157,9 @@ module Pod
# Not attributes
# TODO when we move to use a 'ResolveContext' this should happen there.
attr_accessor :defined_in_set
include Config::Mixin
def ==(other)
......@@ -421,6 +390,46 @@ module Pod
def post_install(target)
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
Spec = Specification
......
......@@ -55,7 +55,7 @@ module Pod
end
def specification
@specification ||= Specification.from_file(specification_path)
@specification ||= Specification.from_file(specification_path).tap { |spec| spec.defined_in_set = self }
end
# Return the first version that matches the current dependency.
......@@ -85,6 +85,7 @@ module Pod
class External < Set
def initialize(specification)
@specification = specification
@specification.defined_in_set = self
@required_by = []
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