Skip to content

Commit ae24842

Browse files
committed
Fix copying framework when building a new version
Fixes an issue where copying the generated framework after a build would fail if the framework already exists in the GeneratedFrameworks folder, even if that existing framework is out-of-date.
1 parent 94a3e3c commit ae24842

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/cocoapods-binary/rome/build_framework.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def build_for_iosish_platform(sandbox,
4242
module_name = target.product_module_name
4343
device_framework_path = "#{build_dir}/#{CONFIGURATION}-#{device}/#{target_name}/#{module_name}.framework"
4444
simulator_framework_path = "#{build_dir}/#{CONFIGURATION}-#{simulator}/#{target_name}/#{module_name}.framework"
45+
output_framework_path = "#{output_path}/#{module_name}.framework"
4546

4647
device_binary = device_framework_path + "/#{module_name}"
4748
simulator_binary = simulator_framework_path + "/#{module_name}"
@@ -86,6 +87,7 @@ def build_for_iosish_platform(sandbox,
8687

8788
# handle the dSYM files
8889
device_dsym = "#{device_framework_path}.dSYM"
90+
device_dsym_output_path = "#{output_framework_path}.dSYM"
8991
if File.exist? device_dsym
9092
# lipo the simulator dsym
9193
simulator_dsym = "#{simulator_framework_path}.dSYM"
@@ -96,12 +98,14 @@ def build_for_iosish_platform(sandbox,
9698
FileUtils.mv tmp_lipoed_binary_path, "#{device_framework_path}.dSYM/Contents/Resources/DWARF/#{module_name}", :force => true
9799
end
98100
# move
99-
FileUtils.mv device_dsym, output_path, :force => true
101+
FileUtils.rm_r device_dsym_output_path if Dir.exist? device_dsym_output_path
102+
File.rename device_dsym, device_dsym_output_path
100103
end
101104

102105
# output
103106
output_path.mkpath unless output_path.exist?
104-
FileUtils.mv device_framework_path, output_path, :force => true
107+
FileUtils.rm_r output_framework_path if Dir.exist? output_framework_path
108+
File.rename device_framework_path, output_framework_path
105109

106110
end
107111

0 commit comments

Comments
 (0)