Commit 496d2b77 authored by Samuel E. Giddins's avatar Samuel E. Giddins

[ModuleMap] Explicitly declare private headers

parent 1265bea9
...@@ -10,10 +10,15 @@ module Pod ...@@ -10,10 +10,15 @@ module Pod
# #
attr_reader :target attr_reader :target
# @return [Array] the private headers of the module
#
attr_accessor :private_headers
# @param [Target] target @see target # @param [Target] 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.
...@@ -35,14 +40,24 @@ module Pod ...@@ -35,14 +40,24 @@ module Pod
# @return [String] # @return [String]
# #
def generate def generate
<<-eos.strip_heredoc result = <<-eos.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 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
end end
end end
end end
......
...@@ -107,12 +107,16 @@ module Pod ...@@ -107,12 +107,16 @@ module Pod
# Creates the module map file which ensures that the umbrella header is # Creates the module map file which ensures that the umbrella header is
# recognized with a customized path # recognized with a customized path
# #
# @yield_param [Generator::ModuleMap]
# yielded once to configure the private headers
#
# @return [void] # @return [void]
# #
def create_module_map def create_module_map
path = target.module_map_path path = target.module_map_path
UI.message "- Generating module map file at #{UI.path(path)}" do UI.message "- Generating module map file at #{UI.path(path)}" do
generator = Generator::ModuleMap.new(target) generator = Generator::ModuleMap.new(target)
yield generator if block_given?
generator.save_as(path) generator.save_as(path)
add_file_to_support_group(path) add_file_to_support_group(path)
......
...@@ -22,7 +22,9 @@ module Pod ...@@ -22,7 +22,9 @@ 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 create_module_map do |generator|
generator.private_headers += target.file_accessors.flat_map(&:private_headers).map(&:basename)
end
create_umbrella_header do |generator| create_umbrella_header do |generator|
generator.imports += target.file_accessors.flat_map(&:public_headers).map(&:basename) generator.imports += target.file_accessors.flat_map(&:public_headers).map(&:basename)
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