Skip to content

Commit

Permalink
Swift Concurrency Availability to macOS 10.15, iOS 13, tvOS 13, and w…
Browse files Browse the repository at this point in the history
…atchOS 6 (#488)
  • Loading branch information
adam-fowler authored Jan 4, 2022
1 parent a26b4bd commit 0d3c9dc
Show file tree
Hide file tree
Showing 16 changed files with 18 additions and 17 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.DS_Store
.build
.swiftpm
.vscode
/Packages
/*.xcodeproj
Package.resolved
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ let package = Package(
dependencies: [
.package(url: "https://github.com/apple/swift-log.git", from: "1.4.0"),
.package(url: "https://github.com/apple/swift-metrics.git", "1.0.0"..<"3.0.0"),
.package(url: "https://github.com/apple/swift-nio.git", from: "2.34.0"),
.package(url: "https://github.com/apple/swift-nio.git", from: "2.36.0"),
.package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.7.2"),
.package(url: "https://github.com/apple/swift-nio-transport-services.git", from: "1.0.0"),
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.6.4"),
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.8.1"),
.package(url: "https://github.com/adam-fowler/jmespath.swift.git", from: "1.0.0"),
],
targets: [
Expand Down
2 changes: 1 addition & 1 deletion Sources/SotoCore/AWSShapes/Payload+async.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import NIOCore

@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension AWSPayload {
/// Construct a stream payload from an `AsynSequence` of `ByteBuffers`
/// - Parameters:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import Logging
import NIOCore

@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension AWSClient {
/// Execute an empty request and return a future with the output object generated from the response
/// - parameters:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import Logging
import NIOCore

@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension AWSClient {
/// Used to access paginated results.
public struct PaginatorSequence<Input: AWSPaginateToken, Output: AWSShape>: AsyncSequence where Input.Token: Equatable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import Logging
import NIOCore

@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension AWSClient {
/// Returns when waiter polling returns a success state
/// or returns an error if the polling returns an error or timesout
Expand Down
2 changes: 1 addition & 1 deletion Sources/SotoCore/AsyncAwaitSupport/AWSClient+async.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import Metrics
import NIOCore
import SotoSignerV4

@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension AWSClient {
/// execute a request with an input object and return a future with an empty response
/// - parameters:
Expand Down
2 changes: 1 addition & 1 deletion Sources/SotoCore/AsyncAwaitSupport/AWSService+async.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import struct Foundation.URL
import NIOCore

/// Protocol for services objects. Contains a client to communicate with AWS and config for defining how to communicate
@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension AWSService {
/// Generate a signed URL
/// - parameters:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import NIOCore
import SotoSignerV4

/// Async Protocol for providing credentials
@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
public protocol AsyncCredentialProvider: CredentialProvider {
/// Return credential
/// - Parameters:
Expand All @@ -28,7 +28,7 @@ public protocol AsyncCredentialProvider: CredentialProvider {
func getCredential(on eventLoop: EventLoop, logger: Logger) async throws -> Credential
}

@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension AsyncCredentialProvider {
public func getCredential(on eventLoop: EventLoop, logger: Logger) -> EventLoopFuture<Credential> {
let promise = eventLoop.makePromise(of: Credential.self)
Expand Down
2 changes: 1 addition & 1 deletion Sources/SotoTestUtils/TestUtils+async.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import Logging
import SotoCore
import XCTest

@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
public func XCTRunAsyncAndBlock(_ closure: @escaping () async throws -> Void) {
let dg = DispatchGroup()
dg.enter()
Expand Down
2 changes: 1 addition & 1 deletion Tests/SotoCoreTests/AWSClientTests+async.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import SotoTestUtils
import SotoXML
import XCTest

@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
class AWSClientAsyncTests: XCTestCase {
func testGetCredential() {
struct MyCredentialProvider: AsyncCredentialProvider {
Expand Down
2 changes: 1 addition & 1 deletion Tests/SotoCoreTests/AWSServiceTests+async.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import SotoTestUtils
import XCTest

@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
final class AWSServiceAsyncTests: XCTestCase {
struct TestService: AWSService {
var client: AWSClient
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import SotoCore
import SotoTestUtils
import XCTest

@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
class AsyncCredentialProviderTests: XCTestCase {
func testAsyncCredentialProvider() {
struct TestAsyncProvider: AsyncCredentialProvider {
Expand Down
2 changes: 1 addition & 1 deletion Tests/SotoCoreTests/EndpointDiscoveryTests+async.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import SotoCore
import SotoTestUtils
import XCTest

@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
class EndpointDiscoveryAsyncTests: XCTestCase {
class Service: AWSService {
let client: AWSClient
Expand Down
2 changes: 1 addition & 1 deletion Tests/SotoCoreTests/PaginateTests+async.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import NIOPosix
import SotoTestUtils
import XCTest

@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
final class PaginateAsyncTests: XCTestCase {
enum Error: Swift.Error {
case didntFindToken
Expand Down
2 changes: 1 addition & 1 deletion Tests/SotoCoreTests/WaiterTests+async.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import SotoTestUtils
import XCTest

@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
final class WaiterAsyncTests: XCTestCase {
var awsServer: AWSTestServer!
var config: AWSServiceConfig!
Expand Down

0 comments on commit 0d3c9dc

Please sign in to comment.