Skip to content

Commit 5dc20e3

Browse files
authored
Merge pull request #48 from leavez/dsym
fix missing of dSYM for dynamic framework
2 parents 30cbf7f + a60a69d commit 5dc20e3

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
@@ -55,7 +55,7 @@ def mirror_with_symlink(source, basefolder, target_folder)
5555
walk(real_file_folder) do |child|
5656
source = child
5757
# only make symlink to file and `.framework` folder
58-
if child.directory? and child.extname == ".framework"
58+
if child.directory? and [".framework", ".dSYM"].include? child.extname
5959
mirror_with_symlink(source, real_file_folder, target_folder)
6060
next false # return false means don't go deeper
6161
elsif child.file?
@@ -243,8 +243,9 @@ class EmbedFrameworksScript
243243
# ---- this is added by cocoapods-binary ---
244244
# Readlink cannot handle relative symlink well, so we override it to a new one
245245
# If the path isn't an absolute path, we add a realtive prefix.
246+
old_read_link=`which readlink`
246247
readlink () {
247-
path=`/usr/bin/readlink $1`;
248+
path=`$old_read_link $1`;
248249
if [ $(echo "$path" | cut -c 1-1) = '/' ]; then
249250
echo $path;
250251
else
@@ -253,6 +254,10 @@ class EmbedFrameworksScript
253254
}
254255
# ---
255256
SH
257+
258+
# patch the rsync for copy dSYM symlink
259+
script = script.gsub "rsync --delete", "rsync --copy-links --delete"
260+
256261
patch + script
257262
end
258263
end

lib/cocoapods-binary/rome/build_framework.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def build_for_iosish_platform(sandbox,
2727
other_options += ['BITCODE_GENERATION_MODE=bitcode']
2828
end
2929
xcodebuild(sandbox, target_label, device, deployment_target, other_options)
30-
xcodebuild(sandbox, target_label, simulator, deployment_target, other_options + ['ARCHS=x86_64', 'ONLY_ACTIVE_ARCH=NO'])
30+
xcodebuild(sandbox, target_label, simulator, deployment_target, other_options + ['ARCHS=x86_64', 'ONLY_ACTIVE_ARCH=NO', 'DEBUG_INFORMATION_FORMAT=dwarf'])
3131

3232
# paths
3333
root_name = target.pod_name
@@ -53,6 +53,17 @@ def build_for_iosish_platform(sandbox,
5353
FileUtils.cp_r simulator_swiftmodule_path + "/.", device_swiftmodule_path
5454
end
5555

56+
# handle the dSYM files
57+
device_dsym = "#{device_framwork_path}.dSYM"
58+
if File.exist? device_dsym
59+
## lipo the simulator dsym
60+
# tmp_lipoed_binary_path = "#{output_path}/#{module_name}.draft"
61+
# 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}`
62+
# puts lipo_log unless File.exist?(tmp_lipoed_binary_path)
63+
# FileUtils.mv tmp_lipoed_binary_path, "#{device_framwork_path}.dSYM/Contents/Resources/DWARF/#{module_name}", :force => true
64+
FileUtils.mv device_dsym, output_path, :force => true
65+
end
66+
5667
# output
5768
output_path.mkpath unless output_path.exist?
5869
FileUtils.mv device_framwork_path, output_path, :force => true

0 commit comments

Comments
 (0)