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` ...@@ -81,7 +81,7 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
* Prevent installer to be run from inside sandbox directory. * Prevent installer to be run from inside sandbox directory.
[Muhammed Yavuz Nuzumlalı](https://github.com/manuyavuz) [Muhammed Yavuz Nuzumlalı](https://github.com/manuyavuz)
* Improve repo lint error message when no repo found with given name. * Improve repo lint error message when no repo found with given name.
[Muhammed Yavuz Nuzumlalı](https://github.com/manuyavuz) [Muhammed Yavuz Nuzumlalı](https://github.com/manuyavuz)
[#4142](https://github.com/CocoaPods/CocoaPods/issues/4142) [#4142](https://github.com/CocoaPods/CocoaPods/issues/4142)
...@@ -123,6 +123,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -123,6 +123,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Samuel Giddins](https://github.com/segiddins) [Samuel Giddins](https://github.com/segiddins)
[#1917](https://github.com/CocoaPods/CocoaPods/issues/1917) [#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) ## 0.39.0 (2015-10-09)
......
...@@ -10,17 +10,12 @@ module Pod ...@@ -10,17 +10,12 @@ module Pod
# #
attr_reader :target attr_reader :target
# @return [Array<#to_s>] the private headers of the module
#
attr_accessor :private_headers
# Initialize a new instance # Initialize a new instance
# #
# @param [PodTarget] target @see target # @param [PodTarget] target @see target
# #
def initialize(target) def initialize(target)
@target = target @target = target
@private_headers = []
end end
# Generates and saves the Info.plist to the given path. # Generates and saves the Info.plist to the given path.
...@@ -42,24 +37,14 @@ module Pod ...@@ -42,24 +37,14 @@ module Pod
# @return [String] # @return [String]
# #
def generate def generate
result = <<-eos.strip_heredoc <<-MODULE_MAP.strip_heredoc
framework module #{target.product_module_name} { framework module #{target.product_module_name} {
umbrella header "#{target.umbrella_header_path.basename}" umbrella header "#{target.umbrella_header_path.basename}"
export * export *
module * { export * } module * { export * }
eos }
MODULE_MAP
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
end end
end end
end end
......
...@@ -117,21 +117,19 @@ module Pod ...@@ -117,21 +117,19 @@ module Pod
pod_target.file_accessors.each do |file_accessor| pod_target.file_accessors.each do |file_accessor|
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)
# When integrating Pod as frameworks, built Pods are built into # When integrating Pod as frameworks, built Pods are built into
# frameworks, whose headers are included inside the built # frameworks, whose headers are included inside the built
# framework. Those headers do not need to be linked from the # framework. Those headers do not need to be linked from the
# sandbox. # sandbox.
unless pod_target.requires_frameworks? && pod_target.should_build? 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) 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.build_headers.add_files(namespaced_path, files.reject { |f| f.to_path =~ framework_exp })
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 }) sandbox.public_headers.add_files(namespaced_path, files.reject { |f| f.to_path =~ framework_exp })
end end
......
...@@ -22,9 +22,7 @@ module Pod ...@@ -22,9 +22,7 @@ module Pod
create_xcconfig_file create_xcconfig_file
if target.requires_frameworks? if target.requires_frameworks?
create_info_plist_file create_info_plist_file
create_module_map do |generator| create_module_map
generator.private_headers += target.file_accessors.flat_map(&:private_headers).map(&:basename)
end
create_umbrella_header do |generator| create_umbrella_header do |generator|
if header_mappings_dir if header_mappings_dir
generator.imports += target.file_accessors.flat_map(&:public_headers).map do |pathname| generator.imports += target.file_accessors.flat_map(&:public_headers).map do |pathname|
......
Subproject commit a92acf831ad074eee73953e27acbd573a82eb274 Subproject commit 10f25aa8855b5230f9068a8f6db3a8ebff67efd6
...@@ -21,19 +21,5 @@ module Pod ...@@ -21,19 +21,5 @@ module Pod
} }
EOS EOS
end 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
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