From 961ea74f7e8d1321bb0104544ffec7b43b031041 Mon Sep 17 00:00:00 2001 From: Yannick Loriot Date: Sat, 3 Mar 2018 23:24:33 +0100 Subject: [PATCH] Bump version --- AwaitKit.podspec | 2 +- AwaitKit.xcodeproj/project.pbxproj | 58 ++++++++++++------- .../xcshareddata/xcschemes/AwaitKit.xcscheme | 4 +- Cartfile | 2 +- Cartfile.resolved | 2 +- Carthage/Checkouts/PromiseKit | 2 +- Example/Example/Info.plist | 2 +- Package.swift | 2 +- README.md | 10 ++-- Sources/AwaitKit/Info.plist | 2 +- Tests/AwaitKitTests/AwaitKitAsyncTests.swift | 4 +- Tests/AwaitKitTests/AwaitKitAwaitTests.swift | 12 ++-- Tests/AwaitKitTests/AwaitKitTests.swift | 20 ++++--- 13 files changed, 74 insertions(+), 48 deletions(-) diff --git a/AwaitKit.podspec b/AwaitKit.podspec index 7eeed36..d281e7d 100644 --- a/AwaitKit.podspec +++ b/AwaitKit.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'AwaitKit' - s.version = '4.0.0' + s.version = '5.0.0' s.license = 'MIT' s.summary = 'The ES8 Async/Await control flow for Swift ' s.homepage = 'https://github.com/yannickl/AwaitKit.git' diff --git a/AwaitKit.xcodeproj/project.pbxproj b/AwaitKit.xcodeproj/project.pbxproj index f7d933f..902d28a 100644 --- a/AwaitKit.xcodeproj/project.pbxproj +++ b/AwaitKit.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + CE21EFF2204B556300BDDA39 /* AwaitKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE41FCD21F46D9A700CD2271 /* AwaitKit.swift */; }; FE41FCDD1F46D9AC00CD2271 /* AwaitKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE41FCD21F46D9A700CD2271 /* AwaitKit.swift */; }; FE41FCDE1F46D9AC00CD2271 /* AwaitKitExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE41FCD31F46D9A700CD2271 /* AwaitKitExtension.swift */; }; FE41FCDF1F46D9AC00CD2271 /* DispatchQueue+Async.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE41FCD41F46D9A700CD2271 /* DispatchQueue+Async.swift */; }; @@ -19,6 +20,13 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + CE21EFF4204B556300BDDA39 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = FE41FCFD1F46DA7800CD2271 /* PromiseKit.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 633027EA203CC0060037E136; + remoteInfo = PMKDeprecatedTests; + }; FE41FD051F46DA7800CD2271 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = FE41FCFD1F46DA7800CD2271 /* PromiseKit.xcodeproj */; @@ -47,13 +55,6 @@ remoteGlobalIDString = 630019221D596292003B4E30; remoteInfo = PMKCoreTests; }; - FE41FD0D1F46DA7800CD2271 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = FE41FCFD1F46DA7800CD2271 /* PromiseKit.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 6314112F1D5978D700E24B9E; - remoteInfo = PMKDispatchTests; - }; FE41FD0F1F46DA8E00CD2271 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = FE41FCFD1F46DA7800CD2271 /* PromiseKit.xcodeproj */; @@ -137,7 +138,7 @@ FE41FD081F46DA7800CD2271 /* PMKA+Tests.xctest */, FE41FD0A1F46DA7800CD2271 /* PMKBridgeTests.xctest */, FE41FD0C1F46DA7800CD2271 /* PMKCoreTests.xctest */, - FE41FD0E1F46DA7800CD2271 /* PMKDispatchTests.xctest */, + CE21EFF5204B556300BDDA39 /* PMKDeprecatedTests.xctest */, ); name = Products; sourceTree = ""; @@ -217,15 +218,17 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0830; - LastUpgradeCheck = 0830; + LastUpgradeCheck = 0920; ORGANIZATIONNAME = "Yannick Loriot"; TargetAttributes = { FE41FD5C1F46F19F00CD2271 = { CreatedOnToolsVersion = 8.3.3; + LastSwiftMigration = 0920; ProvisioningStyle = Automatic; }; FEF0141D1E39E12200C4A60B = { CreatedOnToolsVersion = 8.2.1; + LastSwiftMigration = 0920; ProvisioningStyle = Automatic; }; }; @@ -256,6 +259,13 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ + CE21EFF5204B556300BDDA39 /* PMKDeprecatedTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = PMKDeprecatedTests.xctest; + remoteRef = CE21EFF4204B556300BDDA39 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; FE41FD061F46DA7800CD2271 /* PromiseKit.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; @@ -284,13 +294,6 @@ remoteRef = FE41FD0B1F46DA7800CD2271 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - FE41FD0E1F46DA7800CD2271 /* PMKDispatchTests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = PMKDispatchTests.xctest; - remoteRef = FE41FD0D1F46DA7800CD2271 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ @@ -311,6 +314,7 @@ FE41FD661F46F1C300CD2271 /* AwaitKitAwaitTests.swift in Sources */, FE41FD671F46F1C300CD2271 /* AwaitKitTests.swift in Sources */, FE41FD651F46F1C300CD2271 /* AwaitKitAsyncTests.swift in Sources */, + CE21EFF2204B556300BDDA39 /* AwaitKit.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -348,7 +352,7 @@ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; INFOPLIST_FILE = "$(SRCROOT)/Tests/AwaitKitTests/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks @executable_path/../Frameworks @loader_path/../Frameworks"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -359,7 +363,7 @@ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; INFOPLIST_FILE = "$(SRCROOT)/Tests/AwaitKitTests/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks @executable_path/../Frameworks @loader_path/../Frameworks"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Release; }; @@ -370,7 +374,9 @@ CLANG_ANALYZER_NONNULL = YES; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; @@ -378,7 +384,11 @@ CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -412,6 +422,7 @@ SUPPORTED_PLATFORMS = "macosx appletvsimulator appletvos watchsimulator iphonesimulator watchos iphoneos"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_SWIFT3_OBJC_INFERENCE = Off; TVOS_DEPLOYMENT_TARGET = 9.0; VERSIONING_SYSTEM = "apple-generic"; WATCHOS_DEPLOYMENT_TARGET = 2.0; @@ -425,7 +436,9 @@ CLANG_ANALYZER_NONNULL = YES; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; @@ -433,7 +446,11 @@ CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -459,6 +476,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "macosx appletvsimulator appletvos watchsimulator iphonesimulator watchos iphoneos"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_SWIFT3_OBJC_INFERENCE = Off; TVOS_DEPLOYMENT_TARGET = 9.0; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; @@ -477,7 +495,7 @@ LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -492,7 +510,7 @@ LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Release; }; diff --git a/AwaitKit.xcodeproj/xcshareddata/xcschemes/AwaitKit.xcscheme b/AwaitKit.xcodeproj/xcshareddata/xcschemes/AwaitKit.xcscheme index bf7f289..b63d7af 100644 --- a/AwaitKit.xcodeproj/xcshareddata/xcschemes/AwaitKit.xcscheme +++ b/AwaitKit.xcodeproj/xcshareddata/xcschemes/AwaitKit.xcscheme @@ -1,6 +1,6 @@ 4.5 +github "mxcl/PromiseKit" ~> 6.2 diff --git a/Cartfile.resolved b/Cartfile.resolved index d94639e..06d39de 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1 +1 @@ -github "mxcl/PromiseKit" "4.3.2" +github "mxcl/PromiseKit" "6.2.0" diff --git a/Carthage/Checkouts/PromiseKit b/Carthage/Checkouts/PromiseKit index 61f7963..660c913 160000 --- a/Carthage/Checkouts/PromiseKit +++ b/Carthage/Checkouts/PromiseKit @@ -1 +1 @@ -Subproject commit 61f796319b16f0d4f3a8cd939d8e7f9a74963038 +Subproject commit 660c913111886890474747055eef7d8d288a5747 diff --git a/Example/Example/Info.plist b/Example/Example/Info.plist index d052473..23ed9bd 100644 --- a/Example/Example/Info.plist +++ b/Example/Example/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.0 + 5.0.0 CFBundleVersion 1 LSRequiresIPhoneOS diff --git a/Package.swift b/Package.swift index 4346e8c..e19b758 100644 --- a/Package.swift +++ b/Package.swift @@ -36,7 +36,7 @@ let package = Package( targets: ["AwaitKit"]), ], dependencies: [ - .package(url: "https://github.com/mxcl/PromiseKit.git", from: "4.5.1") + .package(url: "https://github.com/mxcl/PromiseKit.git", from: "6.2.0") ], targets: [ .target( diff --git a/README.md b/README.md index 7667e2e..fe97ff1 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Have you ever dream to write asynchronous code like its synchronous counterpart? _AwaitKit_ is a powerful Swift library inspired by the [Async/Await specification in ES8 (ECMAScript 2017)](https://github.com/tc39/ecmascript-asyncawait) which provides a powerful way to write asynchronous code in a sequential manner. -Internally it uses [PromiseKit](https://github.com/mxcl/PromiseKit) to create and manage promises. +Internally it uses [PromiseKit](https://github.com/mxcl/PromiseKit) v6.2 to create and manage promises.

RequirementsGetting StartedUsageInstallationContributionContactLicense @@ -162,7 +162,7 @@ $ touch Podfile $ edit Podfile source 'https://github.com/CocoaPods/Specs.git' platform :ios, '8.0' -pod 'AwaitKit', '~> 4.0.0' +pod 'AwaitKit', '~> 5.0.0' ``` Install into your project: @@ -171,7 +171,7 @@ Install into your project: $ pod install ``` -If CocoaPods did not find the `PromiseKit 4.5.1` dependency execute this command: +If CocoaPods did not find the `PromiseKit 6.0` dependency execute this command: ```bash $ pod repo update @@ -214,14 +214,14 @@ $ brew install carthage To integrate AwaitKit into your Xcode project using Carthage, specify it in your `Cartfile`: ```ogdl -github "yannickl/AwaitKit" ~> 4.0 +github "yannickl/AwaitKit" ~> 5.0 ``` Run `carthage update` to build the framework and drag the built `AwaitKit.framework` into your Xcode project. ### Manually -[Download](https://github.com/YannickL/AwaitKit/archive/master.zip) the project and copy the `AwaitKit` folder into your project to use it in. Note that you also need to download the [PromiseKit](https://github.com/mxcl/PromiseKit) library and import it to your project. +[Download](https://github.com/YannickL/AwaitKit/archive/master.zip) the project and copy the `AwaitKit` folder into your project to use it in. Note that you also need to download the [PromiseKit](https://github.com/mxcl/PromiseKit) v6.2 library and import it to your project. ## Contribution diff --git a/Sources/AwaitKit/Info.plist b/Sources/AwaitKit/Info.plist index b816779..934f278 100644 --- a/Sources/AwaitKit/Info.plist +++ b/Sources/AwaitKit/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 4.0.0 + 5.0.0 CFBundleSignature ???? CFBundleVersion diff --git a/Tests/AwaitKitTests/AwaitKitAsyncTests.swift b/Tests/AwaitKitTests/AwaitKitAsyncTests.swift index c5fab30..5fb389b 100644 --- a/Tests/AwaitKitTests/AwaitKitAsyncTests.swift +++ b/Tests/AwaitKitTests/AwaitKitAsyncTests.swift @@ -40,8 +40,10 @@ class AwaitKitAsyncTests: XCTestCase { return "AwaitedPromiseKit" } - _ = promise.then { value in + _ = promise.then { value -> Promise in expect.fulfill() + + return Promise() } waitForExpectations(timeout: 0.5) { error in diff --git a/Tests/AwaitKitTests/AwaitKitAwaitTests.swift b/Tests/AwaitKitTests/AwaitKitAwaitTests.swift index 5a93280..c521cfa 100644 --- a/Tests/AwaitKitTests/AwaitKitAwaitTests.swift +++ b/Tests/AwaitKitTests/AwaitKitAwaitTests.swift @@ -33,11 +33,11 @@ class AwaitKitAwaitTests: XCTestCase { let commonError = NSError(domain: "com.yannickloriot.error", code: 320, userInfo: nil) func testSimpleAwaitPromise() { - let promise: Promise = Promise { resolve, reject in + let promise: Promise = Promise { seal in let deadlineTime = DispatchTime.now() + .seconds(1) backgroundQueue.asyncAfter(deadline: deadlineTime, execute: { - resolve("AwaitedPromiseKit") + seal.fulfill("AwaitedPromiseKit") }) } @@ -47,11 +47,11 @@ class AwaitKitAwaitTests: XCTestCase { } func testSimpleFailedAwaitPromise() { - let promise: Promise = Promise { resolve, reject in + let promise: Promise = Promise { seal in let deadlineTime = DispatchTime.now() + .seconds(1) backgroundQueue.asyncAfter(deadline: deadlineTime, execute: { - reject(self.commonError) + seal.reject(self.commonError) }) } @@ -59,8 +59,8 @@ class AwaitKitAwaitTests: XCTestCase { } func testNoValueAwaitPromise() { - let promise: Promise = Promise { resolve, reject in - resolve(()) + let promise: Promise = Promise { seal in + seal.fulfill(()) } XCTAssertNotNil(promise.value) diff --git a/Tests/AwaitKitTests/AwaitKitTests.swift b/Tests/AwaitKitTests/AwaitKitTests.swift index 3fa2c06..b8a5890 100644 --- a/Tests/AwaitKitTests/AwaitKitTests.swift +++ b/Tests/AwaitKitTests/AwaitKitTests.swift @@ -30,8 +30,8 @@ import XCTest class AwaitKitTests: XCTestCase { func testExcludeSameQueue() { - let promise = Promise { resolve, reject in - resolve(()) + let promise = Promise { seal in + seal.fulfill(()) } XCTAssertThrowsError(try DispatchQueue.main.ak.await(promise)) @@ -40,16 +40,18 @@ class AwaitKitTests: XCTestCase { func testAsyncAndAwaitOnDifferentQueue() { let expect = expectation(description: "Async should fulfill") - let promise = Promise { resolve, reject in - resolve(()) + let promise = Promise { seal in + seal.fulfill(()) } let result: Promise = async { try await(promise) } - _ = result.then { _ in + _ = result.then { _ -> Promise in expect.fulfill() + + return Promise() } waitForExpectations(timeout: 0.1, handler: nil) @@ -58,16 +60,18 @@ class AwaitKitTests: XCTestCase { func testImbricationQueue() { let expect = expectation(description: "Async should fulfill") - let promise = Promise { resolve, reject in - resolve(()) + let promise = Promise { seal in + seal.fulfill(()) } let result: Promise = async { try await(async { try await(promise) }) } - _ = result.then { _ in + _ = result.then { _ -> Promise in expect.fulfill() + + return Promise() } waitForExpectations(timeout: 0.1, handler: nil)