diff --git a/.travis.yml b/.travis.yml index 7696b28..0cccf85 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,15 +3,15 @@ osx_image: xcode7.2 env: matrix: - - OPTIONS="-sdk iphonesimulator -scheme iOS-Tests test -parallelize" - - OPTIONS="-scheme OSX-Tests test -parallelize" - - OPTIONS="-scheme tvOS-Tests build-tests CODE_SIGN_IDENTITY= CODE_SIGNING_REQUIRED=NO" + - OPTIONS="-sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6,OS=9.3' -scheme iOS-Tests test" + - OPTIONS="-scheme OSX-Tests test" + - OPTIONS="-scheme tvOS-Tests test CODE_SIGN_IDENTITY= CODE_SIGNING_REQUIRED=NO" before_script: - cd Project/ && pod install script: - - xctool -workspace OMPromises.xcworkspace $OPTIONS + - xcodebuild -workspace OMPromises.xcworkspace $OPTIONS notifications: email: false diff --git a/Project/Podfile b/Project/Podfile index 19205b6..f136abd 100644 --- a/Project/Podfile +++ b/Project/Podfile @@ -1,17 +1,14 @@ -target :ios do +target 'iOS-Tests' do platform :ios, '5.0' - link_with 'iOS-Tests' pod 'OMPromises/HTTP', :path => '../' end -target :osx do +target 'OSX-Tests' do platform :osx, '10.7' - link_with 'OSX-Tests' pod 'OMPromises/HTTP', :path => '../' end -target :tvos do +target 'tvOS-Tests' do platform :tvos, '9.0' - link_with 'tvOS-Tests' pod 'OMPromises/HTTP', :path => '../' end diff --git a/Sources/Core/OMLazyPromise.h b/Sources/Core/OMLazyPromise.h index 51a26d6..91b180c 100644 --- a/Sources/Core/OMLazyPromise.h +++ b/Sources/Core/OMLazyPromise.h @@ -44,7 +44,7 @@ NS_ASSUME_NONNULL_BEGIN @return A new _lazy_ promise. @see lazyPromiseWithTask:on: */ -+ (OMLazyPromise *)promiseWithTask:(id (^)())task; ++ (OMLazyPromise *)promiseWithTask:(id (^)(void))task; /** Similar to promiseWithTask:, but executes the block on the specified queue. @@ -53,7 +53,7 @@ NS_ASSUME_NONNULL_BEGIN @return A new _lazy_ promise. @see lazyPromiseWithTask: */ -+ (OMLazyPromise *)promiseWithTask:(id (^)())task on:(dispatch_queue_t)queue; ++ (OMLazyPromise *)promiseWithTask:(id (^)(void))task on:(dispatch_queue_t)queue; + (OMLazyPromise *)promiseWithDetailedTask:(void (^)(OMDeferred *deferred))task; diff --git a/Sources/Core/OMLazyPromise.m b/Sources/Core/OMLazyPromise.m index aa78b10..445c743 100644 --- a/Sources/Core/OMLazyPromise.m +++ b/Sources/Core/OMLazyPromise.m @@ -49,11 +49,11 @@ - (instancetype)initWithTask:(void (^)(OMDeferred *))task on:(dispatch_queue_t)q return self; } -+ (OMLazyPromise *)promiseWithTask:(id (^)())task { ++ (OMLazyPromise *)promiseWithTask:(id (^)(void))task { return [OMLazyPromise promiseWithTask:task on:dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)]; } -+ (OMLazyPromise *)promiseWithTask:(id (^)())task on:(dispatch_queue_t)queue { ++ (OMLazyPromise *)promiseWithTask:(id (^)(void))task on:(dispatch_queue_t)queue { return [[OMLazyPromise alloc] initWithTask:^(OMDeferred *deferred) { id result = task(); diff --git a/Sources/Core/OMPromise.h b/Sources/Core/OMPromise.h index 2e5c0ef..e2b66d8 100644 --- a/Sources/Core/OMPromise.h +++ b/Sources/Core/OMPromise.h @@ -183,7 +183,7 @@ extern NSString *const OMPromisesErrorDomain; @see promiseWithTask:on: @see promiseWithLazyTask: */ -+ (OMPromise *)promiseWithTask:(id (^)())task; ++ (OMPromise *)promiseWithTask:(id (^)(void))task; /** Similar to promiseWithTask:, but executes the block on a specific queue. @@ -192,7 +192,7 @@ extern NSString *const OMPromisesErrorDomain; @return A new promise. @see promiseWithTask: */ -+ (OMPromise *)promiseWithTask:(id (^)())task on:(dispatch_queue_t)queue; ++ (OMPromise *)promiseWithTask:(id (^)(void))task on:(dispatch_queue_t)queue; /** Create a fulfilled promise. diff --git a/Sources/Core/OMPromise.m b/Sources/Core/OMPromise.m index ba1980e..445df06 100644 --- a/Sources/Core/OMPromise.m +++ b/Sources/Core/OMPromise.m @@ -91,11 +91,11 @@ - (OMPromise *)on:(dispatch_queue_t)queue { #pragma mark - Return -+ (OMPromise *)promiseWithTask:(id (^)())task { ++ (OMPromise *)promiseWithTask:(id (^)(void))task { return [OMPromise promiseWithTask:task on:dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)]; } -+ (OMPromise *)promiseWithTask:(id (^)())task on:(dispatch_queue_t)queue { ++ (OMPromise *)promiseWithTask:(id (^)(void))task on:(dispatch_queue_t)queue { return [[OMPromise promiseWithResult:nil] then:^(id _) { return task();