Commit 04769c88 authored by Jeremy Slater's avatar Jeremy Slater

Add spec_consumers to targets for xcconfig file

parent 5af5828e
......@@ -66,8 +66,8 @@ module Pod
strings.sort.map { |s| %W|"#{s}"| }.join(" ")
end
# Returns the Xcconfig generated from the build settings of the give
# specification consumer.
# Configures the given Xcconfig according to the build settings of the
# given Specification.
#
# @param [Specification::Consumer] consumer
# The consumer of the specification.
......@@ -75,15 +75,12 @@ module Pod
# @param [Xcodeproj::Config] xcconfig
# The xcconfig to edit.
#
# @return [Xcodeproj::Config]
#
def consumer_xcconfig(consumer)
xcconfig = Xcodeproj::Config.new(consumer.xcconfig)
def add_spec_build_settings_to_xcconfig(consumer, xcconfig)
xcconfig.merge!(consumer.xcconfig)
xcconfig.libraries.merge(consumer.libraries)
xcconfig.frameworks.merge(consumer.frameworks)
xcconfig.weak_frameworks.merge(consumer.weak_frameworks)
add_developers_frameworks_if_needed(consumer, xcconfig)
xcconfig
end
# @return [Array<String>] The search paths for the developer frameworks.
......
......@@ -22,9 +22,14 @@ module Pod
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) COCOAPODS=1',
}
target.pod_targets.each do |lib|
consumer_xcconfig(lib.consumer).to_hash.each do |k, v|
prefixed_key = lib.xcconfig_prefix + k
target.pod_targets.each do |pod_target|
xcconfig = Xcodeproj::Config.new
pod_target.spec_consumers.each do |consumer|
add_spec_build_settings_to_xcconfig(consumer, xcconfig)
end
xcconfig.to_hash.each do |k, v|
prefixed_key = pod_target.xcconfig_prefix + k
config[k] = "#{config[k]} ${#{prefixed_key}}"
end
end
......
......@@ -22,7 +22,12 @@ module Pod
# 'USE_HEADERMAP' => 'NO'
}
consumer_xcconfig(target.consumer).to_hash.each do |k, v|
xcconfig = Xcodeproj::Config.new
target.spec_consumers.each do |consumer|
add_spec_build_settings_to_xcconfig(consumer, xcconfig)
end
xcconfig.to_hash.each do |k, v|
prefixed_key = target.xcconfig_prefix + k
config[k] = "#{config[k]} ${#{prefixed_key}}"
end
......
......@@ -28,7 +28,10 @@ module Pod
# @return [Xcodeproj::Config]
#
def generate
@xcconfig = consumer_xcconfig(target.consumer)
@xcconfig = Xcodeproj::Config.new
target.spec_consumers.each do |consumer|
add_spec_build_settings_to_xcconfig(consumer, @xcconfig)
end
@xcconfig
end
......
......@@ -97,12 +97,6 @@ module Pod
end
end
# @return [Specification::Consumer] the consumer for the specifications.
#
def spec_consumers
@spec_consumers ||= library.file_accessors.map(&:spec_consumer)
end
ENABLE_OBJECT_USE_OBJC_FROM = {
:ios => Version.new('6'),
:osx => Version.new('10.8')
......
......@@ -56,6 +56,11 @@ module Pod
#
attr_accessor :pod_targets
# @return [Array<SpecConsumer>]
def spec_consumers
pod_targets.map(&:specs).flatten.map { |spec| spec.consumer(platform) }
end
# @return [Pathname] The absolute path of acknowledgements file.
#
# @note The acknowledgements generators add the extension according to
......
......@@ -36,18 +36,18 @@ module Pod
#
attr_accessor :file_accessors
# @return [Specification::Consumer] the specification consumer for the
# target.
# @return [Array<Specification::Consumer>] the specification consumers for
# the target.
#
def consumer
specs.first.root.consumer(platform)
def spec_consumers
specs.map { |spec| spec.consumer(platform) }
end
# @return [Specification] the root specification for the target.
#
def root_spec
specs.first.root
end
#-------------------------------------------------------------------------#
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