Skip to content

Commit

Permalink
Remove StreamChat module's shadow at xcframeworks' swiftinterfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
testableapple committed Jul 17, 2024
1 parent 894b244 commit 18474a4
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ end

lane :build_xcframeworks do
match_me
output_directory = "#{Dir.pwd}/../Products"
output_directory = File.absolute_path("#{Dir.pwd}/../Products")
team_id = File.read('Matchfile').match(/team_id\("(.*)"\)/)[1]
codesign = ["codesign --timestamp -v --sign 'Apple Distribution: Stream.io Inc (#{team_id})'"]
sdk_names.each do |sdk|
Expand All @@ -47,9 +47,21 @@ lane :build_xcframeworks do
sh('../Scripts/removeUnneededSymbols.sh', sdk, output_directory)
codesign << lane_context[SharedValues::XCFRAMEWORK_OUTPUT_PATH]
end

remove_stream_chat_module_shadow(output_directory: output_directory)
sh(codesign.join(' ')) # We need to sign all frameworks at once
end

# Swift emits an invalid module interface when a public type has the same name as a module, see https://github.com/swiftlang/swift/issues/56573
private_lane :remove_stream_chat_module_shadow do |options|
Dir.glob("#{options[:output_directory]}/**/*.swiftinterface") do |file|
if File.file?(file)
UI.important("Removing the StreamChat module's shadow at: #{file}...")
File.write(file, File.read(file).gsub('StreamChat.', ''))
end
end
end

desc 'Release a new version'
lane :release do |options|
previous_version_number = last_git_tag
Expand Down

0 comments on commit 18474a4

Please sign in to comment.