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