Unverified Commit 4d95ed04 authored by Dimitris Koutsogiorgas's avatar Dimitris Koutsogiorgas Committed by GitHub

Merge pull request #7600 from paulb777/modular-header-dir

Fix modular header access to header_dirs
parents 15c4baed 68b1552f
......@@ -13,6 +13,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes
* Fix modular header access to header_dir's.
[Paul Beusterien](https://github.com/paulb777)
[#7597](https://github.com/CocoaPods/CocoaPods/issues/7597)
* Inhibit warnings for all dependencies during validation except for the one being validated
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#7434](https://github.com/CocoaPods/CocoaPods/issues/7434)
......
......@@ -612,14 +612,14 @@ module Pod
# @param [Boolean] only_if_defines_modules
# whether the use of modular headers should require the target to define a module
#
# @note This must return false when a pod has a `header_mappings_dir`,
# as that allows the spec to completely customize the header structure, and
# @note This must return false when a pod has a `header_mappings_dir` or `header_dir`,
# as that allows the spec to customize the header structure, and
# therefore it might not be expecting the module name to be prepended
# to imports at all.
#
def uses_modular_headers?(only_if_defines_modules = true)
return false if only_if_defines_modules && !defines_module?
spec_consumers.none?(&:header_mappings_dir)
spec_consumers.none?(&:header_mappings_dir) && spec_consumers.none?(&:header_dir)
end
private
......
......@@ -326,6 +326,23 @@ module Pod
]
end
it 'returns header search path including header_dir from dependent' do
@pod_target.build_headers.add_search_path('BananaLib', Platform.ios)
@pod_target.sandbox.public_headers.add_search_path('BananaLib', Platform.ios)
@pod_target.sandbox.public_headers.add_search_path('monkey', Platform.ios)
@monkey_pod_target = fixture_pod_target('monkey/monkey.podspec')
@monkey_pod_target.stubs(:platform).returns(Platform.ios)
@pod_target.stubs(:dependent_targets).returns([@monkey_pod_target])
@file_accessor = @monkey_pod_target.file_accessors.first
@file_accessor.spec_consumer.stubs(:header_dir).returns('Sub_dir')
header_search_paths = @pod_target.header_search_paths
header_search_paths.sort.should == [
'${PODS_ROOT}/Headers/Private/BananaLib',
'${PODS_ROOT}/Headers/Public',
'${PODS_ROOT}/Headers/Public/monkey',
]
end
it 'returns the correct header search paths recursively for dependent targets excluding platform' do
@pod_target.build_headers.add_search_path('BananaLib', Platform.ios)
@pod_target.sandbox.public_headers.add_search_path('BananaLib', Platform.ios)
......
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