Commit a7607455 authored by Jeremy Slater's avatar Jeremy Slater

XCConfig is generated for Pod targets as well

parent e8d61f35
......@@ -7,16 +7,16 @@ module Pod
#
class XCConfig
# @return [Target] the aggregate_target or target represented by this xcconfig.
# @return [Target] the target represented by this xcconfig.
#
attr_reader :aggregate_target
attr_reader :target
attr_reader :sandbox
# @param [Target] aggregate_target @see aggregate_target
# @param [Target] target @see target
#
def initialize(aggregate_target)
@aggregate_target = aggregate_target
@sandbox = aggregate_target.sandbox
def initialize(target)
@target = target
@sandbox = target.sandbox
end
# @return [Xcodeproj::Config] The generated xcconfig.
......@@ -79,7 +79,7 @@ module Pod
#
DEVELOPER_FRAMEWORKS_SEARCH_PATHS = [
'$(inherited)',
'"$(SDKROOT)/Developer/aggregate_target/Frameworks"',
'"$(SDKROOT)/Developer/target/Frameworks"',
'"$(DEVELOPER_LIBRARY_DIR)/Frameworks"'
]
......
......@@ -15,7 +15,7 @@ module Pod
#
def generate
ld_flags = '-ObjC'
if aggregate_target.target_definition.podfile.set_arc_compatibility_flag?
if target.target_definition.podfile.set_arc_compatibility_flag?
ld_flags << ' -fobjc-arc'
end
......@@ -23,11 +23,11 @@ module Pod
'ALWAYS_SEARCH_USER_PATHS' => 'YES',
'OTHER_LDFLAGS' => ld_flags,
'HEADER_SEARCH_PATHS' => quote(sandbox.public_headers.search_paths),
'PODS_ROOT' => aggregate_target.relative_pods_root,
'PODS_ROOT' => target.relative_pods_root,
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) COCOAPODS=1',
}
aggregate_target.pod_targets.each do |lib|
target.pod_targets.each do |lib|
consumer_xcconfig(lib.consumer).to_hash.each do |k, v|
prefixed_key = lib.xcconfig_prefix + k
config[k] = "#{config[k]} ${#{prefixed_key}}"
......@@ -35,7 +35,7 @@ module Pod
end
@xcconfig = Xcodeproj::Config.new(config)
@xcconfig.includes = aggregate_target.pod_targets.map(&:name)
@xcconfig.includes = target.pod_targets.map(&:name)
@xcconfig
end
......
......@@ -4,7 +4,7 @@ module Pod
#
class PrivatePodXCConfig < XCConfig
# Generates the xcconfig for the aggregate_target.
# Generates the xcconfig for the target.
#
# @note The private xcconfig file for a spec target includes the public
# namespaced xcconfig file and merges the configuration values
......@@ -14,7 +14,7 @@ module Pod
#
def generate
ld_flags = '-ObjC'
if aggregate_target.consumer.requires_arc?
if target.consumer.requires_arc?
ld_flags << ' -fobjc-arc'
end
......@@ -22,18 +22,18 @@ module Pod
'ALWAYS_SEARCH_USER_PATHS' => 'YES',
'OTHER_LDFLAGS' => ld_flags,
'PODS_ROOT' => '${SRCROOT}',
'HEADER_SEARCH_PATHS' => quote(aggregate_target.build_headers.search_paths) + ' ' + quote(sandbox.public_headers.search_paths),
'HEADER_SEARCH_PATHS' => quote(target.build_headers.search_paths) + ' ' + quote(sandbox.public_headers.search_paths),
'GCC_PREPROCESSOR_DEFINITIONS' => 'COCOAPODS=1',
# 'USE_HEADERMAP' => 'NO'
}
consumer_xcconfig(aggregate_target.consumer).to_hash.each do |k, v|
prefixed_key = aggregate_target.xcconfig_prefix + k
consumer_xcconfig(target.consumer).to_hash.each do |k, v|
prefixed_key = target.xcconfig_prefix + k
config[k] = "#{config[k]} ${#{prefixed_key}}"
end
@xcconfig = Xcodeproj::Config.new(config)
@xcconfig.includes = [aggregate_target.name]
@xcconfig.includes = [target.name]
@xcconfig
end
......
......@@ -16,10 +16,10 @@ module Pod
# @return [void]
#
def save_as(path)
generate.save_as(path, aggregate_target.xcconfig_prefix)
generate.save_as(path, target.xcconfig_prefix)
end
# Generates the xcconfig for the aggregate_target.
# Generates the xcconfig for the target.
#
# @note The xcconfig file for a public spec target includes the
# standard podspec defined values including libraries,
......@@ -28,7 +28,7 @@ module Pod
# @return [Xcodeproj::Config]
#
def generate
@xcconfig = consumer_xcconfig(aggregate_target.consumer)
@xcconfig = consumer_xcconfig(target.consumer)
@xcconfig
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