Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove StreamChat module's shadow at xcframeworks' swiftinterfaces #549

Merged
merged 1 commit into from
Jul 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading