Commit 484a0dbc authored by Samuel E. Giddins's avatar Samuel E. Giddins

Merge pull request #4476 from CocoaPods/seg-no-framework-build-headers

[FileReferencesInstaller] Dont create build headers for frameworks
parents 46c26b0e 6fb0bfa4
......@@ -81,7 +81,7 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
* Prevent installer to be run from inside sandbox directory.
[Muhammed Yavuz Nuzumlalı](https://github.com/manuyavuz)
* Improve repo lint error message when no repo found with given name.
[Muhammed Yavuz Nuzumlalı](https://github.com/manuyavuz)
[#4142](https://github.com/CocoaPods/CocoaPods/issues/4142)
......@@ -123,6 +123,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Samuel Giddins](https://github.com/segiddins)
[#1917](https://github.com/CocoaPods/CocoaPods/issues/1917)
* Headers used to build a pod will no longer be duplicated for frameworks.
[Samuel Giddins](https://github.com/segiddins)
[#4420](https://github.com/CocoaPods/CocoaPods/issues/4420)
## 0.39.0 (2015-10-09)
......
......@@ -10,17 +10,12 @@ module Pod
#
attr_reader :target
# @return [Array<#to_s>] the private headers of the module
#
attr_accessor :private_headers
# Initialize a new instance
#
# @param [PodTarget] target @see target
#
def initialize(target)
@target = target
@private_headers = []
end
# Generates and saves the Info.plist to the given path.
......@@ -42,24 +37,14 @@ module Pod
# @return [String]
#
def generate
result = <<-eos.strip_heredoc
<<-MODULE_MAP.strip_heredoc
framework module #{target.product_module_name} {
umbrella header "#{target.umbrella_header_path.basename}"
export *
module * { export * }
eos
result << "\n#{generate_private_header_exports}" unless private_headers.empty?
result << "}\n"
end
private
def generate_private_header_exports
private_headers.reduce('') do |string, header|
string << %( private header "#{header}"\n)
end
}
MODULE_MAP
end
end
end
......
......@@ -117,21 +117,19 @@ module Pod
pod_target.file_accessors.each do |file_accessor|
framework_exp = /\.framework\//
headers_sandbox = Pathname.new(file_accessor.spec.root.name)
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?
pod_target.build_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|
pod_target.build_headers.add_files(namespaced_path, files.reject { |f| f.to_path =~ framework_exp })
end
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 })
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|
sandbox.public_headers.add_files(namespaced_path, files.reject { |f| f.to_path =~ framework_exp })
end
......
......@@ -22,9 +22,7 @@ module Pod
create_xcconfig_file
if target.requires_frameworks?
create_info_plist_file
create_module_map do |generator|
generator.private_headers += target.file_accessors.flat_map(&:private_headers).map(&:basename)
end
create_module_map
create_umbrella_header do |generator|
if header_mappings_dir
generator.imports += target.file_accessors.flat_map(&:public_headers).map do |pathname|
......
Subproject commit a92acf831ad074eee73953e27acbd573a82eb274
Subproject commit 10f25aa8855b5230f9068a8f6db3a8ebff67efd6
......@@ -21,19 +21,5 @@ module Pod
}
EOS
end
it 'correctly adds private headers' do
@gen.stubs(:private_headers).returns(['Private.h'])
@gen.generate.should == <<-EOS.strip_heredoc
framework module BananaLib {
umbrella header "BananaLib-umbrella.h"
export *
module * { export * }
private header "Private.h"
}
EOS
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