diff --git a/.github/workflows/macOS.yml b/.github/workflows/macOS.yml index 13208f15..0b298b59 100644 --- a/.github/workflows/macOS.yml +++ b/.github/workflows/macOS.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: - xcode: ["/Applications/Xcode_11.6.app","/Applications/Xcode_11.7_beta.app","/Applications/Xcode_12_beta.app"] + xcode: ["/Applications/Xcode_11.5.app","/Applications/Xcode_11.6.app","/Applications/Xcode_11.7.app","/Applications/Xcode_12.app"] steps: - uses: actions/checkout@v2 @@ -39,7 +39,7 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - name: Build Documentation if: ${{ matrix.xcode == '/Applications/Xcode_12_beta.app' }} - run: swift run sourcedocs generate build -c --spm-module MistKit + run: swift run sourcedocs generate build -cra - name: Commit files if: ${{ matrix.xcode == '/Applications/Xcode_12_beta.app' }} run: | diff --git a/Documentation/Reference/README.md b/Documentation/Reference/README.md index 6c67cf25..a571afc1 100644 --- a/Documentation/Reference/README.md +++ b/Documentation/Reference/README.md @@ -88,4 +88,4 @@ - [ModifyRecordQueryRequest.Data](typealiases/ModifyRecordQueryRequest.Data.md) - [ModifyRecordQueryRequest.Response](typealiases/ModifyRecordQueryRequest.Response.md) -This file was generated by [SourceDocs](https://github.com/eneko/SourceDocs) on 2020-09-15 23:54:29 +0000 \ No newline at end of file +This file was generated by [SourceDocs](https://github.com/eneko/SourceDocs) \ No newline at end of file diff --git a/Documentation/Reference/extensions/MKDatabase.md b/Documentation/Reference/extensions/MKDatabase.md index 2e0f13b3..ef1608d7 100644 --- a/Documentation/Reference/extensions/MKDatabase.md +++ b/Documentation/Reference/extensions/MKDatabase.md @@ -9,7 +9,10 @@ public extension MKDatabase where HttpClient == MKURLSessionClient ### `init(connection:factory:tokenManager:session:)` ```swift -init(connection: MKDatabaseConnection, factory: MKURLBuilderFactory? = nil, tokenManager: MKTokenManagerProtocol? = nil, session: URLSession? = nil) +init(connection: MKDatabaseConnection, + factory: MKURLBuilderFactory? = nil, + tokenManager: MKTokenManagerProtocol? = nil, + session: URLSession? = nil) ``` ### `query(_:_:)` diff --git a/Documentation/Reference/structs/MKDatabase.md b/Documentation/Reference/structs/MKDatabase.md index e12f6e44..0379f9b2 100644 --- a/Documentation/Reference/structs/MKDatabase.md +++ b/Documentation/Reference/structs/MKDatabase.md @@ -10,7 +10,10 @@ public struct MKDatabase ### `init(connection:factory:client:tokenManager:)` ```swift -public init(connection: MKDatabaseConnection, factory: MKURLBuilderFactory? = nil, client: HttpClient, tokenManager: MKTokenManagerProtocol? = nil) +public init(connection: MKDatabaseConnection, + factory: MKURLBuilderFactory? = nil, + client: HttpClient, + tokenManager: MKTokenManagerProtocol? = nil) ``` ### `perform(request:returnFailedAuthentication:_:)` diff --git a/Sources/MistKit/MKDatabase.swift b/Sources/MistKit/MKDatabase.swift index a253e021..edf201e3 100644 --- a/Sources/MistKit/MKDatabase.swift +++ b/Sources/MistKit/MKDatabase.swift @@ -6,7 +6,10 @@ public struct MKDatabase { let decoder: MKDecoder = JSONDecoder() let client: HttpClient - public init(connection: MKDatabaseConnection, factory: MKURLBuilderFactory? = nil, client: HttpClient, tokenManager: MKTokenManagerProtocol? = nil) { + public init(connection: MKDatabaseConnection, + factory: MKURLBuilderFactory? = nil, + client: HttpClient, + tokenManager: MKTokenManagerProtocol? = nil) { let factory = factory ?? MKURLBuilderFactory() urlBuilder = factory.builder(forConnection: connection, withTokenManager: tokenManager) self.client = client @@ -82,7 +85,10 @@ public struct MKDatabase { #endif public extension MKDatabase where HttpClient == MKURLSessionClient { - init(connection: MKDatabaseConnection, factory: MKURLBuilderFactory? = nil, tokenManager: MKTokenManagerProtocol? = nil, session: URLSession? = nil) { + init(connection: MKDatabaseConnection, + factory: MKURLBuilderFactory? = nil, + tokenManager: MKTokenManagerProtocol? = nil, + session: URLSession? = nil) { let factory = factory ?? MKURLBuilderFactory() urlBuilder = factory.builder(forConnection: connection, withTokenManager: tokenManager) client = MKURLSessionClient(session: session ?? URLSession.shared) diff --git a/Sources/mistdemoc/Commands/ParsableAsyncCommand.swift b/Sources/mistdemoc/Commands/ParsableAsyncCommand.swift index 5a99ac37..65071d9f 100644 --- a/Sources/mistdemoc/Commands/ParsableAsyncCommand.swift +++ b/Sources/mistdemoc/Commands/ParsableAsyncCommand.swift @@ -1,4 +1,5 @@ import ArgumentParser +import CoreFoundation import Foundation protocol ParsableAsyncCommand: ParsableCommand { @@ -7,17 +8,15 @@ protocol ParsableAsyncCommand: ParsableCommand { extension ParsableAsyncCommand { func run() throws { - var result: Result? + var result: Result! runAsync { error in result = Result(error) + CFRunLoopStop(CFRunLoopGetMain()) } - while true { - RunLoop.main.run(until: .distantPast) - if let result = result { - return try result.get() - } - } + CFRunLoopRun() + + return try result.get() } }