Commit 95d59b9d authored by Samuel Giddins's avatar Samuel Giddins

Allow enabling modular headers in the podfile

parent be48c58f
...@@ -7,7 +7,7 @@ GIT ...@@ -7,7 +7,7 @@ GIT
GIT GIT
remote: https://github.com/CocoaPods/Core.git remote: https://github.com/CocoaPods/Core.git
revision: 1f8ced657a224eabeba6958d130ee04058d91f60 revision: e0c6884b37ab6a44095a2bbdbfe9032627a90388
branch: master branch: master
specs: specs:
cocoapods-core (1.4.0) cocoapods-core (1.4.0)
......
...@@ -204,6 +204,7 @@ module Pod ...@@ -204,6 +204,7 @@ module Pod
def defines_module? def defines_module?
return @defines_module if defined?(@defines_module) return @defines_module if defined?(@defines_module)
return @defines_module = true if uses_swift? || requires_frameworks? return @defines_module = true if uses_swift? || requires_frameworks?
return @defines_module = true if target_definitions.any? { |td| td.build_pod_as_module?(pod_name) }
@defines_module = non_test_specs.any? { |s| s.consumer(platform).pod_target_xcconfig['DEFINES_MODULE'] == 'YES' } @defines_module = non_test_specs.any? { |s| s.consumer(platform).pod_target_xcconfig['DEFINES_MODULE'] == 'YES' }
end end
......
...@@ -287,6 +287,19 @@ module Pod ...@@ -287,6 +287,19 @@ module Pod
@pod_target.stubs(:defines_module?).returns(true) @pod_target.stubs(:defines_module?).returns(true)
end end
it 'uses modular header search paths when specified in the podfile' do
@pod_target.unstub(:defines_module?)
@pod_target.target_definitions.first.stubs(:build_pod_as_module?).with('BananaLib').returns(true)
@pod_target.build_headers.add_search_path('BananaLib', Platform.ios)
@pod_target.sandbox.public_headers.add_search_path('BananaLib', Platform.ios)
header_search_paths = @pod_target.header_search_paths
header_search_paths.sort.should == [
'${PODS_ROOT}/Headers/Private/BananaLib',
'${PODS_ROOT}/Headers/Public/BananaLib',
]
end
it 'returns the correct header search paths' do it 'returns the correct header search paths' do
@pod_target.build_headers.add_search_path('BananaLib', Platform.ios) @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('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