Skip to content

Commit

Permalink
Use create_xcframework to generate dsym-contained bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
onevcat committed Oct 6, 2022
1 parent 22846ba commit 6ec046c
Showing 1 changed file with 8 additions and 18 deletions.
26 changes: 8 additions & 18 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ platform :ios do
xcversion(version: "~> 14.0")
FileUtils.rm_rf '../build'

frameworks = []
frameworks = {}

["macosx",
"iphoneos",
Expand All @@ -117,26 +117,16 @@ platform :ios do
"SKIP_INSTALL" => "NO"
}
)
frameworks.push("#{archive_path}/Products/Library/Frameworks/Kingfisher.framework")

dSYM_path = "../#{archive_path}/dSYMs/Kingfisher.framework.dSYM"
FileUtils.mkdir_p("#{supporting_root}/#{sdk}/dSYMs/")
FileUtils.cp_r(dSYM_path, "#{supporting_root}/#{sdk}/dSYMs/Kingfisher.framework.dSYM")

bitcode_symbol_map_path = "../#{archive_path}/BCSymbolMaps/"
if Dir.exist?(bitcode_symbol_map_path)
FileUtils.mkdir_p("#{supporting_root}/#{sdk}/BCSymbolMaps/")
FileUtils.cp_r(bitcode_symbol_map_path, "#{supporting_root}/#{sdk}")
end
end
# `xcodebuild` action in fastlane does not support `-create-xcframework` arg yet.
# Change it back to use fastlane action later when it is prepared.
framework_args = frameworks.map { |framework_path| "-framework '#{framework_path}'"}
args = "-create-xcframework #{framework_args.join(" ")} -output 'build/#{target_version}/Kingfisher.xcframework'"
Dir.chdir("..") do
Action.sh "xcodebuild #{args}"
dSYM_path = "#{Dir.pwd}/../#{archive_path}/dSYMs/Kingfisher.framework.dSYM"
frameworks["#{archive_path}/Products/Library/Frameworks/Kingfisher.framework"] = { dsyms: dSYM_path }
end

create_xcframework(
frameworks_with_dsyms: frameworks,
output: "build/#{target_version}/Kingfisher.xcframework"
)

zip(
path: "build/#{target_version}",
output_path: "build/#{target_version}.zip"
Expand Down

0 comments on commit 6ec046c

Please sign in to comment.