Restrict async/await to Xcode 13.1+

This commit is contained in:
Gwendal Roué committed 2021-10-30 20:09:39 +02:00
1 parent 9cc30018b6
commit c755dc70ef
13 files changed
+25 -22

No files matched your search

@@ -5,6 +5,8 @@ Async/Await + SwiftUI Demo Application
**This demo application is an Async/Await + SwiftUI application.** For a demo application that uses UIKit, see [GRDBDemoiOS](../GRDBDemoiOS/README.md), and for Combine + SwiftUI, see [GRDBCombineDemo](../GRDBCombineDemo/README.md).
**Requirements**: iOS 15.0+ / Xcode 13.1+
> :point_up: **Note**: This demo app is not a project template. Do not copy it as a starting point for your application. Instead, create a new project, choose a GRDB [installation method](../../../README.md#installation), and use the demo as an inspiration.
The topics covered in this demo are:
+3 -2
View File
@@ -1,5 +1,6 @@
Demo Applications
=================
- [UIKit Demo Application](GRDBDemoiOS/README.md): a storyboard-based UIKit application.
- [Combine + SwiftUI Demo Application](GRDBCombineDemo/README.md): a Combine + SwiftUI application.
- [GRDBDemoiOS](GRDBDemoiOS/README.md): a storyboard-based UIKit application.
- [GRDBCombineDemo](GRDBCombineDemo/README.md): a Combine + SwiftUI application.
- [GRDBAsyncDemo](GRDBAsyncDemo/README.md): a Async/Await + SwiftUI application.
+1 -1
View File
@@ -307,7 +307,7 @@ extension DatabaseReader {
}
}
#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.1)
extension DatabaseReader {
// MARK: - Asynchronous Database Access
+1 -1
View File
@@ -415,7 +415,7 @@ extension DatabaseWriter {
}
}
#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.1)
extension DatabaseWriter {
// MARK: - Asynchronous Database Access
+2 -2
View File
@@ -115,7 +115,7 @@ public struct DatabaseMigrator {
try migrate(writer, upTo: lastMigration.identifier)
}
#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.1)
/// Iterate migrations in the same order as they were registered. If a
/// migration has not yet been applied, its block is executed in
/// a transaction.
@@ -149,7 +149,7 @@ public struct DatabaseMigrator {
}
}
#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.1)
/// Iterate migrations in the same order as they were registered, up to the
/// provided target. If a migration has not yet been applied, its block is
/// executed in a transaction.
@@ -295,7 +295,7 @@ public final class SharedValueObservation<Element> {
}
}
#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.1)
extension SharedValueObservation {
// MARK: - Asynchronous Observation
/// The database observation, as an asynchronous sequence of
+1 -1
View File
@@ -219,7 +219,7 @@ extension ValueObservation: Refinable {
}
}
#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.1)
extension ValueObservation {
// MARK: - Asynchronous Observation
/// The database observation, as an asynchronous sequence of
+1 -1
View File
@@ -51,7 +51,7 @@ final class Test<Context> {
}
}
#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.1)
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
final class AsyncTest<Context> {
// Raise the repeatCount in order to help spotting flaky tests.
+2 -2
View File
@@ -98,7 +98,7 @@ class DatabaseMigratorTests : GRDBTestCase {
.runAtTemporaryDatabasePath { try DatabasePool(path: $0) }
}
#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.1)
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
func testAsyncAwait_NonEmptyMigratorSync() async throws {
func test(writer: DatabaseWriter) async throws {
@@ -423,7 +423,7 @@ class DatabaseMigratorTests : GRDBTestCase {
.runAtTemporaryDatabasePath { try DatabasePool(path: $0) }
}
#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.1)
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
func testAsyncAwait_MigrateUpTo() async throws {
func test(writer: DatabaseWriter) async throws {
+3 -3
View File
@@ -30,7 +30,7 @@ class DatabaseReaderTests : GRDBTestCase {
try test(setup(makeDatabasePool()).makeSnapshot())
}
#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.1)
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
func testAsyncAwait_ReadCanRead() async throws {
func setup<T: DatabaseWriter>(_ dbWriter: T) throws -> T {
@@ -68,7 +68,7 @@ class DatabaseReaderTests : GRDBTestCase {
try test(makeDatabasePool().makeSnapshot())
}
#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.1)
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
func testAsyncAwait_ReadPreventsDatabaseModification() async throws {
func test(_ dbReader: DatabaseReader) async throws {
@@ -107,7 +107,7 @@ class DatabaseReaderTests : GRDBTestCase {
try test(setup(makeDatabasePool()).makeSnapshot())
}
#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.1)
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
func testAsyncAwait_UnsafeReadCanRead() async throws {
func setup<T: DatabaseWriter>(_ dbWriter: T) throws -> T {
+6 -6
View File
@@ -266,7 +266,7 @@ class DatabaseWriterTests : GRDBTestCase {
try DatabaseQueue().backup(to: dbQueue)
}
#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.1)
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
func testAsyncAwait_write() async throws {
func setup<T: DatabaseWriter>(_ dbWriter: T) throws -> T {
@@ -288,7 +288,7 @@ class DatabaseWriterTests : GRDBTestCase {
}
#endif
#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.1)
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
func testAsyncAwait_writeWithoutTransaction() async throws {
func setup<T: DatabaseWriter>(_ dbWriter: T) throws -> T {
@@ -313,7 +313,7 @@ class DatabaseWriterTests : GRDBTestCase {
}
#endif
#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.1)
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
func testAsyncAwait_barrierWriteWithoutTransaction() async throws {
func setup<T: DatabaseWriter>(_ dbWriter: T) throws -> T {
@@ -338,7 +338,7 @@ class DatabaseWriterTests : GRDBTestCase {
}
#endif
#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.1)
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
func testAsyncAwait_erase() async throws {
func setup<T: DatabaseWriter>(_ dbWriter: T) throws -> T {
@@ -358,7 +358,7 @@ class DatabaseWriterTests : GRDBTestCase {
}
#endif
#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.1)
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
func testAsyncAwait_vacuum() async throws {
func setup<T: DatabaseWriter>(_ dbWriter: T) throws -> T {
@@ -376,7 +376,7 @@ class DatabaseWriterTests : GRDBTestCase {
}
#endif
#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.1)
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
func testAsyncAwait_vacuumInto() async throws {
func setup<T: DatabaseWriter>(_ dbWriter: T) throws -> T {
@@ -602,7 +602,7 @@ class SharedValueObservationTests: GRDBTestCase {
}
#endif
#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.1)
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
func testAsyncAwait() async throws {
let dbQueue = try makeDatabaseQueue()
+1 -1
View File
@@ -519,7 +519,7 @@ class ValueObservationTests: GRDBTestCase {
try test(makeDatabasePool())
}
#if swift(>=5.5) && canImport(_Concurrency)
#if compiler(>=5.5.1)
// MARK: - Async Await
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)