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

chore: Migrate to Xcode 16 - WPB-10898 #2050

Merged
merged 15 commits into from
Oct 21, 2024
Merged
44 changes: 22 additions & 22 deletions .github/workflows/_reusable_run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ jobs:
echo "Building WireFoundation..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireFoundation-Package -resultBundlePath xcodebuild-wire-foundation.xcresult -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-foundation.log | bundle exec xcpretty

- uses: kronenthaler/analyze-xcoderesults-action@0.1.9
- uses: wireapp/analyze-xcoderesults-action@v1
samwyndham marked this conversation as resolved.
Show resolved Hide resolved
if: ${{ inputs.wire-foundation || inputs.all }}
with:
results: xcodebuild-wire-foundation.xcresult
Expand All @@ -214,7 +214,7 @@ jobs:
echo "Building WireSystem Project..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireSystem -resultBundlePath xcodebuild-wire-ios-system.xcresult -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-ios-system.log | bundle exec xcpretty

- uses: kronenthaler/analyze-xcoderesults-action@0.1.9
- uses: wireapp/analyze-xcoderesults-action@v1
if: ${{ inputs.wire-ios-system || inputs.all }}
with:
results: xcodebuild-wire-ios-system.xcresult
Expand All @@ -237,7 +237,7 @@ jobs:
echo "Building WireTesting Project..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireTesting -resultBundlePath xcodebuild-wire-ios-testing.xcresult -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-ios-testing.log | bundle exec xcpretty

- uses: kronenthaler/analyze-xcoderesults-action@0.1.9
- uses: wireapp/analyze-xcoderesults-action@v1
if: ${{ inputs.wire-ios-testing || inputs.all }}
with:
results: xcodebuild-wire-ios-testing.xcresult
Expand All @@ -260,7 +260,7 @@ jobs:
echo "Building WireUtilities Project..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireUtilities -resultBundlePath xcodebuild-wire-ios-utilities.xcresult -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-ios-utilities.log | bundle exec xcpretty

- uses: kronenthaler/analyze-xcoderesults-action@0.1.9
- uses: wireapp/analyze-xcoderesults-action@v1
if: ${{ inputs.wire-ios-utilities || inputs.all }}
with:
results: xcodebuild-wire-ios-utilities.xcresult
Expand All @@ -283,7 +283,7 @@ jobs:
echo "Building WireCryptobox..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireCryptobox -resultBundlePath xcodebuild-wire-ios-cryptobox.xcresult -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-ios-cryptobox.log | bundle exec xcpretty

- uses: kronenthaler/analyze-xcoderesults-action@0.1.9
- uses: wireapp/analyze-xcoderesults-action@v1
if: ${{ inputs.wire-ios-cryptobox || inputs.all }}
with:
results: xcodebuild-wire-ios-cryptobox.xcresult
Expand All @@ -306,7 +306,7 @@ jobs:
echo "Building WireTransport..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireTransport -resultBundlePath xcodebuild-wire-ios-transport.xcresult -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-ios-transport.log | bundle exec xcpretty

- uses: kronenthaler/analyze-xcoderesults-action@0.1.9
- uses: wireapp/analyze-xcoderesults-action@v1
if: ${{ inputs.wire-ios-transport || inputs.all }}
with:
results: xcodebuild-wire-ios-transport.xcresult
Expand All @@ -329,7 +329,7 @@ jobs:
echo "Building WireLinkPreview..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireLinkPreview -resultBundlePath xcodebuild-wire-ios-link-preview.xcresult -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-ios-link-preview.log | bundle exec xcpretty

- uses: kronenthaler/analyze-xcoderesults-action@0.1.9
- uses: wireapp/analyze-xcoderesults-action@v1
if: ${{ inputs.wire-ios-link-preview || inputs.all }}
with:
results: xcodebuild-wire-ios-link-preview.xcresult
Expand All @@ -352,7 +352,7 @@ jobs:
echo "Building WireImages..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireImages -resultBundlePath xcodebuild-wire-ios-images.xcresult -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-ios-images.log | bundle exec xcpretty

- uses: kronenthaler/analyze-xcoderesults-action@0.1.9
- uses: wireapp/analyze-xcoderesults-action@v1
if: ${{ inputs.wire-ios-images || inputs.all }}
with:
results: xcodebuild-wire-ios-images.xcresult
Expand All @@ -375,7 +375,7 @@ jobs:
echo "Building WireProtos..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireProtos -resultBundlePath xcodebuild-wire-ios-protos.xcresult -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-ios-protos.log | bundle exec xcpretty

- uses: kronenthaler/analyze-xcoderesults-action@0.1.9
- uses: wireapp/analyze-xcoderesults-action@v1
if: ${{ inputs.wire-ios-protos || inputs.all }}
with:
results: xcodebuild-wire-ios-protos.xcresult
Expand All @@ -398,7 +398,7 @@ jobs:
echo "Building WireMockTransport..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireMockTransport -resultBundlePath xcodebuild-wire-ios-mocktransport.xcresult -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-ios-mocktransport.log | bundle exec xcpretty

- uses: kronenthaler/analyze-xcoderesults-action@0.1.9
- uses: wireapp/analyze-xcoderesults-action@v1
if: ${{ inputs.wire-ios-mocktransport || inputs.all }}
with:
results: xcodebuild-wire-ios-mocktransport.xcresult
Expand All @@ -421,7 +421,7 @@ jobs:
echo "Building WireDataModel..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireDataModel -resultBundlePath xcodebuild-wire-ios-data-model.xcresult -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-ios-data-model.log | bundle exec xcpretty

- uses: kronenthaler/analyze-xcoderesults-action@0.1.9
- uses: wireapp/analyze-xcoderesults-action@v1
if: ${{ inputs.wire-ios-data-model || inputs.all }}
with:
results: xcodebuild-wire-ios-data-model.xcresult
Expand All @@ -443,7 +443,7 @@ jobs:
echo "Building WireAPI..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireAPI -resultBundlePath xcodebuild-wire-api.xcresult -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-api.log | bundle exec xcpretty

- uses: kronenthaler/analyze-xcoderesults-action@0.1.9
- uses: wireapp/analyze-xcoderesults-action@v1
if: ${{ inputs.wire-api || inputs.all }}
with:
results: xcodebuild-wire-api.xcresult
Expand All @@ -466,7 +466,7 @@ jobs:
echo "Building WireDatadog..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireDatadog -resultBundlePath xcodebuild-wire-datadog.xcresult -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-datadog.log | bundle exec xcpretty

- uses: kronenthaler/analyze-xcoderesults-action@0.1.9
- uses: wireapp/analyze-xcoderesults-action@v1
if: ${{ inputs.wire-datadog || inputs.all }}
with:
results: xcodebuild-wire-datadog.xcresult
Expand All @@ -484,7 +484,7 @@ jobs:
echo "Building WireAnalytics..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireAnalytics -resultBundlePath xcodebuild-wire-analytics.xcresult -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-analytics.log | bundle exec xcpretty

- uses: kronenthaler/analyze-xcoderesults-action@0.1.9
- uses: wireapp/analyze-xcoderesults-action@v1
if: ${{ inputs.wire-analytics || inputs.all }}
with:
results: xcodebuild-wire-analytics.xcresult
Expand All @@ -502,7 +502,7 @@ jobs:
echo "Building WireDomain..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireDomainPackage -resultBundlePath xcodebuild-wire-domain.xcresult -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-domain.log | bundle exec xcpretty

- uses: kronenthaler/analyze-xcoderesults-action@0.1.9
- uses: wireapp/analyze-xcoderesults-action@v1
if: ${{ inputs.wire-domain || inputs.all }}
with:
results: xcodebuild-wire-domain.xcresult
Expand All @@ -525,7 +525,7 @@ jobs:
echo "Building WireDomain Project..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireDomain -resultBundlePath xcodebuild-wire-domain-project.xcresult -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-domain-project.log | bundle exec xcpretty

- uses: kronenthaler/analyze-xcoderesults-action@0.1.9
- uses: wireapp/analyze-xcoderesults-action@v1
if: ${{ inputs.wire-domain-project || inputs.all }}
with:
results: xcodebuild-wire-domain-project.xcresult
Expand All @@ -548,7 +548,7 @@ jobs:
echo "Building WireRequestStrategy..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireRequestStrategy -resultBundlePath xcodebuild-wire-ios-request-strategy.xcresult -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-ios-request-strategy.log | bundle exec xcpretty

- uses: kronenthaler/analyze-xcoderesults-action@0.1.9
- uses: wireapp/analyze-xcoderesults-action@v1
if: ${{ inputs.wire-ios-request-strategy || inputs.all }}
with:
results: xcodebuild-wire-ios-request-strategy.xcresult
Expand All @@ -571,7 +571,7 @@ jobs:
echo "Building WireShareEngine..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireShareEngine -resultBundlePath xcodebuild-wire-ios-share-engine.xcresult -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-ios-share-engine.log | bundle exec xcpretty

- uses: kronenthaler/analyze-xcoderesults-action@0.1.9
- uses: wireapp/analyze-xcoderesults-action@v1
if: ${{ inputs.wire-ios-share-engine || inputs.all }}
with:
results: xcodebuild-wire-ios-share-engine.xcresult
Expand All @@ -594,7 +594,7 @@ jobs:
echo "Building WireSyncEngine..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireSyncEngine -resultBundlePath xcodebuild-wire-ios-sync-engine.xcresult -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-ios-sync-engine.log | bundle exec xcpretty

- uses: kronenthaler/analyze-xcoderesults-action@0.1.9
- uses: wireapp/analyze-xcoderesults-action@v1
if: ${{ inputs.wire-ios-sync-engine || inputs.all }}
with:
results: xcodebuild-wire-ios-sync-engine.xcresult
Expand All @@ -617,7 +617,7 @@ jobs:
echo "Building WireUI..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireUI-Package -resultBundlePath xcodebuild-wire-ui.xcresult -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-ui.log | bundle exec xcpretty

- uses: kronenthaler/analyze-xcoderesults-action@0.1.9
- uses: wireapp/analyze-xcoderesults-action@v1
if: ${{ inputs.wire-ui || inputs.all }}
with:
results: xcodebuild-wire-ui.xcresult
Expand All @@ -640,7 +640,7 @@ jobs:
echo "Building Wire-iOS..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme Wire-iOS -resultBundlePath xcodebuild-wire-ios.xcresult -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-ios.log | bundle exec xcpretty

- uses: kronenthaler/analyze-xcoderesults-action@0.1.9
- uses: wireapp/analyze-xcoderesults-action@v1
if: ${{ inputs.wire-ios || inputs.all }}
with:
results: xcodebuild-wire-ios.xcresult
Expand Down Expand Up @@ -680,7 +680,7 @@ jobs:
echo "Building WireNotificationEngine..."
xcodebuild build-for-testing -workspace wire-ios-mono.xcworkspace -scheme WireNotificationEngine -resultBundlePath xcodebuild-wire-ios-notification-engine.xcresult -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee xcodebuild-wire-ios-notification-engine.log | bundle exec xcpretty

- uses: kronenthaler/analyze-xcoderesults-action@0.1.9
- uses: wireapp/analyze-xcoderesults-action@v1
if: ${{ inputs.wire-ios-notification-engine || inputs.all }}
with:
results: xcodebuild-wire-ios-notification-engine.xcresult
Expand Down
3 changes: 1 addition & 2 deletions .swift-version
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
5.10

6
2 changes: 1 addition & 1 deletion .xcode-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
15.4
16.0
2 changes: 1 addition & 1 deletion WireUI/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ let package = Package(
.testTarget(name: "WireAccountImageUITests", dependencies: ["WireAccountImageUI", "WireFoundation"]),

.target(name: "WireConversationListUI"),
.testTarget(name: "WireConversationListUITests", dependencies: ["WireConversationListUI"]),
.testTarget(name: "WireConversationListUITests", dependencies: ["WireConversationListUI", "WireSettingsUI"]),

.target(name: "WireDesign", dependencies: ["WireFoundation"]),
.testTarget(name: "WireDesignTests", dependencies: ["WireDesign"]),
Expand Down
2 changes: 2 additions & 0 deletions wire-ios-protos/WireProtos.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@
buildSettings = {
CLANG_ENABLE_MODULES = YES;
INFOPLIST_FILE = ProtosTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
samwyndham marked this conversation as resolved.
Show resolved Hide resolved
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -412,6 +413,7 @@
buildSettings = {
CLANG_ENABLE_MODULES = YES;
INFOPLIST_FILE = ProtosTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ struct ProteusMessagePayloadBuilder {
// 2) Wrap the encryptedData in protobuf object that will be serialized
var messageData: Data
if useQualifiedIds {
messageData = try await qualifiedData(messageInfo: messageInfo, encryptedDatas: encryptedDatas, externalData: externalData)
messageData = try qualifiedData(messageInfo: messageInfo, encryptedDatas: encryptedDatas, externalData: externalData)
} else {
messageData = try await unQualifiedData(messageInfo: messageInfo, encryptedDatas: encryptedDatas, externalData: externalData)
messageData = try unQualifiedData(messageInfo: messageInfo, encryptedDatas: encryptedDatas, externalData: externalData)
}

// Message too big?
Expand Down Expand Up @@ -71,13 +71,13 @@ struct ProteusMessagePayloadBuilder {
let encryptedDatas = try await proteusService.encryptBatched(data: plainText, forSessions: allSessionIds)

if useQualifiedIds {
return try await qualifiedData(messageInfo: messageInfo, encryptedDatas: encryptedDatas, externalData: data)
return try qualifiedData(messageInfo: messageInfo, encryptedDatas: encryptedDatas, externalData: data)
} else {
return try await unQualifiedData(messageInfo: messageInfo, encryptedDatas: encryptedDatas, externalData: data)
return try unQualifiedData(messageInfo: messageInfo, encryptedDatas: encryptedDatas, externalData: data)
}
}

private func unQualifiedData(messageInfo: MessageInfo, encryptedDatas: [String: Data], externalData: Data? = nil) async throws -> Data {
samwyndham marked this conversation as resolved.
Show resolved Hide resolved
private func unQualifiedData(messageInfo: MessageInfo, encryptedDatas: [String: Data], externalData: Data? = nil) throws -> Data {
var userEntries = [Proteus_UserEntry]()
for (_, entries) in messageInfo.listClients {

Expand All @@ -96,10 +96,11 @@ struct ProteusMessagePayloadBuilder {
blob: externalData
)

return try message.serializedData()
let result = try message.serializedData()
return result
}

private func qualifiedData(messageInfo: MessageInfo, encryptedDatas: [String: Data], externalData: Data? = nil) async throws -> Data {
private func qualifiedData(messageInfo: MessageInfo, encryptedDatas: [String: Data], externalData: Data? = nil) throws -> Data {

var finalRecipients = [Proteus_QualifiedUserEntry]()
for (domain, entries) in messageInfo.listClients {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,11 @@ final class ProteusMessagePayloadBuilderTests: XCTestCase {
}
XCTAssertEqual(createdMessage.hasBlob, true)

guard let userEntry = createdMessage.recipients.first else {
return XCTFail()
}
let userEntry = try XCTUnwrap(createdMessage.recipients.first { $0.user.uuid == userBID.uuid.uuidData })

XCTAssertEqual(userEntry.clients.count, 1)
XCTAssertEqual(userEntry.clients.first?.text, ZMFailedToCreateEncryptedMessagePayloadString.data(using: .utf8))
let client = try XCTUnwrap(userEntry.clients.first)
XCTAssertEqual(String(data: client.text, encoding: .utf8), ZMFailedToCreateEncryptedMessagePayloadString)
}

// MARK: - Helpers
Expand Down
Loading