Skip to content

Commit 5470ecb

Browse files
committed
Merge pull request leavez#48 from leavez/dsym
fix missing of dSYM for dynamic framework
1 parent b4d1492 commit 5470ecb

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

lib/cocoapods-binary/Integration.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def mirror_with_symlink(source, basefolder, target_folder)
6969
walk(real_file_folder) do |child|
7070
source = child
7171
# only make symlink to file and `.framework` folder
72-
if child.directory? and child.extname == ".framework"
72+
if child.directory? and [".framework", ".dSYM"].include? child.extname
7373
mirror_with_symlink(source, real_file_folder, target_folder)
7474
next false # return false means don't go deeper
7575
elsif child.file?
@@ -262,8 +262,9 @@ class EmbedFrameworksScript
262262
# ---- this is added by cocoapods-binary ---
263263
# Readlink cannot handle relative symlink well, so we override it to a new one
264264
# If the path isn't an absolute path, we add a realtive prefix.
265+
old_read_link=`which readlink`
265266
readlink () {
266-
path=`/usr/bin/readlink $1`;
267+
path=`$old_read_link $1`;
267268
if [ $(echo "$path" | cut -c 1-1) = '/' ]; then
268269
echo $path;
269270
else
@@ -272,6 +273,10 @@ class EmbedFrameworksScript
272273
}
273274
# ---
274275
SH
276+
277+
# patch the rsync for copy dSYM symlink
278+
script = script.gsub "rsync --delete", "rsync --copy-links --delete"
279+
275280
patch + script
276281
end
277282
end

lib/cocoapods-binary/rome/build_framework.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def build_for_iosish_platform(sandbox,
2929
other_options += ['BITCODE_GENERATION_MODE=bitcode']
3030
end
3131
xcodebuild(sandbox, target_label, device, deployment_target, other_options)
32-
xcodebuild(sandbox, target_label, simulator, deployment_target, other_options + ["ARCHS=#{simulator_default_arch}",'ONLY_ACTIVE_ARCH=NO'])
32+
xcodebuild(sandbox, target_label, simulator, deployment_target, other_options + ["ARCHS=#{simulator_default_arch}",'ONLY_ACTIVE_ARCH=NO', 'DEBUG_INFORMATION_FORMAT=dwarf'])
3333

3434
# paths
3535
target_name = target.name # equals target.label, like "AFNeworking-iOS" when AFNetworking is used in multiple platforms.
@@ -55,6 +55,17 @@ def build_for_iosish_platform(sandbox,
5555
FileUtils.cp_r simulator_swiftmodule_path + "/.", device_swiftmodule_path
5656
end
5757

58+
# handle the dSYM files
59+
device_dsym = "#{device_framwork_path}.dSYM"
60+
if File.exist? device_dsym
61+
## lipo the simulator dsym
62+
# tmp_lipoed_binary_path = "#{output_path}/#{module_name}.draft"
63+
# lipo_log = `lipo -create -output #{tmp_lipoed_binary_path} #{device_framwork_path}.dSYM/Contents/Resources/DWARF/#{module_name} #{simulator_framwork_path}.dSYM/Contents/Resources/DWARF/#{module_name}`
64+
# puts lipo_log unless File.exist?(tmp_lipoed_binary_path)
65+
# FileUtils.mv tmp_lipoed_binary_path, "#{device_framwork_path}.dSYM/Contents/Resources/DWARF/#{module_name}", :force => true
66+
FileUtils.mv device_dsym, output_path, :force => true
67+
end
68+
5869
# output
5970
output_path.mkpath unless output_path.exist?
6071
FileUtils.mv device_framwork_path, output_path, :force => true

0 commit comments

Comments
 (0)