Commit 8b87bc53 authored by Jonathan MacMillan's avatar Jonathan MacMillan

When integrating pods as frameworks, only link public headers into the sandbox…

When integrating pods as frameworks, only link public headers into the sandbox if those headers are from a Pod that is not being built (that is, a static library pod that's being statically linked into the user target).
parent 9aae39e8
...@@ -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