Commit 8e250f02 authored by Paul Beusterien's avatar Paul Beusterien

Propagate HEADER_SEARCH_PATHS settings from search paths

parent 021c1287
......@@ -71,6 +71,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Paul Beusterien](https://github.com/paulb777)
[#7002](https://github.com/CocoaPods/CocoaPods/pull/7002)
* Propagate HEADER_SEARCH_PATHS settings from search paths
[Paul Beusterien](https://github.com/paulb777)
[#7006](https://github.com/CocoaPods/CocoaPods/pull/7006)
## 1.3.1 (2017-08-02)
##### Enhancements
......
......@@ -176,6 +176,9 @@ module Pod
generator = AggregateXCConfig.new(search_paths_target, configuration_name)
@xcconfig.merge! XCConfigHelper.search_paths_for_dependent_targets(nil, search_paths_target.pod_targets)
@xcconfig.merge!(generator.settings_to_import_pod_targets)
# Propagate any HEADER_SEARCH_PATHS settings from the search paths.
XCConfigHelper.propagate_header_search_paths_from_search_paths(search_paths_target, @xcconfig)
end
end
......
......@@ -321,6 +321,32 @@ module Pod
build_settings
end
# Updates xcconfig with the HEADER_SEARCH_PATHS from the search_paths.
#
# @param [Target] search_paths_target
# The target.
#
# @param [Xcodeproj::Config] xcconfig
# The xcconfig to edit.
#
def self.propagate_header_search_paths_from_search_paths(search_paths_target, xcconfig)
header_search_paths_list = []
search_paths_target.pod_targets.each do |target|
target.spec_consumers.each do |spec_consumer|
paths = spec_consumer.user_target_xcconfig['HEADER_SEARCH_PATHS']
header_search_paths_list <<= paths unless paths.nil?
end
unless header_search_paths_list == []
header_search_paths = header_search_paths_list.join(' ')
unless header_search_paths.include? '$(inherited)'
header_search_paths = '$(inherited) ' + header_search_paths
end
build_settings = { 'HEADER_SEARCH_PATHS' => header_search_paths }
xcconfig.merge!(build_settings)
end
end
end
# Add custom build settings and required build settings to link to
# vendored libraries and frameworks.
#
......
......@@ -161,6 +161,18 @@ module Pod
xcconfig.to_hash['OTHER_LDFLAGS'].should == '-framework "Foo"'
end
it 'includes HEADER_SEARCH_PATHS from search paths' do
xcconfig = Xcodeproj::Config.new
spec_consumer = stub(:user_target_xcconfig => { 'HEADER_SEARCH_PATHS' => 'my/path' })
pod_target = stub(:spec_consumers => [spec_consumer])
search_path_target = stub(
:pod_targets_for_build_configuration => [pod_target],
:pod_targets => [pod_target],
)
@sut.propagate_header_search_paths_from_search_paths(search_path_target, xcconfig)
xcconfig.to_hash['HEADER_SEARCH_PATHS'].should == '$(inherited) my/path'
end
it 'adds the frameworks of the xcconfig' do
xcconfig = Xcodeproj::Config.new
consumer = stub(
......
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