Skip to content

fix: broken builds from Swift 5.5.0 < Swift 5.5.2 #320

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

Merged
merged 11 commits into from
Jan 17, 2022
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2021 Parse Community. All rights reserved.
//

#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.2) && canImport(_Concurrency)
import Foundation

public extension ParseApple {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2021 Parse Community. All rights reserved.
//

#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.2) && canImport(_Concurrency)
import Foundation

public extension ParseFacebook {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2022 Parse Community. All rights reserved.
//

#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.2) && canImport(_Concurrency)
import Foundation

public extension ParseGitHub {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2022 Parse Community. All rights reserved.
//

#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.2) && canImport(_Concurrency)
import Foundation

public extension ParseGoogle {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2021 Parse Community. All rights reserved.
//

#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.2) && canImport(_Concurrency)
import Foundation

public extension ParseLDAP {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2022 Parse Community. All rights reserved.
//

#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.2) && canImport(_Concurrency)
import Foundation

public extension ParseLinkedIn {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2021 Parse Community. All rights reserved.
//

#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.2) && canImport(_Concurrency)
import Foundation

public extension ParseTwitter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2021 Parse Community. All rights reserved.
//

#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.2) && canImport(_Concurrency)
import Foundation

public extension ParseAnonymous {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2021 Parse Community. All rights reserved.
//

#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.2) && canImport(_Concurrency)
import Foundation

public extension ParseAuthentication {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public protocol ParseAuthentication: Codable {
func unlinkPublisher(options: API.Options) -> Future<AuthenticatedUser, ParseError>
#endif

#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.2) && canImport(_Concurrency)
// MARK: Async/Await

/**
Expand Down
2 changes: 1 addition & 1 deletion Sources/ParseSwift/LiveQuery/ParseLiveQuery+async.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2021 Parse Community. All rights reserved.
//

#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) && !os(Windows)
#if compiler(>=5.5.2) && canImport(_Concurrency) && !os(Linux) && !os(Android) && !os(Windows)
import Foundation

extension ParseLiveQuery {
Expand Down
2 changes: 1 addition & 1 deletion Sources/ParseSwift/Objects/ParseInstallation+async.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2021 Parse Community. All rights reserved.
//

#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.2) && canImport(_Concurrency)
import Foundation

public extension ParseInstallation {
Expand Down
2 changes: 1 addition & 1 deletion Sources/ParseSwift/Objects/ParseObject+async.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2021 Parse Community. All rights reserved.
//

#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.2) && canImport(_Concurrency)
import Foundation

public extension ParseObject {
Expand Down
2 changes: 1 addition & 1 deletion Sources/ParseSwift/Objects/ParseUser+async.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2021 Parse Community. All rights reserved.
//

#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.2) && canImport(_Concurrency)
import Foundation

public extension ParseUser {
Expand Down
2 changes: 1 addition & 1 deletion Sources/ParseSwift/Types/ParseAnalytics+async.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2021 Parse Community. All rights reserved.
//

#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.2) && canImport(_Concurrency)
import Foundation

#if os(iOS)
Expand Down
2 changes: 1 addition & 1 deletion Sources/ParseSwift/Types/ParseCloud+async.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2021 Parse Community. All rights reserved.
//

#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.2) && canImport(_Concurrency)
import Foundation

public extension ParseCloud {
Expand Down
2 changes: 1 addition & 1 deletion Sources/ParseSwift/Types/ParseConfig+async.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2021 Parse Community. All rights reserved.
//

#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.2) && canImport(_Concurrency)
import Foundation

public extension ParseConfig {
Expand Down
2 changes: 1 addition & 1 deletion Sources/ParseSwift/Types/ParseFile+async.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2021 Parse Community. All rights reserved.
//

#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.2) && canImport(_Concurrency)
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
Expand Down
2 changes: 1 addition & 1 deletion Sources/ParseSwift/Types/ParseHealth+async.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2021 Parse Community. All rights reserved.
//

#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.2) && canImport(_Concurrency)
import Foundation

public extension ParseHealth {
Expand Down
2 changes: 1 addition & 1 deletion Sources/ParseSwift/Types/ParseOperation+async.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2021 Parse Community. All rights reserved.
//

#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.2) && canImport(_Concurrency)
import Foundation

public extension ParseOperation {
Expand Down
2 changes: 1 addition & 1 deletion Sources/ParseSwift/Types/Pointer+async.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2021 Parse Community. All rights reserved.
//

#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.2) && canImport(_Concurrency)
import Foundation

// MARK: Async/Await
Expand Down
2 changes: 1 addition & 1 deletion Sources/ParseSwift/Types/Query+async.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2021 Parse Community. All rights reserved.
//

#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.2) && canImport(_Concurrency)
import Foundation

public extension Query {
Expand Down
5 changes: 4 additions & 1 deletion Tests/ParseSwiftTests/ParseAnanlyticsAsyncTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
// Copyright © 2021 Parse Community. All rights reserved.
//

#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) && !os(Windows)
#if compiler(>=5.5.2) && canImport(_Concurrency)
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
import XCTest
@testable import ParseSwift

Expand Down
5 changes: 4 additions & 1 deletion Tests/ParseSwiftTests/ParseAnonymousAsyncTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
// Copyright © 2021 Parse Community. All rights reserved.
//

#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) && !os(Windows)
#if compiler(>=5.5.2) && canImport(_Concurrency)
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
import XCTest
@testable import ParseSwift

Expand Down
5 changes: 4 additions & 1 deletion Tests/ParseSwiftTests/ParseAppleAsyncTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
// Copyright © 2021 Parse Community. All rights reserved.
//

#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) && !os(Windows)
#if compiler(>=5.5.2) && canImport(_Concurrency)
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
import XCTest
@testable import ParseSwift

Expand Down
11 changes: 9 additions & 2 deletions Tests/ParseSwiftTests/ParseAuthenticationAsyncTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@
// Copyright © 2021 Parse Community. All rights reserved.
//

#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) && !os(Windows)
#if compiler(>=5.5.2) && canImport(_Concurrency)
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
import XCTest
@testable import ParseSwift
#if canImport(Combine)
import Combine
#endif

class ParseAuthenticationAsyncTests: XCTestCase { // swiftlint:disable:this type_body_length
struct User: ParseUser {
Expand Down Expand Up @@ -82,6 +87,7 @@ class ParseAuthenticationAsyncTests: XCTestCase { // swiftlint:disable:this type
completion(.failure(error))
}

#if canImport(Combine)
func loginPublisher(authData: [String: String],
options: API.Options) -> Future<AuthenticatedUser, ParseError> {
let error = ParseError(code: .unknownError, message: "Not implemented")
Expand All @@ -97,8 +103,9 @@ class ParseAuthenticationAsyncTests: XCTestCase { // swiftlint:disable:this type
promise(.failure(error))
}
}
#endif

#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.2) && canImport(_Concurrency)
func login(authData: [String: String],
options: API.Options) async throws -> AuthenticatedUser {
throw ParseError(code: .unknownError, message: "Not implemented")
Expand Down
5 changes: 4 additions & 1 deletion Tests/ParseSwiftTests/ParseAuthenticationCombineTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
#if canImport(Combine)

import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
import XCTest
import Combine
@testable import ParseSwift
Expand Down Expand Up @@ -102,7 +105,7 @@ class ParseAuthenticationCombineTests: XCTestCase {
}
#endif

#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.2) && canImport(_Concurrency)
func login(authData: [String: String],
options: API.Options) async throws -> AuthenticatedUser {
throw ParseError(code: .unknownError, message: "Not implemented")
Expand Down
5 changes: 4 additions & 1 deletion Tests/ParseSwiftTests/ParseAuthenticationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
//

import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
import XCTest
@testable import ParseSwift
#if canImport(Combine)
Expand Down Expand Up @@ -102,7 +105,7 @@ class ParseAuthenticationTests: XCTestCase {
}
#endif

#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.2) && canImport(_Concurrency)
func login(authData: [String: String],
options: API.Options) async throws -> AuthenticatedUser {
throw ParseError(code: .unknownError, message: "Not implemented")
Expand Down
5 changes: 4 additions & 1 deletion Tests/ParseSwiftTests/ParseCloudAsyncTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
// Copyright © 2021 Parse Community. All rights reserved.
//

#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) && !os(Windows)
#if compiler(>=5.5.2) && canImport(_Concurrency)
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
import XCTest
@testable import ParseSwift

Expand Down
5 changes: 4 additions & 1 deletion Tests/ParseSwiftTests/ParseConfigAsyncTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
// Copyright © 2021 Parse Community. All rights reserved.
//

#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) && !os(Windows)
#if compiler(>=5.5.2) && canImport(_Concurrency)
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
import XCTest
@testable import ParseSwift

Expand Down
5 changes: 4 additions & 1 deletion Tests/ParseSwiftTests/ParseFacebookAsyncTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
// Copyright © 2021 Parse Community. All rights reserved.
//

#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) && !os(Windows)
#if compiler(>=5.5.2) && canImport(_Concurrency)
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
import XCTest
@testable import ParseSwift

Expand Down
8 changes: 7 additions & 1 deletion Tests/ParseSwiftTests/ParseFileAsyncTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
// Copyright © 2021 Parse Community. All rights reserved.
//

#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) && !os(Windows)
#if compiler(>=5.5.2) && canImport(_Concurrency)
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
import XCTest
@testable import ParseSwift

Expand Down Expand Up @@ -67,6 +70,8 @@ class ParseFileAsyncTests: XCTestCase { // swiftlint:disable:this type_body_leng
wait(for: [expectation1, expectation2], timeout: 20.0)
}

#if !os(Linux) && !os(Android) && !os(Windows)
//URL Mocker is not able to mock this in linux and tests fail, so don't run.
@MainActor
func testFetch() async throws {

Expand Down Expand Up @@ -129,6 +134,7 @@ class ParseFileAsyncTests: XCTestCase { // swiftlint:disable:this type_body_leng
XCTAssertEqual(fetched.url, response.url)
XCTAssertNotNil(fetched.localURL)
}
#endif

@MainActor
func testSave() async throws {
Expand Down
5 changes: 4 additions & 1 deletion Tests/ParseSwiftTests/ParseGitHubTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
//

import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
import XCTest
@testable import ParseSwift

Expand Down Expand Up @@ -147,7 +150,7 @@ class ParseGitHubTests: XCTestCase { // swiftlint:disable:this type_body_length
.AuthenticationKeys.id.verifyMandatoryKeys(authData: authDataWrong))
}

#if swift(>=5.5) && canImport(_Concurrency) && !os(Linux) && !os(Android) && !os(Windows)
#if compiler(>=5.5.2) && canImport(_Concurrency)
@MainActor
func testLogin() async throws {

Expand Down
Loading