Commit 6995a959 authored by Samuel E. Giddins's avatar Samuel E. Giddins

The `HEADER_SEARCH_PATHS` will no longer be constructed recursively.

parent 94c3b6bb
...@@ -6,6 +6,14 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -6,6 +6,14 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
## Master ## Master
##### Breaking
* The `HEADER_SEARCH_PATHS` will no longer be constructed recursively.
[Samuel Giddins](https://github.com/segiddins)
[twoboxen](https://github.com/twoboxen)
[#1437](https://github.com/CocoaPods/CocoaPods/issues/1437)
[#3760](https://github.com/CocoaPods/CocoaPods/issues/3760)
##### Bug Fixes ##### Bug Fixes
* Build settings specified in `pod_target_xcconfig` of a spec are also for * Build settings specified in `pod_target_xcconfig` of a spec are also for
......
...@@ -128,17 +128,17 @@ module Pod ...@@ -128,17 +128,17 @@ module Pod
end end
header_mappings(headers_sandbox, file_accessor, file_accessor.headers).each do |namespaced_path, files| header_mappings(headers_sandbox, file_accessor, file_accessor.headers).each do |namespaced_path, files|
pod_target.build_headers.add_files(namespaced_path, files.reject { |f| f.to_path =~ framework_exp }, pod_target.platform) pod_target.build_headers.add_files(namespaced_path, files.reject { |f| f.to_path =~ framework_exp })
end end
unless pod_target.requires_frameworks? && pod_target.should_build? unless pod_target.requires_frameworks? && pod_target.should_build?
header_mappings(headers_sandbox, file_accessor, file_accessor.public_headers).each do |namespaced_path, files| header_mappings(headers_sandbox, file_accessor, file_accessor.public_headers).each do |namespaced_path, files|
sandbox.public_headers.add_files(namespaced_path, files.reject { |f| f.to_path =~ framework_exp }, pod_target.platform) sandbox.public_headers.add_files(namespaced_path, files.reject { |f| f.to_path =~ framework_exp })
end end
end end
vendored_frameworks_header_mappings(headers_sandbox, file_accessor).each do |namespaced_path, files| vendored_frameworks_header_mappings(headers_sandbox, file_accessor).each do |namespaced_path, files|
sandbox.public_headers.add_files(namespaced_path, files, pod_target.platform) sandbox.public_headers.add_files(namespaced_path, files)
end end
end end
end end
......
...@@ -66,13 +66,13 @@ module Pod ...@@ -66,13 +66,13 @@ module Pod
# the path of the header file relative to the Pods project # the path of the header file relative to the Pods project
# (`PODS_ROOT` variable of the xcconfigs). # (`PODS_ROOT` variable of the xcconfigs).
# #
# @note This method adds the files to the search paths. # @note This method does _not_ add the files to the search paths.
# #
# @return [Array<Pathname>] # @return [Array<Pathname>]
# #
def add_files(namespace, relative_header_paths, platform) def add_files(namespace, relative_header_paths)
relative_header_paths.map do |relative_header_path| relative_header_paths.map do |relative_header_path|
add_file(namespace, relative_header_path, relative_header_path.basename, platform) add_file(namespace, relative_header_path, relative_header_path.basename)
end end
end end
...@@ -90,12 +90,11 @@ module Pod ...@@ -90,12 +90,11 @@ module Pod
# the name under which the file should be available in the # the name under which the file should be available in the
# headers directory. # headers directory.
# #
# @note This method adds the file to the search paths. # @note This method does _not_ add the file to the search paths.
# #
# @return [Pathname] # @return [Pathname]
# #
def add_file(namespace, relative_header_path, final_name, platform) def add_file(namespace, relative_header_path, final_name)
add_search_path(namespace, platform)
namespaced_path = root + namespace namespaced_path = root + namespace
namespaced_path.mkpath unless File.exist?(namespaced_path) namespaced_path.mkpath unless File.exist?(namespaced_path)
......
Subproject commit 4053950103daa9b844575db676c8c49cb4dc456b Subproject commit c3a5c5887ee81a34d548accc3e84aea3d071a5b2
...@@ -21,14 +21,14 @@ module Pod ...@@ -21,14 +21,14 @@ module Pod
relative_header_paths.each do |path| relative_header_paths.each do |path|
File.open(@sandbox.root + path, 'w') { |file| file.write('hello') } File.open(@sandbox.root + path, 'w') { |file| file.write('hello') }
end end
symlink_paths = @header_dir.add_files(namespace_path, relative_header_paths, :fake_platform) symlink_paths = @header_dir.add_files(namespace_path, relative_header_paths)
symlink_paths.each do |path| symlink_paths.each do |path|
path.should.be.symlink path.should.be.symlink
File.read(path).should == 'hello' File.read(path).should == 'hello'
end end
end end
it 'keeps a list of unique header search paths when headers are added' do it 'does not add recursive search paths' do
FileUtils.mkdir_p(@sandbox.root + 'ExampleLib/Dir') FileUtils.mkdir_p(@sandbox.root + 'ExampleLib/Dir')
namespace_path = Pathname.new('ExampleLib') namespace_path = Pathname.new('ExampleLib')
relative_header_paths = [ relative_header_paths = [
...@@ -38,8 +38,8 @@ module Pod ...@@ -38,8 +38,8 @@ module Pod
relative_header_paths.each do |path| relative_header_paths.each do |path|
File.open(@sandbox.root + path, 'w') { |file| file.write('hello') } File.open(@sandbox.root + path, 'w') { |file| file.write('hello') }
end end
@header_dir.add_files(namespace_path, relative_header_paths, :fake_platform) @header_dir.add_files(namespace_path, relative_header_paths)
@header_dir.search_paths(:fake_platform).should.include('${PODS_ROOT}/Headers/Public/ExampleLib') @header_dir.search_paths(:fake_platform).should.not.include('${PODS_ROOT}/Headers/Public/ExampleLib')
end end
it 'always adds the Headers root to the header search paths' do it 'always adds the Headers root to the header search paths' do
......
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