Commit ee262b59 authored by Vincent Isambart's avatar Vincent Isambart

Public headers in a directory named `framework` should be linked in the sandbox.

parent 4b5f54d8
......@@ -20,6 +20,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Samuel Giddins](https://github.com/segiddins)
[#3674](https://github.com/CocoaPods/CocoaPods/issues/3674)
* Public headers inside a directory named `framework` should be linked in the
sandbox.
[Vincent Isambart](https://github.com/vincentisambart)
[#3751](https://github.com/CocoaPods/CocoaPods/issues/3751)
## 0.38.0.beta.1
......
......@@ -115,7 +115,7 @@ module Pod
UI.message '- Linking headers' do
pod_targets.each do |pod_target|
pod_target.file_accessors.each do |file_accessor|
framework_exp = /.framework\//
framework_exp = /\.framework\//
headers_sandbox = Pathname.new(file_accessor.spec.root.name)
pod_target.build_headers.add_search_path(headers_sandbox, pod_target.platform)
sandbox.public_headers.add_search_path(headers_sandbox, pod_target.platform)
......
......@@ -46,7 +46,7 @@ module Pod
end
it 'returns the slug' do
@request.slug.should == 'Release/BananaLib/1.0-59a13'
@request.slug.should == 'Release/BananaLib/1.0-832cd'
end
end
......
......@@ -50,10 +50,10 @@ module Pod
it 'links the headers required for building the pod target' do
@installer.install!
headers_root = @pod_target.build_headers.root
public_header = headers_root + 'BananaLib/Banana.h'
public_headers = [headers_root + 'BananaLib/Banana.h', headers_root + 'BananaLib/MoreBanana.h']
private_header = headers_root + 'BananaLib/BananaPrivate.h'
framework_header = headers_root + 'BananaLib/Bananalib/Bananalib.h'
public_header.should.exist
public_headers.each { |public_header| public_header.should.exist }
private_header.should.exist
framework_header.should.not.exist
end
......@@ -61,11 +61,11 @@ module Pod
it 'links the public headers meant for the user' do
@installer.install!
headers_root = config.sandbox.public_headers.root
public_header = headers_root + 'BananaLib/Banana.h'
public_headers = [headers_root + 'BananaLib/Banana.h', headers_root + 'BananaLib/MoreBanana.h']
private_header = headers_root + 'BananaLib/BananaPrivate.h'
framework_header = headers_root + 'BananaLib/Bananalib/Bananalib.h'
framework_subdir_header = headers_root + 'BananaLib/Bananalib/SubDir/SubBananalib.h'
public_header.should.exist
public_headers.each { |public_header| public_header.should.exist }
private_header.should.not.exist
framework_header.should.exist
framework_subdir_header.should.exist
......
......@@ -46,6 +46,7 @@ module Pod
@root + 'Classes/Banana.m',
@root + 'Classes/BananaPrivate.h',
@root + 'Classes/BananaTrace.d',
@root + 'framework/Source/MoreBanana.h',
]
end
......@@ -55,6 +56,7 @@ module Pod
@root + 'Classes/Banana.m',
@root + 'Classes/BananaPrivate.h',
@root + 'Classes/BananaTrace.d',
@root + 'framework/Source/MoreBanana.h',
]
end
......@@ -66,12 +68,14 @@ module Pod
@accessor.headers.sort.should == [
@root + 'Classes/Banana.h',
@root + 'Classes/BananaPrivate.h',
@root + 'framework/Source/MoreBanana.h',
]
end
it 'returns the public headers' do
@accessor.public_headers.sort.should == [
@root + 'Classes/Banana.h',
@root + 'framework/Source/MoreBanana.h',
]
end
......@@ -80,6 +84,7 @@ module Pod
@accessor.public_headers.sort.should == [
@root + 'Classes/Banana.h',
@root + 'Classes/BananaPrivate.h',
@root + 'framework/Source/MoreBanana.h',
]
end
......@@ -88,6 +93,7 @@ module Pod
@spec_consumer.stubs(:private_header_files).returns(['**/*Private*'])
@accessor.public_headers.sort.should == [
@root + 'Classes/Banana.h',
@root + 'framework/Source/MoreBanana.h',
]
end
......@@ -96,6 +102,7 @@ module Pod
@root + 'Bananalib.framework/Versions/A/Headers/Bananalib.h',
@root + 'Bananalib.framework/Versions/A/Headers/SubDir/SubBananalib.h',
@root + 'Classes/Banana.h',
@root + 'framework/Source/MoreBanana.h',
]
end
......@@ -177,6 +184,7 @@ module Pod
@root + 'Classes/Banana.h',
@root + 'Classes/Banana.m',
@root + 'Classes/BananaTrace.d',
@root + 'framework/Source/MoreBanana.h',
]
end
......@@ -200,6 +208,7 @@ module Pod
@root + 'Classes/Banana.h',
@root + 'Classes/BananaPrivate.h',
@root + 'Classes/BananaTrace.d',
@root + 'framework/Source/MoreBanana.h',
]
end
end
......@@ -210,7 +219,7 @@ module Pod
describe 'Private helpers' do
describe '#paths_for_attribute' do
it 'takes into account dir patterns and excluded files' do
file_patterns = ['Classes/*.{h,m,d}', 'Vendor']
file_patterns = ['Classes/*.{h,m,d}', 'Vendor', 'framework/Source/*.h']
options = {
:exclude_patterns => ['Classes/**/osx/**/*', 'Resources/**/osx/**/*'],
:dir_pattern => '*{.m,.mm,.c,.cc,.cxx,.cpp,.c++,.swift,.h,.hh,.hpp,.ipp,.tpp}',
......
......@@ -27,6 +27,7 @@ module Pod
Resources/Images.xcassets/Logo.imageset/logo.png
Resources/logo-sidebar.png
Resources/sub_dir/logo-sidebar.png
framework/Source/MoreBanana.h
libBananalib.a
preserve_me.txt
sub-dir/sub-dir-2/somefile.txt
......@@ -53,6 +54,8 @@ module Pod
Resources/Images.xcassets
Resources/Images.xcassets/Logo.imageset
Resources/sub_dir
framework
framework/Source
sub-dir
sub-dir/sub-dir-2
)
......
......@@ -46,6 +46,7 @@ module Pod
'Resources/Images.xcassets',
'Resources/logo-sidebar.png',
'Resources/sub_dir',
'framework/Source/MoreBanana.h',
'libBananalib.a',
'preserve_me.txt',
]
......
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