Skip to content

Commit 1ed5722

Browse files
Remove StreamChat module's shadow at xcframeworks' swiftinterfaces (#549)
1 parent 894b244 commit 1ed5722

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

fastlane/Fastfile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ end
3131

3232
lane :build_xcframeworks do
3333
match_me
34-
output_directory = "#{Dir.pwd}/../Products"
34+
output_directory = File.absolute_path("#{Dir.pwd}/../Products")
3535
team_id = File.read('Matchfile').match(/team_id\("(.*)"\)/)[1]
3636
codesign = ["codesign --timestamp -v --sign 'Apple Distribution: Stream.io Inc (#{team_id})'"]
3737
sdk_names.each do |sdk|
@@ -47,9 +47,21 @@ lane :build_xcframeworks do
4747
sh('../Scripts/removeUnneededSymbols.sh', sdk, output_directory)
4848
codesign << lane_context[SharedValues::XCFRAMEWORK_OUTPUT_PATH]
4949
end
50+
51+
remove_stream_chat_module_shadow(output_directory: output_directory)
5052
sh(codesign.join(' ')) # We need to sign all frameworks at once
5153
end
5254

55+
# 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
56+
private_lane :remove_stream_chat_module_shadow do |options|
57+
Dir.glob("#{options[:output_directory]}/**/*.swiftinterface") do |file|
58+
if File.file?(file)
59+
UI.important("Removing the StreamChat module's shadow at: #{file}...")
60+
File.write(file, File.read(file).gsub('StreamChat.', ''))
61+
end
62+
end
63+
end
64+
5365
desc 'Release a new version'
5466
lane :release do |options|
5567
previous_version_number = last_git_tag

0 commit comments

Comments
 (0)