Unverified Commit 815f56bf authored by D. Koutsogiorgas's avatar D. Koutsogiorgas Committed by GitHub

Merge pull request #7724 from chuganzy/fix_umbrella_header_path

Fix a bug that umbrella  header import fails in a specific case
parents 81523e24 50e0bda5
......@@ -24,6 +24,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes
* Umbrella header import path gets wrong when `header_dir` is specified in PodSpec + try to build statically + Modular header is enabled
[chuganzy](https://github.com/chuganzy)
[#7724](https://github.com/CocoaPods/CocoaPods/pull/7724)
* Do not build pod target if it only contains script phases
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#7746](https://github.com/CocoaPods/CocoaPods/issues/7746)
......
......@@ -58,13 +58,23 @@ module Pod
generator.headers.concat module_map_additional_headers
end
create_umbrella_header(native_target) do |generator|
generator.imports += if header_mappings_dir
file_accessors.flat_map(&:public_headers).map do |pathname|
pathname.relative_path_from(header_mappings_dir)
end
else
file_accessors.flat_map(&:public_headers).map(&:basename)
generator.imports += file_accessors.flat_map do |file_accessor|
header_dir = if !target.requires_frameworks? && dir = file_accessor.spec_consumer.header_dir
Pathname.new(dir)
end
file_accessor.public_headers.map do |public_header|
public_header = if header_mappings_dir
public_header.relative_path_from(header_mappings_dir)
else
public_header.basename
end
if header_dir
public_header = header_dir.join(public_header)
end
public_header
end
end
end
end
......
......@@ -261,6 +261,35 @@ module Pod
content.should.not =~ /"CoconutTestHeader.h"/
end
it 'uses header_dir to umbrella header imports' do
@coconut_pod_target.file_accessors.first.spec_consumer.stubs(:header_dir).returns('Coconut')
@coconut_pod_target.stubs(:requires_frameworks?).returns(false)
@coconut_pod_target.stubs(:defines_module?).returns(true)
@installer.install!
content = @coconut_pod_target.umbrella_header_path.read
content.should =~ %r{"Coconut/Coconut.h"}
end
it 'uses header_dir and header_mappings_dir to umbrella header imports' do
@coconut_pod_target.file_accessors.first.spec_consumer.stubs(:header_dir).returns('Coconut2')
@coconut_pod_target.file_accessors.first.spec_consumer.stubs(:header_mappings_dir).returns('Classes')
@coconut_pod_target.stubs(:requires_frameworks?).returns(false)
@coconut_pod_target.stubs(:defines_module?).returns(true)
@installer.install!
content = @coconut_pod_target.umbrella_header_path.read
content.should =~ %r{"Coconut2/Coconut.h"}
end
it 'does not use header_dir to umbrella header imports' do
@coconut_pod_target.file_accessors.first.spec_consumer.stubs(:header_dir).returns('Coconut')
@coconut_pod_target.stubs(:requires_frameworks?).returns(true)
@coconut_pod_target.stubs(:defines_module?).returns(true)
@installer.install!
content = @coconut_pod_target.umbrella_header_path.read
content.should.not =~ %r{"Coconut/Coconut.h"}
content.should =~ /"Coconut.h"/
end
it 'adds test xcconfig file reference for test resource bundle targets' do
@coconut_spec.test_specs.first.resource_bundle = { 'CoconutLibTestResources' => ['Model.xcdatamodeld'] }
installation_result = @installer.install!
......
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