Commit bfced99f authored by Boris Bügling's avatar Boris Bügling

Merge pull request #3629 from vhariable/fix-vendored-framework-headers-recursive

Added recursive support for header sub-directories
parents e44f1013 15559911
...@@ -27,6 +27,12 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -27,6 +27,12 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes ##### Bug Fixes
* Added recursive support to the public headers of vendored frameworks
that are automatically linked in the sandbox. This fixes and issue
for framework header directories that contain sub-directories.
[Todd Casey](https://github.com/vhariable)
[#3161](https://github.com/CocoaPods/CocoaPods/issues/3161)
* Public headers of vendored frameworks are now automatically linked in * Public headers of vendored frameworks are now automatically linked in
the sandbox. That allows transitive inclusion of headers from other pods. the sandbox. That allows transitive inclusion of headers from other pods.
[Vincent Isambart](https://github.com/vincentisambart) [Vincent Isambart](https://github.com/vincentisambart)
......
...@@ -115,16 +115,17 @@ module Pod ...@@ -115,16 +115,17 @@ module Pod
UI.message '- Linking headers' do UI.message '- Linking headers' do
libraries.each do |library| libraries.each do |library|
library.file_accessors.each do |file_accessor| library.file_accessors.each do |file_accessor|
framework_exp = /.framework\//
headers_sandbox = Pathname.new(file_accessor.spec.root.name) headers_sandbox = Pathname.new(file_accessor.spec.root.name)
library.build_headers.add_search_path(headers_sandbox, library.platform) library.build_headers.add_search_path(headers_sandbox, library.platform)
sandbox.public_headers.add_search_path(headers_sandbox, library.platform) sandbox.public_headers.add_search_path(headers_sandbox, library.platform)
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|
library.build_headers.add_files(namespaced_path, files, library.platform) library.build_headers.add_files(namespaced_path, files.reject { |f| f.to_path =~ framework_exp }, library.platform)
end end
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, library.platform) sandbox.public_headers.add_files(namespaced_path, files.reject { |f| f.to_path =~ framework_exp }, library.platform)
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|
......
...@@ -168,7 +168,7 @@ module Pod ...@@ -168,7 +168,7 @@ module Pod
# #
def self.vendored_frameworks_headers(framework) def self.vendored_frameworks_headers(framework)
headers_dir = vendored_frameworks_headers_dir(framework) headers_dir = vendored_frameworks_headers_dir(framework)
Pathname.glob(headers_dir + GLOB_PATTERNS[:public_header_files]) Pathname.glob(headers_dir + '**/' + GLOB_PATTERNS[:public_header_files])
end end
# @return [Array<Pathname>] The paths of the framework headers that come # @return [Array<Pathname>] The paths of the framework headers that come
......
...@@ -66,9 +66,11 @@ module Pod ...@@ -66,9 +66,11 @@ module Pod
public_header = headers_root + 'BananaLib/Banana.h' public_header = headers_root + 'BananaLib/Banana.h'
private_header = headers_root + 'BananaLib/BananaPrivate.h' private_header = headers_root + 'BananaLib/BananaPrivate.h'
framework_header = headers_root + 'BananaLib/Bananalib/Bananalib.h' framework_header = headers_root + 'BananaLib/Bananalib/Bananalib.h'
framework_subdir_header = headers_root + 'BananaLib/Bananalib/SubDir/SubBananalib.h'
public_header.should.exist public_header.should.exist
private_header.should.not.exist private_header.should.not.exist
framework_header.should.exist framework_header.should.exist
framework_subdir_header.should.exist
end end
end end
...@@ -132,9 +134,11 @@ module Pod ...@@ -132,9 +134,11 @@ module Pod
it 'returns the vendored frameworks header mappings' do it 'returns the vendored frameworks header mappings' do
headers_sandbox = Pathname.new('BananaLib') headers_sandbox = Pathname.new('BananaLib')
header = @file_accessor.root + 'Bananalib.framework/Versions/A/Headers/Bananalib.h' header = @file_accessor.root + 'Bananalib.framework/Versions/A/Headers/Bananalib.h'
header_subdir = @file_accessor.root + 'Bananalib.framework/Versions/A/Headers/SubDir/SubBananalib.h'
mappings = @installer.send(:vendored_frameworks_header_mappings, headers_sandbox, @file_accessor) mappings = @installer.send(:vendored_frameworks_header_mappings, headers_sandbox, @file_accessor)
mappings.should == { mappings.should == {
(headers_sandbox + 'Bananalib') => [header], (headers_sandbox + 'Bananalib') => [header],
(headers_sandbox + 'Bananalib/SubDir') => [header_subdir],
} }
end end
end end
......
...@@ -94,6 +94,7 @@ module Pod ...@@ -94,6 +94,7 @@ module Pod
it 'includes the vendored framework headers if requested' do it 'includes the vendored framework headers if requested' do
@accessor.public_headers(true).sort.should == [ @accessor.public_headers(true).sort.should == [
@root + 'Bananalib.framework/Versions/A/Headers/Bananalib.h', @root + 'Bananalib.framework/Versions/A/Headers/Bananalib.h',
@root + 'Bananalib.framework/Versions/A/Headers/SubDir/SubBananalib.h',
@root + 'Classes/Banana.h', @root + 'Classes/Banana.h',
] ]
end end
...@@ -128,6 +129,7 @@ module Pod ...@@ -128,6 +129,7 @@ module Pod
it 'returns the paths of the framework headers' do it 'returns the paths of the framework headers' do
@accessor.vendored_frameworks_headers.should == [ @accessor.vendored_frameworks_headers.should == [
@root + 'Bananalib.framework/Versions/A/Headers/Bananalib.h', @root + 'Bananalib.framework/Versions/A/Headers/Bananalib.h',
@root + 'Bananalib.framework/Versions/A/Headers/SubDir/SubBananalib.h',
] ]
end end
......
...@@ -16,6 +16,7 @@ module Pod ...@@ -16,6 +16,7 @@ module Pod
Banana.modulemap Banana.modulemap
BananaLib.podspec BananaLib.podspec
Bananalib.framework/Versions/A/Headers/Bananalib.h Bananalib.framework/Versions/A/Headers/Bananalib.h
Bananalib.framework/Versions/A/Headers/SubDir/SubBananalib.h
Classes/Banana.h Classes/Banana.h
Classes/Banana.m Classes/Banana.m
Classes/BananaLib.pch Classes/BananaLib.pch
...@@ -45,6 +46,7 @@ module Pod ...@@ -45,6 +46,7 @@ module Pod
Bananalib.framework/Versions Bananalib.framework/Versions
Bananalib.framework/Versions/A Bananalib.framework/Versions/A
Bananalib.framework/Versions/A/Headers Bananalib.framework/Versions/A/Headers
Bananalib.framework/Versions/A/Headers/SubDir
Bananalib.framework/Versions/Current Bananalib.framework/Versions/Current
Classes Classes
Resources Resources
......
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