Commit b259fa7c authored by Samuel E. Giddins's avatar Samuel E. Giddins

Merge pull request #3868 from perotinus/no_framework_headers_in_public

parents 37ca3381 7b3da4a2
...@@ -23,6 +23,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -23,6 +23,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[#3857](https://github.com/CocoaPods/CocoaPods/issues/3857) [#3857](https://github.com/CocoaPods/CocoaPods/issues/3857)
[Jonathan MacMillan](https://github.com/perotinus) [Jonathan MacMillan](https://github.com/perotinus)
* Only link public headers in the sandbox for Pods that are not being built
into dynamic frameworks, when integrating Pods as frameworks
[#3867](https://github.com/CocoaPods/CocoaPods/issues/3867)
[Jonathan MacMillan](https://github.com/perotinus)
## 0.38.0 ## 0.38.0
......
...@@ -118,15 +118,24 @@ module Pod ...@@ -118,15 +118,24 @@ module Pod
framework_exp = /\.framework\// framework_exp = /\.framework\//
headers_sandbox = Pathname.new(file_accessor.spec.root.name) headers_sandbox = Pathname.new(file_accessor.spec.root.name)
pod_target.build_headers.add_search_path(headers_sandbox, pod_target.platform) pod_target.build_headers.add_search_path(headers_sandbox, pod_target.platform)
# When integrating Pod as frameworks, built Pods are built into
# frameworks, whose headers are included inside the built
# framework. Those headers do not need to be linked from the
# sandbox.
unless pod_target.requires_frameworks? && pod_target.should_build?
sandbox.public_headers.add_search_path(headers_sandbox, pod_target.platform) sandbox.public_headers.add_search_path(headers_sandbox, pod_target.platform)
end
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|
pod_target.build_headers.add_files(namespaced_path, files.reject { |f| f.to_path =~ framework_exp }, pod_target.platform) pod_target.build_headers.add_files(namespaced_path, files.reject { |f| f.to_path =~ framework_exp }, pod_target.platform)
end end
unless pod_target.requires_frameworks? && pod_target.should_build?
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.reject { |f| f.to_path =~ framework_exp }, pod_target.platform) sandbox.public_headers.add_files(namespaced_path, files.reject { |f| f.to_path =~ framework_exp }, pod_target.platform)
end 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|
sandbox.public_headers.add_files(namespaced_path, files, pod_target.platform) sandbox.public_headers.add_files(namespaced_path, files, pod_target.platform)
......
...@@ -8,4 +8,5 @@ Pod::Spec.new do |s| ...@@ -8,4 +8,5 @@ Pod::Spec.new do |s|
s.source = { :git => "http://monkey.local/monkey.git", :tag => s.version.to_s } s.source = { :git => "http://monkey.local/monkey.git", :tag => s.version.to_s }
s.license = 'MIT' s.license = 'MIT'
s.vendored_library = 'monkey.a' s.vendored_library = 'monkey.a'
s.public_header_files = 'monkey.h'
end end
...@@ -70,6 +70,22 @@ module Pod ...@@ -70,6 +70,22 @@ module Pod
framework_header.should.exist framework_header.should.exist
framework_subdir_header.should.exist framework_subdir_header.should.exist
end end
it 'links the public headers meant for the user, but only for Pods that are not built' do
Target.any_instance.stubs(:requires_frameworks?).returns(true)
pod_target_one = fixture_pod_target('banana-lib/BananaLib.podspec')
pod_target_two = fixture_pod_target('monkey/monkey.podspec')
project = Project.new(config.sandbox.project_path)
project.add_pod_group('BananaLib', fixture('banana-lib'))
project.add_pod_group('monkey', fixture('monkey'))
installer = Installer::FileReferencesInstaller.new(config.sandbox, [pod_target_one, pod_target_two], project)
installer.install!
headers_root = config.sandbox.public_headers.root
banana_headers = [headers_root + 'BananaLib/Banana.h', headers_root + 'BananaLib/MoreBanana.h']
banana_headers.each { |banana_header| banana_header.should.not.exist }
monkey_header = headers_root + 'monkey/monkey.h'
monkey_header.should.exist
end
end end
#-------------------------------------------------------------------------# #-------------------------------------------------------------------------#
......
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