Skip to content

Commit 62eaa14

Browse files
atultwkmahar
andauthored
SWIFT-1438 Change concurrency minimum macOS version from 12 to 10.15.0 (#721)
Co-authored-by: Kaitlin Mahar <kaitlinmahar@gmail.com>
1 parent 260f02a commit 62eaa14

18 files changed

+50
-40
lines changed

Package.swift

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
// swift-tools-version:5.1
2+
3+
/// To avoid breaking Swift 5.1 compatibility, only require newer NIO versions when we need NIO's concurrency APIs.
4+
func getMinNIOVersion() -> PackageDescription.Package.Dependency.Requirement {
5+
#if compiler(>=5.5.2) && canImport(_Concurrency)
6+
return .upToNextMajor(from: "2.36.0")
7+
#else
8+
return .upToNextMajor(from: "2.15.0")
9+
#endif
10+
}
11+
212
import PackageDescription
313
let package = Package(
414
name: "mongo-swift-driver",
@@ -11,7 +21,7 @@ let package = Package(
1121
],
1222
dependencies: [
1323
.package(url: "https://github.com/Quick/Nimble.git", .upToNextMajor(from: "8.0.0")),
14-
.package(url: "https://github.com/apple/swift-nio", .upToNextMajor(from: "2.15.0")),
24+
.package(url: "https://github.com/apple/swift-nio", getMinNIOVersion()),
1525
.package(url: "https://github.com/mongodb/swift-bson", .upToNextMajor(from: "3.0.0"))
1626
],
1727
targets: [

Sources/MongoSwift/AsyncAwait/ChangeStream+AsyncSequence.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#if compiler(>=5.5) && canImport(_Concurrency)
1+
#if compiler(>=5.5.2) && canImport(_Concurrency)
22
/// Extension to `ChangeStream` to support async/await APIs.
3-
@available(macOS 12, *)
3+
@available(macOS 10.15.0, *)
44
extension ChangeStream: AsyncSequence, AsyncIteratorProtocol {
55
public typealias AsyncIterator = ChangeStream
66

Sources/MongoSwift/AsyncAwait/ClientSession+AsyncAwait.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#if compiler(>=5.5) && canImport(_Concurrency)
1+
#if compiler(>=5.5.2) && canImport(_Concurrency)
22
/// Extension to `ClientSession` to support async/await APIs.
3-
@available(macOS 12, *)
3+
@available(macOS 10.15.0, *)
44
extension ClientSession {
55
/**
66
* Starts a multi-document transaction for all subsequent operations in this session.

Sources/MongoSwift/AsyncAwait/MongoClient+AsyncAwait.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#if compiler(>=5.5) && canImport(_Concurrency)
1+
#if compiler(>=5.5.2) && canImport(_Concurrency)
22
/// Extension to `MongoClient` to support async/await APIs.
3-
@available(macOS 12, *)
3+
@available(macOS 10.15.0, *)
44
extension MongoClient {
55
/**
66
* Closes this `MongoClient`, closing all connections to the server and cleaning up internal state.

Sources/MongoSwift/AsyncAwait/MongoCollection+AsyncAwait.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#if compiler(>=5.5) && canImport(_Concurrency)
1+
#if compiler(>=5.5.2) && canImport(_Concurrency)
22
/// Extension to `MongoCollection` to support async/await APIs.
3-
@available(macOS 12, *)
3+
@available(macOS 10.15.0, *)
44
extension MongoCollection {
55
/**
66
* Drops this collection from its parent database.

Sources/MongoSwift/AsyncAwait/MongoCollection+ChangeStreams+AsyncAwait.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#if compiler(>=5.5) && canImport(_Concurrency)
1+
#if compiler(>=5.5.2) && canImport(_Concurrency)
22
/// Extension to `MongoCollection` to support async/await change stream APIs.
3-
@available(macOS 12, *)
3+
@available(macOS 10.15.0, *)
44
extension MongoCollection {
55
/**
66
* Starts a `ChangeStream` on a collection. The `CollectionType` will be associated with the `fullDocument`

Sources/MongoSwift/AsyncAwait/MongoCollection+FindAndModify+AsyncAwait.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#if compiler(>=5.5) && canImport(_Concurrency)
1+
#if compiler(>=5.5.2) && canImport(_Concurrency)
22
/// Extension to `MongoCollection` to support async/await find and modify APIs.
3-
@available(macOS 12, *)
3+
@available(macOS 10.15.0, *)
44
extension MongoCollection {
55
/**
66
* Finds a single document and deletes it, returning the original.

Sources/MongoSwift/AsyncAwait/MongoCollection+Indexes+AsyncAwait.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#if compiler(>=5.5) && canImport(_Concurrency)
1+
#if compiler(>=5.5.2) && canImport(_Concurrency)
22
/// Extension to `MongoCollection` to support async/await index management APIs.
3-
@available(macOS 12, *)
3+
@available(macOS 10.15.0, *)
44
extension MongoCollection {
55
/**
66
* Creates an index over the collection for the provided keys with the provided options.

Sources/MongoSwift/AsyncAwait/MongoCollection+Read+AsyncAwait.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#if compiler(>=5.5) && canImport(_Concurrency)
1+
#if compiler(>=5.5.2) && canImport(_Concurrency)
22
/// Extension to `MongoCollection` to support async/await read APIs.
3-
@available(macOS 12, *)
3+
@available(macOS 10.15.0, *)
44
extension MongoCollection {
55
/**
66
* Finds the documents in this collection which match the provided filter.

Sources/MongoSwift/AsyncAwait/MongoCollection+Write+AsyncAwait.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#if compiler(>=5.5) && canImport(_Concurrency)
1+
#if compiler(>=5.5.2) && canImport(_Concurrency)
22
/// Extension to `MongoCollection` to support async/await write APIs.
3-
@available(macOS 12, *)
3+
@available(macOS 10.15.0, *)
44
extension MongoCollection {
55
/**
66
* Encodes the provided value to BSON and inserts it. If the value is missing an identifier, one will be generated

0 commit comments

Comments
 (0)