Commit 847e309e authored by Samuel Giddins's avatar Samuel Giddins

[PodTargetInstaller] Write custom module maps using a generator

parent d9e19706
...@@ -614,19 +614,15 @@ module Pod ...@@ -614,19 +614,15 @@ module Pod
def create_module_map def create_module_map
return super unless custom_module_map return super unless custom_module_map
path = target.module_map_path path = target.module_map_path
path.mkpath
UI.message "- Copying module map file to #{UI.path(path)}" do UI.message "- Copying module map file to #{UI.path(path)}" do
Tempfile.open(path.basename.to_s) do |tmp_module_map|
contents = custom_module_map.read contents = custom_module_map.read
unless target.requires_frameworks? unless target.requires_frameworks?
contents.gsub!(/^(\s*)framework\s+module/, '\1module') contents.gsub!(/^(\s*)framework\s+module/, '\1module')
end end
tmp_module_map.write contents generator = Generator::Constant.new(contents)
tmp_module_map.rewind update_changed_file(generator, path)
unless path.exist? && FileUtils.identical?(tmp_module_map, path)
FileUtils.cp(tmp_module_map, path)
end
add_file_to_support_group(path) add_file_to_support_group(path)
native_target.build_configurations.each do |c| native_target.build_configurations.each do |c|
...@@ -635,7 +631,6 @@ module Pod ...@@ -635,7 +631,6 @@ module Pod
end end
end end
end end
end
def module_map_additional_headers def module_map_additional_headers
return [] unless umbrella_headers_by_dir return [] unless umbrella_headers_by_dir
......
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