Commit 5b277b8e authored by Todd Casey's avatar Todd Casey

Added specs and fixed duplicate headers

Fixed issue caused by the original fix for #3161, where build and
public headers were included in the Public/Headers/SpecName directory,
even if they were correctly included also in the
Public/Headers/SpecName/FrameworkName directory as the fix for #3161
was addressing. The headers defined in either source_files and
public_header_files will be ignored if they are already included by the
vendored_frameworks.

- Updated banana-lib.tar.gz to include a SubDir/SubBananalib.h in the
Bananalib.framework.

- Updated broken specs because of the new SubDir/SubBananalib.h header,
and also expanded the new vendor spec added for #3161 to include a
validation for the pretense of SubDir/SubBananalib.h.
parent cf7629f9
...@@ -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 = Regexp.new "/(#{file_accessor.spec_consumer.send(:vendored_frameworks).join(')|(')})/"
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.select { |f| framework_exp.match(f.to_path).nil? }, 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.select { |f| framework_exp.match(f.to_path).nil? }, 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|
......
...@@ -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