Commit d9e19706 authored by Samuel Giddins's avatar Samuel Giddins

[PodTargetInstaller] Generate module maps that exclude other target’s umbrella headers

This allows us to avoid incomplete umbrella header warnings
parent 41ac8d24
...@@ -165,8 +165,14 @@ module Pod ...@@ -165,8 +165,14 @@ module Pod
def install_libraries def install_libraries
UI.message '- Installing targets' do UI.message '- Installing targets' do
umbrella_headers_by_dir = pod_targets.map do |pod_target|
next unless pod_target.should_build? && pod_target.defines_module?
pod_target.umbrella_header_path
end.compact.group_by(&:dirname)
pod_targets.sort_by(&:name).each do |pod_target| pod_targets.sort_by(&:name).each do |pod_target|
target_installer = PodTargetInstaller.new(sandbox, pod_target) target_installer = PodTargetInstaller.new(sandbox, pod_target)
target_installer.umbrella_headers_by_dir = umbrella_headers_by_dir
target_installer.install! target_installer.install!
end end
......
...@@ -29,7 +29,9 @@ module Pod ...@@ -29,7 +29,9 @@ module Pod
create_test_xcconfig_files if target.contains_test_specifications? create_test_xcconfig_files if target.contains_test_specifications?
# TODO: determine if it is safe to unconditionally create (& 'link') module maps & umbrella # TODO: determine if it is safe to unconditionally create (& 'link') module maps & umbrella
# headers for _all_ static libraries -- we've caused bugs by trying to do this in the past # headers for _all_ static libraries -- we've caused bugs by trying to do this in the past
create_module_map create_module_map do |generator|
generator.headers.concat module_map_additional_headers
end
create_umbrella_header do |generator| create_umbrella_header do |generator|
file_accessors = target.file_accessors file_accessors = target.file_accessors
file_accessors = file_accessors.reject { |f| f.spec.test_specification? } if target.contains_test_specifications? file_accessors = file_accessors.reject { |f| f.spec.test_specification? } if target.contains_test_specifications?
...@@ -68,6 +70,11 @@ module Pod ...@@ -68,6 +70,11 @@ module Pod
end end
end end
# @return [Hash<Pathname,Pathname>] A hash of all umbrella headers, grouped by the directory
# the are stored in
#
attr_accessor :umbrella_headers_by_dir
private private
# @param [Array<Specification>] specs # @param [Array<Specification>] specs
...@@ -630,6 +637,17 @@ module Pod ...@@ -630,6 +637,17 @@ module Pod
end end
end end
def module_map_additional_headers
return [] unless umbrella_headers_by_dir
other_paths = umbrella_headers_by_dir[target.module_map_path.dirname] - [target.umbrella_header_path]
other_paths.map do |module_map_path|
# exclude other targets umbrella headers, to avoid
# incomplete umbrella warnings
Generator::ModuleMap::Header.new(module_map_path.basename, nil, nil, nil, true)
end
end
def create_umbrella_header def create_umbrella_header
return super unless custom_module_map return super unless custom_module_map
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