From bd77761c0cda529f7d6a30be959e954d94b61aea Mon Sep 17 00:00:00 2001 From: vvveiii Date: Tue, 18 Aug 2020 15:55:23 +0800 Subject: [PATCH 01/15] Replace OSAtomic with stdatomic. --- ReactiveObjC.xcodeproj/project.pbxproj | 59 +++++++++---------- .../xcschemes/ReactiveObjC-iOS.xcscheme | 24 ++++---- .../xcschemes/ReactiveObjC-macOS.xcscheme | 24 ++++---- .../xcschemes/ReactiveObjC-tvOS.xcscheme | 24 ++++---- .../xcschemes/ReactiveObjC-watchOS.xcscheme | 10 +--- .../NSObject+RACPropertySubscribing.m | 1 - ReactiveObjC/RACCommand.m | 8 +-- ReactiveObjC/RACDisposable.m | 10 ++-- ReactiveObjC/RACDynamicSequence.m | 8 +-- ReactiveObjC/RACDynamicSignal.m | 1 - ReactiveObjC/RACMulticastConnection.m | 13 ++-- ReactiveObjC/RACSignal+Operations.m | 14 ++--- ReactiveObjC/RACSignal.m | 8 +-- ReactiveObjC/extobjc/EXTRuntimeExtensions.m | 1 - .../RACMulticastConnectionSpec.m | 1 - ReactiveObjCTests/RACSchedulerSpec.m | 1 - ReactiveObjCTests/RACSignalSpec.m | 6 +- ReactiveObjCTests/RACSubjectSpec.m | 8 +-- ReactiveObjCTests/RACSubscriberSpec.m | 12 ++-- .../RACTargetQueueSchedulerSpec.m | 12 ++-- 20 files changed, 111 insertions(+), 134 deletions(-) diff --git a/ReactiveObjC.xcodeproj/project.pbxproj b/ReactiveObjC.xcodeproj/project.pbxproj index 31b7adf66..10ea07b57 100644 --- a/ReactiveObjC.xcodeproj/project.pbxproj +++ b/ReactiveObjC.xcodeproj/project.pbxproj @@ -1951,7 +1951,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 0800; + LastUpgradeCheck = 1160; ORGANIZATIONNAME = GitHub; TargetAttributes = { 57A4D1AF1BA13D7A00F7D4B1 = { @@ -1975,11 +1975,11 @@ }; D047260B19E49F82006002AA = { CreatedOnToolsVersion = 6.1; - LastSwiftMigration = 1010; + LastSwiftMigration = 1160; }; D047261519E49F82006002AA = { CreatedOnToolsVersion = 6.1; - LastSwiftMigration = 1010; + LastSwiftMigration = 1160; }; }; }; @@ -2602,7 +2602,6 @@ ); INFOPLIST_FILE = ReactiveObjC/Info.plist; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -2622,7 +2621,6 @@ ); INFOPLIST_FILE = ReactiveObjC/Info.plist; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; }; name = Test; }; @@ -2642,7 +2640,6 @@ ); INFOPLIST_FILE = ReactiveObjC/Info.plist; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; }; name = Release; }; @@ -2661,7 +2658,6 @@ "DTRACE_PROBES_DISABLED=1", ); INFOPLIST_FILE = ReactiveObjC/Info.plist; - SWIFT_VERSION = 4.2; }; name = Profile; }; @@ -2679,7 +2675,6 @@ INFOPLIST_FILE = ReactiveObjCTests/Info.plist; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -2697,7 +2692,6 @@ INFOPLIST_FILE = ReactiveObjCTests/Info.plist; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; }; name = Test; }; @@ -2715,7 +2709,6 @@ INFOPLIST_FILE = ReactiveObjCTests/Info.plist; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; }; name = Release; }; @@ -2732,7 +2725,6 @@ ); INFOPLIST_FILE = ReactiveObjCTests/Info.plist; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; - SWIFT_VERSION = 4.2; }; name = Profile; }; @@ -2752,7 +2744,6 @@ ); INFOPLIST_FILE = ReactiveObjC/Info.plist; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -2772,7 +2763,6 @@ ); INFOPLIST_FILE = ReactiveObjC/Info.plist; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; }; name = Test; }; @@ -2792,7 +2782,6 @@ ); INFOPLIST_FILE = ReactiveObjC/Info.plist; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; }; name = Release; }; @@ -2811,7 +2800,6 @@ "DTRACE_PROBES_DISABLED=1", ); INFOPLIST_FILE = ReactiveObjC/Info.plist; - SWIFT_VERSION = 4.2; }; name = Profile; }; @@ -2820,6 +2808,11 @@ baseConfigurationReference = D047262919E49FE8006002AA /* Debug.xcconfig */; buildSettings = { BITCODE_GENERATION_MODE = bitcode; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CODE_SIGNING_REQUIRED = NO; CURRENT_PROJECT_VERSION = 1; ENABLE_TESTABILITY = YES; @@ -2827,6 +2820,7 @@ MACOSX_DEPLOYMENT_TARGET = 10.9; PRODUCT_BUNDLE_IDENTIFIER = "org.reactivecocoa.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(PROJECT_NAME)"; + SWIFT_VERSION = 5.0; TVOS_DEPLOYMENT_TARGET = 9.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -2843,6 +2837,11 @@ baseConfigurationReference = D047262B19E49FE8006002AA /* Release.xcconfig */; buildSettings = { BITCODE_GENERATION_MODE = bitcode; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CODE_SIGNING_REQUIRED = NO; CURRENT_PROJECT_VERSION = 1; GCC_OPTIMIZATION_LEVEL = 0; @@ -2850,6 +2849,8 @@ MACOSX_DEPLOYMENT_TARGET = 10.9; PRODUCT_BUNDLE_IDENTIFIER = "org.reactivecocoa.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(PROJECT_NAME)"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_VERSION = 5.0; TVOS_DEPLOYMENT_TARGET = 9.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -2873,7 +2874,6 @@ FRAMEWORK_VERSION = A; INFOPLIST_FILE = ReactiveObjC/Info.plist; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; USER_HEADER_SEARCH_PATHS = ReactiveObjC/extobjc; }; name = Debug; @@ -2890,7 +2890,6 @@ FRAMEWORK_VERSION = A; INFOPLIST_FILE = ReactiveObjC/Info.plist; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; USER_HEADER_SEARCH_PATHS = ReactiveObjC/extobjc; }; name = Release; @@ -2909,7 +2908,6 @@ MACOSX_DEPLOYMENT_TARGET = 10.10; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -2927,7 +2925,6 @@ MACOSX_DEPLOYMENT_TARGET = 10.10; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; }; name = Release; }; @@ -2943,7 +2940,6 @@ ENABLE_BITCODE = YES; INFOPLIST_FILE = ReactiveObjC/Info.plist; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; USER_HEADER_SEARCH_PATHS = ReactiveObjC/extobjc; }; name = Debug; @@ -2960,7 +2956,6 @@ ENABLE_BITCODE = YES; INFOPLIST_FILE = ReactiveObjC/Info.plist; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; USER_HEADER_SEARCH_PATHS = ReactiveObjC/extobjc; }; name = Release; @@ -2974,7 +2969,6 @@ INFOPLIST_FILE = ReactiveObjCTests/Info.plist; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -2987,7 +2981,6 @@ INFOPLIST_FILE = ReactiveObjCTests/Info.plist; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; }; name = Release; }; @@ -2996,12 +2989,18 @@ baseConfigurationReference = D047262A19E49FE8006002AA /* Profile.xcconfig */; buildSettings = { BITCODE_GENERATION_MODE = bitcode; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CODE_SIGNING_REQUIRED = NO; CURRENT_PROJECT_VERSION = 1; IPHONEOS_DEPLOYMENT_TARGET = 8.0; MACOSX_DEPLOYMENT_TARGET = 10.9; PRODUCT_BUNDLE_IDENTIFIER = "org.reactivecocoa.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(PROJECT_NAME)"; + SWIFT_VERSION = 5.0; TVOS_DEPLOYMENT_TARGET = 9.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -3024,7 +3023,6 @@ DYLIB_CURRENT_VERSION = 1; FRAMEWORK_VERSION = A; INFOPLIST_FILE = ReactiveObjC/Info.plist; - SWIFT_VERSION = 4.2; USER_HEADER_SEARCH_PATHS = ReactiveObjC/extobjc; }; name = Profile; @@ -3042,7 +3040,6 @@ INFOPLIST_FILE = ReactiveObjCTests/Info.plist; MACOSX_DEPLOYMENT_TARGET = 10.10; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; - SWIFT_VERSION = 4.2; }; name = Profile; }; @@ -3057,7 +3054,6 @@ DYLIB_CURRENT_VERSION = 1; ENABLE_BITCODE = YES; INFOPLIST_FILE = ReactiveObjC/Info.plist; - SWIFT_VERSION = 4.2; USER_HEADER_SEARCH_PATHS = ReactiveObjC/extobjc; }; name = Profile; @@ -3070,7 +3066,6 @@ CLANG_ENABLE_MODULES = YES; INFOPLIST_FILE = ReactiveObjCTests/Info.plist; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; - SWIFT_VERSION = 4.2; }; name = Profile; }; @@ -3079,12 +3074,18 @@ baseConfigurationReference = D047262C19E49FE8006002AA /* Test.xcconfig */; buildSettings = { BITCODE_GENERATION_MODE = bitcode; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CODE_SIGNING_REQUIRED = NO; CURRENT_PROJECT_VERSION = 1; IPHONEOS_DEPLOYMENT_TARGET = 8.0; MACOSX_DEPLOYMENT_TARGET = 10.10; PRODUCT_BUNDLE_IDENTIFIER = "org.reactivecocoa.$(PRODUCT_NAME:rfc1034identifier)-Tests"; PRODUCT_NAME = "$(PROJECT_NAME)"; + SWIFT_VERSION = 5.0; TVOS_DEPLOYMENT_TARGET = 9.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -3108,7 +3109,6 @@ FRAMEWORK_VERSION = A; INFOPLIST_FILE = ReactiveObjC/Info.plist; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; USER_HEADER_SEARCH_PATHS = ReactiveObjC/extobjc; }; name = Test; @@ -3127,7 +3127,6 @@ MACOSX_DEPLOYMENT_TARGET = 10.10; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; }; name = Test; }; @@ -3143,7 +3142,6 @@ ENABLE_BITCODE = YES; INFOPLIST_FILE = ReactiveObjC/Info.plist; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; USER_HEADER_SEARCH_PATHS = ReactiveObjC/extobjc; }; name = Test; @@ -3157,7 +3155,6 @@ INFOPLIST_FILE = ReactiveObjCTests/Info.plist; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; }; name = Test; }; diff --git a/ReactiveObjC.xcodeproj/xcshareddata/xcschemes/ReactiveObjC-iOS.xcscheme b/ReactiveObjC.xcodeproj/xcshareddata/xcschemes/ReactiveObjC-iOS.xcscheme index 52e154e94..2c58e8806 100644 --- a/ReactiveObjC.xcodeproj/xcshareddata/xcschemes/ReactiveObjC-iOS.xcscheme +++ b/ReactiveObjC.xcodeproj/xcshareddata/xcschemes/ReactiveObjC-iOS.xcscheme @@ -1,6 +1,6 @@ + + + + @@ -82,17 +91,6 @@ - - - - - - - - + + + + @@ -82,17 +91,6 @@ - - - - - - - - + + + + @@ -82,17 +91,6 @@ - - - - - - - - - - - - + + - - @implementation NSObject (RACPropertySubscribing) diff --git a/ReactiveObjC/RACCommand.m b/ReactiveObjC/RACCommand.m index 4342f80ba..db4c6ba98 100644 --- a/ReactiveObjC/RACCommand.m +++ b/ReactiveObjC/RACCommand.m @@ -17,14 +17,14 @@ #import "RACScheduler.h" #import "RACSequence.h" #import "RACSignal+Operations.h" -#import +#import NSErrorDomain const RACCommandErrorDomain = @"RACCommandErrorDomain"; NSString * const RACUnderlyingCommandErrorKey = @"RACUnderlyingCommandErrorKey"; @interface RACCommand () { // Atomic backing variable for `allowsConcurrentExecution`. - volatile uint32_t _allowsConcurrentExecution; + atomic_uint _allowsConcurrentExecution; } /// A subject that sends added execution signals. @@ -53,9 +53,9 @@ - (BOOL)allowsConcurrentExecution { - (void)setAllowsConcurrentExecution:(BOOL)allowed { if (allowed) { - OSAtomicOr32Barrier(1, &_allowsConcurrentExecution); + atomic_fetch_or(&_allowsConcurrentExecution, 1); } else { - OSAtomicAnd32Barrier(0, &_allowsConcurrentExecution); + atomic_fetch_and(&_allowsConcurrentExecution, 0); } [self.allowsConcurrentExecutionSubject sendNext:@(_allowsConcurrentExecution)]; diff --git a/ReactiveObjC/RACDisposable.m b/ReactiveObjC/RACDisposable.m index 3cba07f4f..55e92964e 100644 --- a/ReactiveObjC/RACDisposable.m +++ b/ReactiveObjC/RACDisposable.m @@ -8,7 +8,7 @@ #import "RACDisposable.h" #import "RACScopedDisposable.h" -#import +#import @interface RACDisposable () { // A copied block of type void (^)(void) containing the logic for disposal, @@ -16,7 +16,7 @@ @interface RACDisposable () { // NULL if the receiver is already disposed. // // This should only be used atomically. - void * volatile _disposeBlock; + _Atomic(void *) _disposeBlock; } @end @@ -35,7 +35,7 @@ - (instancetype)init { self = [super init]; _disposeBlock = (__bridge void *)self; - OSMemoryBarrier(); + atomic_thread_fence(memory_order_seq_cst); return self; } @@ -46,7 +46,7 @@ - (instancetype)initWithBlock:(void (^)(void))block { self = [super init]; _disposeBlock = (void *)CFBridgingRetain([block copy]); - OSMemoryBarrier(); + atomic_thread_fence(memory_order_seq_cst); return self; } @@ -69,7 +69,7 @@ - (void)dispose { while (YES) { void *blockPtr = _disposeBlock; - if (OSAtomicCompareAndSwapPtrBarrier(blockPtr, NULL, &_disposeBlock)) { + if (atomic_compare_exchange_strong(&_disposeBlock, &blockPtr, NULL)) { if (blockPtr != (__bridge void *)self) { disposeBlock = CFBridgingRelease(blockPtr); } diff --git a/ReactiveObjC/RACDynamicSequence.m b/ReactiveObjC/RACDynamicSequence.m index 177a22514..6269d9af7 100644 --- a/ReactiveObjC/RACDynamicSequence.m +++ b/ReactiveObjC/RACDynamicSequence.m @@ -7,7 +7,7 @@ // #import "RACDynamicSequence.h" -#import +#import // Determines how RACDynamicSequences will be deallocated before the next one is // shifted onto the autorelease pool. @@ -114,10 +114,10 @@ + (RACSequence *)sequenceWithLazyDependency:(id (^)(void))dependencyBlock headBl } - (void)dealloc { - static volatile int32_t directDeallocCount = 0; + static atomic_int directDeallocCount = 0; - if (OSAtomicIncrement32(&directDeallocCount) >= DEALLOC_OVERFLOW_GUARD) { - OSAtomicAdd32(-DEALLOC_OVERFLOW_GUARD, &directDeallocCount); + if (atomic_fetch_add(&directDeallocCount, 1) >= DEALLOC_OVERFLOW_GUARD) { + atomic_fetch_add(&directDeallocCount, -DEALLOC_OVERFLOW_GUARD); // Put this sequence's tail onto the autorelease pool so we stop // recursing. diff --git a/ReactiveObjC/RACDynamicSignal.m b/ReactiveObjC/RACDynamicSignal.m index 3bee2f7c2..53d6d2e9e 100644 --- a/ReactiveObjC/RACDynamicSignal.m +++ b/ReactiveObjC/RACDynamicSignal.m @@ -12,7 +12,6 @@ #import "RACPassthroughSubscriber.h" #import "RACScheduler+Private.h" #import "RACSubscriber.h" -#import @interface RACDynamicSignal () diff --git a/ReactiveObjC/RACMulticastConnection.m b/ReactiveObjC/RACMulticastConnection.m index f59824500..3b6183535 100644 --- a/ReactiveObjC/RACMulticastConnection.m +++ b/ReactiveObjC/RACMulticastConnection.m @@ -11,7 +11,7 @@ #import "RACDisposable.h" #import "RACSerialDisposable.h" #import "RACSubject.h" -#import +#import @interface RACMulticastConnection () { RACSubject *_signal; @@ -24,7 +24,7 @@ @interface RACMulticastConnection () { // // If the swap is unsuccessful it means that `_sourceSignal` has already been // connected and the caller has no action to take. - int32_t volatile _hasConnected; + _Atomic(BOOL) _hasConnected; } @property (nonatomic, readonly, strong) RACSignal *sourceSignal; @@ -51,7 +51,8 @@ - (instancetype)initWithSourceSignal:(RACSignal *)source subject:(RACSubject *)s #pragma mark Connecting - (RACDisposable *)connect { - BOOL shouldConnect = OSAtomicCompareAndSwap32Barrier(0, 1, &_hasConnected); + BOOL expected = NO; + BOOL shouldConnect = atomic_compare_exchange_strong(&_hasConnected, &expected, YES); if (shouldConnect) { self.serialDisposable.disposable = [self.sourceSignal subscribe:_signal]; @@ -61,11 +62,11 @@ - (RACDisposable *)connect { } - (RACSignal *)autoconnect { - __block volatile int32_t subscriberCount = 0; + __block atomic_int subscriberCount = 0; return [[RACSignal createSignal:^(id subscriber) { - OSAtomicIncrement32Barrier(&subscriberCount); + atomic_fetch_add(&subscriberCount, 1); RACDisposable *subscriptionDisposable = [self.signal subscribe:subscriber]; RACDisposable *connectionDisposable = [self connect]; @@ -73,7 +74,7 @@ - (RACSignal *)autoconnect { return [RACDisposable disposableWithBlock:^{ [subscriptionDisposable dispose]; - if (OSAtomicDecrement32Barrier(&subscriberCount) == 0) { + if (atomic_fetch_sub(&subscriberCount, 1) - 1 == 0) { [connectionDisposable dispose]; } }]; diff --git a/ReactiveObjC/RACSignal+Operations.m b/ReactiveObjC/RACSignal+Operations.m index 87967adfd..15c10de5e 100644 --- a/ReactiveObjC/RACSignal+Operations.m +++ b/ReactiveObjC/RACSignal+Operations.m @@ -26,7 +26,7 @@ #import "RACSubscriber.h" #import "RACTuple.h" #import "RACUnit.h" -#import +#import #import NSErrorDomain const RACSignalErrorDomain = @"RACSignalErrorDomain"; @@ -646,7 +646,7 @@ - (RACDisposable *)setKeyPath:(NSString *)keyPath onObject:(NSObject *)object ni // Purposely not retaining 'object', since we want to tear down the binding // when it deallocates normally. - __block void * volatile objectPtr = (__bridge void *)object; + __block _Atomic(void *) objectPtr = (__bridge void *)object; RACDisposable *subscriptionDisposable = [self subscribeNext:^(id x) { // Possibly spec, possibly compiler bug, but this __bridge cast does not @@ -698,7 +698,7 @@ - (RACDisposable *)setKeyPath:(NSString *)keyPath onObject:(NSObject *)object ni while (YES) { void *ptr = objectPtr; - if (OSAtomicCompareAndSwapPtrBarrier(ptr, NULL, &objectPtr)) { + if (atomic_compare_exchange_strong(&objectPtr, &ptr, NULL)) { break; } } @@ -1048,17 +1048,17 @@ - (RACSignal *)subscribeOn:(RACScheduler *)scheduler { - (RACSignal *)deliverOnMainThread { return [[RACSignal createSignal:^(id subscriber) { - __block volatile int32_t queueLength = 0; + __block atomic_int queueLength = 0; void (^performOnMainThread)(dispatch_block_t) = ^(dispatch_block_t block) { - int32_t queued = OSAtomicIncrement32(&queueLength); + int32_t queued = atomic_fetch_add(&queueLength, 1) + 1; if (NSThread.isMainThread && queued == 1) { block(); - OSAtomicDecrement32(&queueLength); + atomic_fetch_sub(&queueLength, 1); } else { dispatch_async(dispatch_get_main_queue(), ^{ block(); - OSAtomicDecrement32(&queueLength); + atomic_fetch_sub(&queueLength, 1); }); } }; diff --git a/ReactiveObjC/RACSignal.m b/ReactiveObjC/RACSignal.m index 84607f681..eb79e6039 100644 --- a/ReactiveObjC/RACSignal.m +++ b/ReactiveObjC/RACSignal.m @@ -21,7 +21,7 @@ #import "RACSubject.h" #import "RACSubscriber+Private.h" #import "RACTuple.h" -#import +#import @implementation RACSignal @@ -108,12 +108,12 @@ - (RACSignal *)bind:(RACSignalBindBlock (^)(void))block { return [[RACSignal createSignal:^(id subscriber) { RACSignalBindBlock bindingBlock = block(); - __block volatile int32_t signalCount = 1; // indicates self + __block atomic_int signalCount = 1; // indicates self RACCompoundDisposable *compoundDisposable = [RACCompoundDisposable compoundDisposable]; void (^completeSignal)(RACDisposable *) = ^(RACDisposable *finishedDisposable) { - if (OSAtomicDecrement32Barrier(&signalCount) == 0) { + if (atomic_fetch_sub(&signalCount, 1) - 1 == 0) { [subscriber sendCompleted]; [compoundDisposable dispose]; } else { @@ -122,7 +122,7 @@ - (RACSignal *)bind:(RACSignalBindBlock (^)(void))block { }; void (^addSignal)(RACSignal *) = ^(RACSignal *signal) { - OSAtomicIncrement32Barrier(&signalCount); + atomic_fetch_add(&signalCount, 1); RACSerialDisposable *selfDisposable = [[RACSerialDisposable alloc] init]; [compoundDisposable addDisposable:selfDisposable]; diff --git a/ReactiveObjC/extobjc/EXTRuntimeExtensions.m b/ReactiveObjC/extobjc/EXTRuntimeExtensions.m index 99c10e980..3a2dca635 100644 --- a/ReactiveObjC/extobjc/EXTRuntimeExtensions.m +++ b/ReactiveObjC/extobjc/EXTRuntimeExtensions.m @@ -11,7 +11,6 @@ #import #import -#import #import #import #import diff --git a/ReactiveObjCTests/RACMulticastConnectionSpec.m b/ReactiveObjCTests/RACMulticastConnectionSpec.m index 5ce04ba5f..2d0abc0be 100644 --- a/ReactiveObjCTests/RACMulticastConnectionSpec.m +++ b/ReactiveObjCTests/RACMulticastConnectionSpec.m @@ -15,7 +15,6 @@ #import "RACSubscriber.h" #import "RACReplaySubject.h" #import "RACScheduler.h" -#import QuickSpecBegin(RACMulticastConnectionSpec) diff --git a/ReactiveObjCTests/RACSchedulerSpec.m b/ReactiveObjCTests/RACSchedulerSpec.m index 754a8c83e..0199d46d5 100644 --- a/ReactiveObjCTests/RACSchedulerSpec.m +++ b/ReactiveObjCTests/RACSchedulerSpec.m @@ -15,7 +15,6 @@ #import "RACDisposable.h" #import #import "RACTestExampleScheduler.h" -#import // This shouldn't be used directly. Use the `expectCurrentSchedulers` block // below instead. diff --git a/ReactiveObjCTests/RACSignalSpec.m b/ReactiveObjCTests/RACSignalSpec.m index bc65fd547..8c472b68c 100644 --- a/ReactiveObjCTests/RACSignalSpec.m +++ b/ReactiveObjCTests/RACSignalSpec.m @@ -33,7 +33,7 @@ #import "RACTestScheduler.h" #import "RACTuple.h" #import "RACUnit.h" -#import +#import // Set in a beforeAll below. static NSError *RACSignalTestError; @@ -111,7 +111,7 @@ + (void)configure:(Configuration *)configuration { }; RACSignal *infiniteSignal = [RACSignal createSignal:^(id subscriber) { - __block volatile int32_t done = 0; + __block atomic_int done = 0; [RACScheduler.mainThreadScheduler schedule:^{ while (!done) { @@ -120,7 +120,7 @@ + (void)configure:(Configuration *)configuration { }]; return [RACDisposable disposableWithBlock:^{ - OSAtomicIncrement32Barrier(&done); + atomic_fetch_add(&done, 1); }]; }]; diff --git a/ReactiveObjCTests/RACSubjectSpec.m b/ReactiveObjCTests/RACSubjectSpec.m index bfe56a5b5..5e2a827aa 100644 --- a/ReactiveObjCTests/RACSubjectSpec.m +++ b/ReactiveObjCTests/RACSubjectSpec.m @@ -11,7 +11,7 @@ #import "RACSubscriberExamples.h" -#import +#import #import #import "RACBehaviorSubject.h" #import "RACCompoundDisposable.h" @@ -255,10 +255,10 @@ - (void)didSubscribeWithDisposable:(RACCompoundDisposable *)disposable { // Just leak it, ain't no thang. __unsafe_unretained volatile id *values = (__unsafe_unretained id *)calloc(count, sizeof(*values)); - __block volatile int32_t nextIndex = 0; + __block atomic_int nextIndex = 0; [subject subscribeNext:^(NSNumber *value) { - int32_t indexPlusOne = OSAtomicIncrement32(&nextIndex); + int32_t indexPlusOne = atomic_fetch_add(&nextIndex, 1) + 1; values[indexPlusOne - 1] = value; }]; @@ -276,7 +276,7 @@ - (void)didSubscribeWithDisposable:(RACCompoundDisposable *)disposable { [subject sendCompleted]; }); - OSMemoryBarrier(); + atomic_thread_fence(memory_order_seq_cst); NSArray *liveValues = [NSArray arrayWithObjects:(id *)values count:(NSUInteger)nextIndex]; expect(liveValues).to(haveCount(@(count))); diff --git a/ReactiveObjCTests/RACSubscriberSpec.m b/ReactiveObjCTests/RACSubscriberSpec.m index 0ff9fba90..834db099b 100644 --- a/ReactiveObjCTests/RACSubscriberSpec.m +++ b/ReactiveObjCTests/RACSubscriberSpec.m @@ -13,15 +13,15 @@ #import "RACSubscriber.h" #import "RACSubscriber+Private.h" -#import +#import QuickSpecBegin(RACSubscriberSpec) __block RACSubscriber *subscriber; __block NSMutableArray *values; -__block volatile BOOL finished; -__block volatile int32_t nextsAfterFinished; +__block _Atomic(BOOL) finished; +__block atomic_int nextsAfterFinished; __block BOOL success; __block NSError *error; @@ -36,7 +36,7 @@ error = nil; subscriber = [RACSubscriber subscriberWithNext:^(id value) { - if (finished) OSAtomicIncrement32Barrier(&nextsAfterFinished); + if (finished) atomic_fetch_add(&nextsAfterFinished, 1); [values addObject:value]; } error:^(NSError *e) { @@ -111,7 +111,7 @@ [subscriber sendCompleted]; finished = YES; - OSMemoryBarrier(); + atomic_thread_fence(memory_order_seq_cst); }); }); @@ -122,7 +122,7 @@ [subscriber sendError:nil]; finished = YES; - OSMemoryBarrier(); + atomic_thread_fence(memory_order_seq_cst); }); }); }); diff --git a/ReactiveObjCTests/RACTargetQueueSchedulerSpec.m b/ReactiveObjCTests/RACTargetQueueSchedulerSpec.m index c112bcd4a..6b12c9421 100644 --- a/ReactiveObjCTests/RACTargetQueueSchedulerSpec.m +++ b/ReactiveObjCTests/RACTargetQueueSchedulerSpec.m @@ -10,7 +10,7 @@ @import Nimble; #import "RACTargetQueueScheduler.h" -#import +#import QuickSpecBegin(RACTargetQueueSchedulerSpec) @@ -28,20 +28,20 @@ qck_it(@"should schedule blocks FIFO even when given a concurrent queue", ^{ dispatch_queue_t queue = dispatch_queue_create("test-queue", DISPATCH_QUEUE_CONCURRENT); RACScheduler *scheduler = [[RACTargetQueueScheduler alloc] initWithName:@"test-scheduler" targetQueue:queue]; - __block volatile int32_t startedCount = 0; - __block volatile uint32_t waitInFirst = 1; + __block atomic_int startedCount = 0; + __block atomic_uint waitInFirst = 1; [scheduler schedule:^{ - OSAtomicIncrement32Barrier(&startedCount); + atomic_fetch_add(&startedCount, 1); while (waitInFirst == 1) ; }]; [scheduler schedule:^{ - OSAtomicIncrement32Barrier(&startedCount); + atomic_fetch_add(&startedCount, 1); }]; expect(@(startedCount)).toEventually(equal(@1)); - OSAtomicAnd32Barrier(0, &waitInFirst); + atomic_fetch_and(&waitInFirst, 0); expect(@(startedCount)).toEventually(equal(@2)); }); From 06a445acdb2dc672b99b0aa906303d0907c12fb6 Mon Sep 17 00:00:00 2001 From: vvveiii Date: Tue, 18 Aug 2020 16:25:15 +0800 Subject: [PATCH 02/15] Update travis osx_image: xcode11.6 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index fc992dd89..c79b3f19d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: objective-c -osx_image: xcode10.2 +osx_image: xcode11.6 before_install: true install: true branches: From 5669c8c4649a24eb2cf281e351eac2e3f4f24ee7 Mon Sep 17 00:00:00 2001 From: vvveiii Date: Tue, 18 Aug 2020 17:09:27 +0800 Subject: [PATCH 03/15] Update submodules. --- Cartfile.resolved | 4 ++-- Carthage/Checkouts/Nimble | 2 +- Carthage/Checkouts/Quick | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cartfile.resolved b/Cartfile.resolved index 5d9c1cae2..6deb24ccb 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,3 +1,3 @@ -github "Quick/Nimble" "v8.0.1" -github "Quick/Quick" "v2.0.0" +github "Quick/Nimble" "v8.1.1" +github "Quick/Quick" "v2.2.1" github "jspahrsummers/xcconfigs" "3d9d99634cae6d586e272543d527681283b33eb0" diff --git a/Carthage/Checkouts/Nimble b/Carthage/Checkouts/Nimble index 43304bf2b..2b1809051 160000 --- a/Carthage/Checkouts/Nimble +++ b/Carthage/Checkouts/Nimble @@ -1 +1 @@ -Subproject commit 43304bf2b1579fd555f2fdd51742771c1e4f2b98 +Subproject commit 2b1809051b4a65c1d7f5233331daa24572cd7fca diff --git a/Carthage/Checkouts/Quick b/Carthage/Checkouts/Quick index 0b4ed6c70..09b3becb3 160000 --- a/Carthage/Checkouts/Quick +++ b/Carthage/Checkouts/Quick @@ -1 +1 @@ -Subproject commit 0b4ed6c706dd0cce923b5019a605a9bcc6b1b600 +Subproject commit 09b3becb37cb2163919a3842a4c5fa6ec7130792 From 6db7c5141a694883f553fb56be1836470fbe4178 Mon Sep 17 00:00:00 2001 From: vvveiii Date: Tue, 18 Aug 2020 17:13:28 +0800 Subject: [PATCH 04/15] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c79b3f19d..b48c7e56c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,7 @@ matrix: env: - XCODE_SDK=iphonesimulator - XCODE_ACTION="build-for-testing test-without-building" - - XCODE_DESTINATION="platform=iOS Simulator,name=iPhone 6s" + - XCODE_DESTINATION="platform=iOS Simulator,name=iPhone 11" - xcode_scheme: ReactiveObjC-tvOS env: - XCODE_SDK=appletvsimulator From 2ea1cee783a11405b9e1083a327ff716eb9fb0ac Mon Sep 17 00:00:00 2001 From: vvveiii Date: Tue, 18 Aug 2020 18:11:50 +0800 Subject: [PATCH 05/15] Fix atomic issue in RACDynamicSequence.m. --- ReactiveObjC/RACDynamicSequence.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactiveObjC/RACDynamicSequence.m b/ReactiveObjC/RACDynamicSequence.m index 6269d9af7..863a48f1f 100644 --- a/ReactiveObjC/RACDynamicSequence.m +++ b/ReactiveObjC/RACDynamicSequence.m @@ -116,7 +116,7 @@ + (RACSequence *)sequenceWithLazyDependency:(id (^)(void))dependencyBlock headBl - (void)dealloc { static atomic_int directDeallocCount = 0; - if (atomic_fetch_add(&directDeallocCount, 1) >= DEALLOC_OVERFLOW_GUARD) { + if (atomic_fetch_add(&directDeallocCount, 1) + 1 >= DEALLOC_OVERFLOW_GUARD) { atomic_fetch_add(&directDeallocCount, -DEALLOC_OVERFLOW_GUARD); // Put this sequence's tail onto the autorelease pool so we stop From bac4e6f97c2abf0226c50d46bffb0018396c036a Mon Sep 17 00:00:00 2001 From: vvveiii Date: Tue, 18 Aug 2020 23:34:55 +0800 Subject: [PATCH 06/15] Change framework type to staticlib. --- ReactiveObjC.xcodeproj/project.pbxproj | 28 ++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/ReactiveObjC.xcodeproj/project.pbxproj b/ReactiveObjC.xcodeproj/project.pbxproj index 10ea07b57..6d452d94a 100644 --- a/ReactiveObjC.xcodeproj/project.pbxproj +++ b/ReactiveObjC.xcodeproj/project.pbxproj @@ -2601,6 +2601,7 @@ "DTRACE_PROBES_DISABLED=1", ); INFOPLIST_FILE = ReactiveObjC/Info.plist; + MACH_O_TYPE = staticlib; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; @@ -2620,6 +2621,7 @@ "DTRACE_PROBES_DISABLED=1", ); INFOPLIST_FILE = ReactiveObjC/Info.plist; + MACH_O_TYPE = staticlib; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Test; @@ -2639,6 +2641,7 @@ "DTRACE_PROBES_DISABLED=1", ); INFOPLIST_FILE = ReactiveObjC/Info.plist; + MACH_O_TYPE = staticlib; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Release; @@ -2658,6 +2661,7 @@ "DTRACE_PROBES_DISABLED=1", ); INFOPLIST_FILE = ReactiveObjC/Info.plist; + MACH_O_TYPE = staticlib; }; name = Profile; }; @@ -2673,6 +2677,7 @@ "$(inherited)", ); INFOPLIST_FILE = ReactiveObjCTests/Info.plist; + OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; @@ -2690,6 +2695,7 @@ "$(inherited)", ); INFOPLIST_FILE = ReactiveObjCTests/Info.plist; + OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; @@ -2707,6 +2713,7 @@ "$(inherited)", ); INFOPLIST_FILE = ReactiveObjCTests/Info.plist; + OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; @@ -2724,6 +2731,7 @@ "$(inherited)", ); INFOPLIST_FILE = ReactiveObjCTests/Info.plist; + OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; }; name = Profile; @@ -2743,6 +2751,7 @@ "DTRACE_PROBES_DISABLED=1", ); INFOPLIST_FILE = ReactiveObjC/Info.plist; + MACH_O_TYPE = staticlib; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; @@ -2762,6 +2771,7 @@ "DTRACE_PROBES_DISABLED=1", ); INFOPLIST_FILE = ReactiveObjC/Info.plist; + MACH_O_TYPE = staticlib; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Test; @@ -2781,6 +2791,7 @@ "DTRACE_PROBES_DISABLED=1", ); INFOPLIST_FILE = ReactiveObjC/Info.plist; + MACH_O_TYPE = staticlib; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Release; @@ -2800,6 +2811,7 @@ "DTRACE_PROBES_DISABLED=1", ); INFOPLIST_FILE = ReactiveObjC/Info.plist; + MACH_O_TYPE = staticlib; }; name = Profile; }; @@ -2873,6 +2885,7 @@ DYLIB_CURRENT_VERSION = 1; FRAMEWORK_VERSION = A; INFOPLIST_FILE = ReactiveObjC/Info.plist; + MACH_O_TYPE = staticlib; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; USER_HEADER_SEARCH_PATHS = ReactiveObjC/extobjc; }; @@ -2889,6 +2902,7 @@ DYLIB_CURRENT_VERSION = 1; FRAMEWORK_VERSION = A; INFOPLIST_FILE = ReactiveObjC/Info.plist; + MACH_O_TYPE = staticlib; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; USER_HEADER_SEARCH_PATHS = ReactiveObjC/extobjc; }; @@ -2906,6 +2920,7 @@ ); INFOPLIST_FILE = ReactiveObjCTests/Info.plist; MACOSX_DEPLOYMENT_TARGET = 10.10; + OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; @@ -2923,6 +2938,7 @@ ); INFOPLIST_FILE = ReactiveObjCTests/Info.plist; MACOSX_DEPLOYMENT_TARGET = 10.10; + OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; @@ -2939,6 +2955,7 @@ DYLIB_CURRENT_VERSION = 1; ENABLE_BITCODE = YES; INFOPLIST_FILE = ReactiveObjC/Info.plist; + MACH_O_TYPE = staticlib; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; USER_HEADER_SEARCH_PATHS = ReactiveObjC/extobjc; }; @@ -2955,6 +2972,7 @@ DYLIB_CURRENT_VERSION = 1; ENABLE_BITCODE = YES; INFOPLIST_FILE = ReactiveObjC/Info.plist; + MACH_O_TYPE = staticlib; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; USER_HEADER_SEARCH_PATHS = ReactiveObjC/extobjc; }; @@ -2967,6 +2985,7 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CLANG_ENABLE_MODULES = YES; INFOPLIST_FILE = ReactiveObjCTests/Info.plist; + OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; @@ -2979,6 +2998,7 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CLANG_ENABLE_MODULES = YES; INFOPLIST_FILE = ReactiveObjCTests/Info.plist; + OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; @@ -3023,6 +3043,7 @@ DYLIB_CURRENT_VERSION = 1; FRAMEWORK_VERSION = A; INFOPLIST_FILE = ReactiveObjC/Info.plist; + MACH_O_TYPE = staticlib; USER_HEADER_SEARCH_PATHS = ReactiveObjC/extobjc; }; name = Profile; @@ -3039,6 +3060,7 @@ ); INFOPLIST_FILE = ReactiveObjCTests/Info.plist; MACOSX_DEPLOYMENT_TARGET = 10.10; + OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; }; name = Profile; @@ -3054,6 +3076,7 @@ DYLIB_CURRENT_VERSION = 1; ENABLE_BITCODE = YES; INFOPLIST_FILE = ReactiveObjC/Info.plist; + MACH_O_TYPE = staticlib; USER_HEADER_SEARCH_PATHS = ReactiveObjC/extobjc; }; name = Profile; @@ -3065,6 +3088,7 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CLANG_ENABLE_MODULES = YES; INFOPLIST_FILE = ReactiveObjCTests/Info.plist; + OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; }; name = Profile; @@ -3108,6 +3132,7 @@ DYLIB_CURRENT_VERSION = 1; FRAMEWORK_VERSION = A; INFOPLIST_FILE = ReactiveObjC/Info.plist; + MACH_O_TYPE = staticlib; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; USER_HEADER_SEARCH_PATHS = ReactiveObjC/extobjc; }; @@ -3125,6 +3150,7 @@ ); INFOPLIST_FILE = ReactiveObjCTests/Info.plist; MACOSX_DEPLOYMENT_TARGET = 10.10; + OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; @@ -3141,6 +3167,7 @@ DYLIB_CURRENT_VERSION = 1; ENABLE_BITCODE = YES; INFOPLIST_FILE = ReactiveObjC/Info.plist; + MACH_O_TYPE = staticlib; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; USER_HEADER_SEARCH_PATHS = ReactiveObjC/extobjc; }; @@ -3153,6 +3180,7 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CLANG_ENABLE_MODULES = YES; INFOPLIST_FILE = ReactiveObjCTests/Info.plist; + OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; From a0102b11a3f68576aa9344619f078620882f59d0 Mon Sep 17 00:00:00 2001 From: vvveiii Date: Tue, 18 Aug 2020 23:55:52 +0800 Subject: [PATCH 07/15] Update travis.yml - build branches: master & main --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index b48c7e56c..8d775d4d3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ install: true branches: only: - master + - main script: - script/build xcode_workspace: ReactiveObjC.xcworkspace From 3d00c76ac9bfc6de0148adc227319fb29364bb09 Mon Sep 17 00:00:00 2001 From: vvveiii Date: Wed, 19 Aug 2020 10:46:18 +0800 Subject: [PATCH 08/15] Add build status in ReadMe --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ab43c42af..cf6ee8428 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # ReactiveObjC +[![Build Status](https://travis-ci.org/ReactiveCocoa/ReactiveObjC.svg?branch=master)](https://travis-ci.org/ReactiveCocoa/ReactiveObjC) _NOTE: This is legacy introduction to the Objective-C ReactiveCocoa, which is now known as ReactiveObjC. For the updated version that uses Swift, please see From 8f8ae5282f02d288690750e0a10611822fdb0041 Mon Sep 17 00:00:00 2001 From: vvveiii Date: Wed, 19 Aug 2020 15:06:13 +0800 Subject: [PATCH 09/15] Update *OS_VERSION_MIN_REQUIRED - iOS 9.0 - tvOS 9.0 - macOS 11.11 --- ReactiveObjC.xcodeproj/project.pbxproj | 20 ++++++++----------- ReactiveObjC/NSURLConnection+RACSupport.h | 3 +++ ReactiveObjC/NSURLConnection+RACSupport.m | 3 +++ ReactiveObjC/UIActionSheet+RACSignalSupport.h | 3 +++ ReactiveObjC/UIActionSheet+RACSignalSupport.m | 3 +++ ReactiveObjC/UIAlertView+RACSignalSupport.h | 3 +++ ReactiveObjC/UIAlertView+RACSignalSupport.m | 3 +++ .../NSURLConnectionRACSupportSpec.m | 3 +++ .../UIActionSheetRACSupportSpec.m | 3 +++ ReactiveObjCTests/UIAlertViewRACSupportSpec.m | 3 +++ 10 files changed, 35 insertions(+), 12 deletions(-) diff --git a/ReactiveObjC.xcodeproj/project.pbxproj b/ReactiveObjC.xcodeproj/project.pbxproj index 6d452d94a..8a1cf96c0 100644 --- a/ReactiveObjC.xcodeproj/project.pbxproj +++ b/ReactiveObjC.xcodeproj/project.pbxproj @@ -2828,8 +2828,8 @@ CODE_SIGNING_REQUIRED = NO; CURRENT_PROJECT_VERSION = 1; ENABLE_TESTABILITY = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MACOSX_DEPLOYMENT_TARGET = 10.9; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MACOSX_DEPLOYMENT_TARGET = 10.11; PRODUCT_BUNDLE_IDENTIFIER = "org.reactivecocoa.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(PROJECT_NAME)"; SWIFT_VERSION = 5.0; @@ -2857,8 +2857,8 @@ CODE_SIGNING_REQUIRED = NO; CURRENT_PROJECT_VERSION = 1; GCC_OPTIMIZATION_LEVEL = 0; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MACOSX_DEPLOYMENT_TARGET = 10.9; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MACOSX_DEPLOYMENT_TARGET = 10.11; PRODUCT_BUNDLE_IDENTIFIER = "org.reactivecocoa.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(PROJECT_NAME)"; SWIFT_COMPILATION_MODE = wholemodule; @@ -2919,7 +2919,6 @@ "$(inherited)", ); INFOPLIST_FILE = ReactiveObjCTests/Info.plist; - MACOSX_DEPLOYMENT_TARGET = 10.10; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -2937,7 +2936,6 @@ "$(inherited)", ); INFOPLIST_FILE = ReactiveObjCTests/Info.plist; - MACOSX_DEPLOYMENT_TARGET = 10.10; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -3016,8 +3014,8 @@ CLANG_WARN_STRICT_PROTOTYPES = YES; CODE_SIGNING_REQUIRED = NO; CURRENT_PROJECT_VERSION = 1; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MACOSX_DEPLOYMENT_TARGET = 10.9; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MACOSX_DEPLOYMENT_TARGET = 10.11; PRODUCT_BUNDLE_IDENTIFIER = "org.reactivecocoa.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(PROJECT_NAME)"; SWIFT_VERSION = 5.0; @@ -3059,7 +3057,6 @@ "$(inherited)", ); INFOPLIST_FILE = ReactiveObjCTests/Info.plist; - MACOSX_DEPLOYMENT_TARGET = 10.10; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; }; @@ -3105,8 +3102,8 @@ CLANG_WARN_STRICT_PROTOTYPES = YES; CODE_SIGNING_REQUIRED = NO; CURRENT_PROJECT_VERSION = 1; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MACOSX_DEPLOYMENT_TARGET = 10.10; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MACOSX_DEPLOYMENT_TARGET = 10.11; PRODUCT_BUNDLE_IDENTIFIER = "org.reactivecocoa.$(PRODUCT_NAME:rfc1034identifier)-Tests"; PRODUCT_NAME = "$(PROJECT_NAME)"; SWIFT_VERSION = 5.0; @@ -3149,7 +3146,6 @@ "$(inherited)", ); INFOPLIST_FILE = ReactiveObjCTests/Info.plist; - MACOSX_DEPLOYMENT_TARGET = 10.10; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; diff --git a/ReactiveObjC/NSURLConnection+RACSupport.h b/ReactiveObjC/NSURLConnection+RACSupport.h index c1c5731d7..fd81492d3 100644 --- a/ReactiveObjC/NSURLConnection+RACSupport.h +++ b/ReactiveObjC/NSURLConnection+RACSupport.h @@ -5,6 +5,7 @@ // Created by Justin Spahr-Summers on 2013-10-01. // Copyright (c) 2013 GitHub, Inc. All rights reserved. // +#if __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_11 || __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_9_0 || __TVOS_VERSION_MIN_REQUIRED < __TVOS_9_0 #import @@ -28,3 +29,5 @@ NS_ASSUME_NONNULL_BEGIN @end NS_ASSUME_NONNULL_END + +#endif diff --git a/ReactiveObjC/NSURLConnection+RACSupport.m b/ReactiveObjC/NSURLConnection+RACSupport.m index 7acd322ae..dd6c025b6 100644 --- a/ReactiveObjC/NSURLConnection+RACSupport.m +++ b/ReactiveObjC/NSURLConnection+RACSupport.m @@ -5,6 +5,7 @@ // Created by Justin Spahr-Summers on 2013-10-01. // Copyright (c) 2013 GitHub, Inc. All rights reserved. // +#if __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_11 || __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_9_0 || __TVOS_VERSION_MIN_REQUIRED < __TVOS_9_0 #import "NSURLConnection+RACSupport.h" #import "RACDisposable.h" @@ -52,3 +53,5 @@ + (RACSignal *)rac_sendAsynchronousRequest:(NSURLRequest *)request { } @end + +#endif diff --git a/ReactiveObjC/UIActionSheet+RACSignalSupport.h b/ReactiveObjC/UIActionSheet+RACSignalSupport.h index 8308bbd54..717326977 100644 --- a/ReactiveObjC/UIActionSheet+RACSignalSupport.h +++ b/ReactiveObjC/UIActionSheet+RACSignalSupport.h @@ -5,6 +5,7 @@ // Created by Dave Lee on 2013-06-22. // Copyright (c) 2013 GitHub, Inc. All rights reserved. // +#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_9_0 #import @@ -34,3 +35,5 @@ NS_ASSUME_NONNULL_BEGIN @end NS_ASSUME_NONNULL_END + +#endif diff --git a/ReactiveObjC/UIActionSheet+RACSignalSupport.m b/ReactiveObjC/UIActionSheet+RACSignalSupport.m index 6a1a4102d..7f95ecd6e 100644 --- a/ReactiveObjC/UIActionSheet+RACSignalSupport.m +++ b/ReactiveObjC/UIActionSheet+RACSignalSupport.m @@ -5,6 +5,7 @@ // Created by Dave Lee on 2013-06-22. // Copyright (c) 2013 GitHub, Inc. All rights reserved. // +#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_9_0 #import "UIActionSheet+RACSignalSupport.h" #import "RACDelegateProxy.h" @@ -47,3 +48,5 @@ - (RACSignal *)rac_buttonClickedSignal { } @end + +#endif diff --git a/ReactiveObjC/UIAlertView+RACSignalSupport.h b/ReactiveObjC/UIAlertView+RACSignalSupport.h index 7508c2e4b..e6a41f89a 100644 --- a/ReactiveObjC/UIAlertView+RACSignalSupport.h +++ b/ReactiveObjC/UIAlertView+RACSignalSupport.h @@ -5,6 +5,7 @@ // Created by Henrik Hodne on 6/16/13. // Copyright (c) 2013 GitHub, Inc. All rights reserved. // +#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_9_0 #import @@ -49,3 +50,5 @@ NS_ASSUME_NONNULL_BEGIN @end NS_ASSUME_NONNULL_END + +#endif diff --git a/ReactiveObjC/UIAlertView+RACSignalSupport.m b/ReactiveObjC/UIAlertView+RACSignalSupport.m index 0afc94a8d..4f540b3d2 100644 --- a/ReactiveObjC/UIAlertView+RACSignalSupport.m +++ b/ReactiveObjC/UIAlertView+RACSignalSupport.m @@ -5,6 +5,7 @@ // Created by Henrik Hodne on 6/16/13. // Copyright (c) 2013 GitHub, Inc. All rights reserved. // +#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_9_0 #import "UIAlertView+RACSignalSupport.h" #import "RACDelegateProxy.h" @@ -61,3 +62,5 @@ - (RACSignal *)rac_willDismissSignal { } @end + +#endif diff --git a/ReactiveObjCTests/NSURLConnectionRACSupportSpec.m b/ReactiveObjCTests/NSURLConnectionRACSupportSpec.m index 84de95c92..ccd292d2d 100644 --- a/ReactiveObjCTests/NSURLConnectionRACSupportSpec.m +++ b/ReactiveObjCTests/NSURLConnectionRACSupportSpec.m @@ -5,6 +5,7 @@ // Created by Justin Spahr-Summers on 2013-10-01. // Copyright (c) 2013 GitHub, Inc. All rights reserved. // +#if __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_11 || __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_9_0 || __TVOS_VERSION_MIN_REQUIRED < __TVOS_9_0 @import Quick; @import Nimble; @@ -37,3 +38,5 @@ }); QuickSpecEnd + +#endif diff --git a/ReactiveObjCTests/UIActionSheetRACSupportSpec.m b/ReactiveObjCTests/UIActionSheetRACSupportSpec.m index d8a32b3f7..a1bcfba43 100644 --- a/ReactiveObjCTests/UIActionSheetRACSupportSpec.m +++ b/ReactiveObjCTests/UIActionSheetRACSupportSpec.m @@ -5,6 +5,7 @@ // Created by Dave Lee on 2013-06-22. // Copyright (c) 2013 GitHub, Inc. All rights reserved. // +#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_9_0 @import Quick; @import Nimble; @@ -37,3 +38,5 @@ }); QuickSpecEnd + +#endif diff --git a/ReactiveObjCTests/UIAlertViewRACSupportSpec.m b/ReactiveObjCTests/UIAlertViewRACSupportSpec.m index 6321094aa..fa77a49cf 100644 --- a/ReactiveObjCTests/UIAlertViewRACSupportSpec.m +++ b/ReactiveObjCTests/UIAlertViewRACSupportSpec.m @@ -5,6 +5,7 @@ // Created by Henrik Hodne on 6/16/13. // Copyright (c) 2013 GitHub, Inc. All rights reserved. // +#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_9_0 @import Quick; @import Nimble; @@ -45,3 +46,5 @@ }); QuickSpecEnd + +#endif From 2a09ff17735a7ec6cb8bf3ed69a6ecfb00594dcd Mon Sep 17 00:00:00 2001 From: vvveiii Date: Wed, 19 Aug 2020 16:42:47 +0800 Subject: [PATCH 10/15] Disable CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER --- ReactiveObjC.xcodeproj/project.pbxproj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ReactiveObjC.xcodeproj/project.pbxproj b/ReactiveObjC.xcodeproj/project.pbxproj index 8a1cf96c0..7a0baeaad 100644 --- a/ReactiveObjC.xcodeproj/project.pbxproj +++ b/ReactiveObjC.xcodeproj/project.pbxproj @@ -2823,6 +2823,7 @@ CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_COMMA = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CODE_SIGNING_REQUIRED = NO; @@ -2852,6 +2853,7 @@ CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_COMMA = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CODE_SIGNING_REQUIRED = NO; @@ -3010,6 +3012,7 @@ CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_COMMA = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CODE_SIGNING_REQUIRED = NO; @@ -3098,6 +3101,7 @@ CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_COMMA = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CODE_SIGNING_REQUIRED = NO; From 5cba801e0a0038e59f92b2551af336ce915abd27 Mon Sep 17 00:00:00 2001 From: vvveiii Date: Wed, 19 Aug 2020 20:44:51 +0800 Subject: [PATCH 11/15] Update build settings - GCC_C_LANGUAGE_STANDARD = gnu11 - COMPILER_INDEX_STORE_ENABLE = YES - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14" - CLANG_CXX_LIBRARY = "libc++" --- ReactiveObjC.xcodeproj/project.pbxproj | 43 +++++++++++++------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/ReactiveObjC.xcodeproj/project.pbxproj b/ReactiveObjC.xcodeproj/project.pbxproj index 7a0baeaad..fe308e09b 100644 --- a/ReactiveObjC.xcodeproj/project.pbxproj +++ b/ReactiveObjC.xcodeproj/project.pbxproj @@ -2602,7 +2602,6 @@ ); INFOPLIST_FILE = ReactiveObjC/Info.plist; MACH_O_TYPE = staticlib; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; }; @@ -2622,7 +2621,6 @@ ); INFOPLIST_FILE = ReactiveObjC/Info.plist; MACH_O_TYPE = staticlib; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Test; }; @@ -2642,7 +2640,6 @@ ); INFOPLIST_FILE = ReactiveObjC/Info.plist; MACH_O_TYPE = staticlib; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Release; }; @@ -2679,7 +2676,6 @@ INFOPLIST_FILE = ReactiveObjCTests/Info.plist; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; }; @@ -2697,7 +2693,6 @@ INFOPLIST_FILE = ReactiveObjCTests/Info.plist; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Test; }; @@ -2715,7 +2710,6 @@ INFOPLIST_FILE = ReactiveObjCTests/Info.plist; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Release; }; @@ -2752,7 +2746,6 @@ ); INFOPLIST_FILE = ReactiveObjC/Info.plist; MACH_O_TYPE = staticlib; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; }; @@ -2772,7 +2765,6 @@ ); INFOPLIST_FILE = ReactiveObjC/Info.plist; MACH_O_TYPE = staticlib; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Test; }; @@ -2792,7 +2784,6 @@ ); INFOPLIST_FILE = ReactiveObjC/Info.plist; MACH_O_TYPE = staticlib; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Release; }; @@ -2821,14 +2812,19 @@ buildSettings = { BITCODE_GENERATION_MODE = bitcode; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CODE_SIGNING_REQUIRED = NO; + COMPILER_INDEX_STORE_ENABLE = YES; CURRENT_PROJECT_VERSION = 1; + ENABLE_BITCODE = YES; ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; IPHONEOS_DEPLOYMENT_TARGET = 9.0; MACOSX_DEPLOYMENT_TARGET = 10.11; PRODUCT_BUNDLE_IDENTIFIER = "org.reactivecocoa.$(PRODUCT_NAME:rfc1034identifier)"; @@ -2851,14 +2847,18 @@ buildSettings = { BITCODE_GENERATION_MODE = bitcode; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CODE_SIGNING_REQUIRED = NO; + COMPILER_INDEX_STORE_ENABLE = YES; CURRENT_PROJECT_VERSION = 1; - GCC_OPTIMIZATION_LEVEL = 0; + ENABLE_BITCODE = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; IPHONEOS_DEPLOYMENT_TARGET = 9.0; MACOSX_DEPLOYMENT_TARGET = 10.11; PRODUCT_BUNDLE_IDENTIFIER = "org.reactivecocoa.$(PRODUCT_NAME:rfc1034identifier)"; @@ -2888,7 +2888,6 @@ FRAMEWORK_VERSION = A; INFOPLIST_FILE = ReactiveObjC/Info.plist; MACH_O_TYPE = staticlib; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; USER_HEADER_SEARCH_PATHS = ReactiveObjC/extobjc; }; name = Debug; @@ -2905,7 +2904,6 @@ FRAMEWORK_VERSION = A; INFOPLIST_FILE = ReactiveObjC/Info.plist; MACH_O_TYPE = staticlib; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; USER_HEADER_SEARCH_PATHS = ReactiveObjC/extobjc; }; name = Release; @@ -2923,7 +2921,6 @@ INFOPLIST_FILE = ReactiveObjCTests/Info.plist; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; }; @@ -2940,7 +2937,6 @@ INFOPLIST_FILE = ReactiveObjCTests/Info.plist; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Release; }; @@ -2956,7 +2952,6 @@ ENABLE_BITCODE = YES; INFOPLIST_FILE = ReactiveObjC/Info.plist; MACH_O_TYPE = staticlib; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; USER_HEADER_SEARCH_PATHS = ReactiveObjC/extobjc; }; name = Debug; @@ -2973,7 +2968,6 @@ ENABLE_BITCODE = YES; INFOPLIST_FILE = ReactiveObjC/Info.plist; MACH_O_TYPE = staticlib; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; USER_HEADER_SEARCH_PATHS = ReactiveObjC/extobjc; }; name = Release; @@ -2987,7 +2981,6 @@ INFOPLIST_FILE = ReactiveObjCTests/Info.plist; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; }; @@ -3000,7 +2993,6 @@ INFOPLIST_FILE = ReactiveObjCTests/Info.plist; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Release; }; @@ -3010,13 +3002,18 @@ buildSettings = { BITCODE_GENERATION_MODE = bitcode; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CODE_SIGNING_REQUIRED = NO; + COMPILER_INDEX_STORE_ENABLE = YES; CURRENT_PROJECT_VERSION = 1; + ENABLE_BITCODE = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; IPHONEOS_DEPLOYMENT_TARGET = 9.0; MACOSX_DEPLOYMENT_TARGET = 10.11; PRODUCT_BUNDLE_IDENTIFIER = "org.reactivecocoa.$(PRODUCT_NAME:rfc1034identifier)"; @@ -3099,13 +3096,19 @@ buildSettings = { BITCODE_GENERATION_MODE = bitcode; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CODE_SIGNING_REQUIRED = NO; + COMPILER_INDEX_STORE_ENABLE = YES; CURRENT_PROJECT_VERSION = 1; + ENABLE_BITCODE = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; IPHONEOS_DEPLOYMENT_TARGET = 9.0; MACOSX_DEPLOYMENT_TARGET = 10.11; PRODUCT_BUNDLE_IDENTIFIER = "org.reactivecocoa.$(PRODUCT_NAME:rfc1034identifier)-Tests"; @@ -3134,7 +3137,6 @@ FRAMEWORK_VERSION = A; INFOPLIST_FILE = ReactiveObjC/Info.plist; MACH_O_TYPE = staticlib; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; USER_HEADER_SEARCH_PATHS = ReactiveObjC/extobjc; }; name = Test; @@ -3152,7 +3154,6 @@ INFOPLIST_FILE = ReactiveObjCTests/Info.plist; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Test; }; @@ -3168,7 +3169,6 @@ ENABLE_BITCODE = YES; INFOPLIST_FILE = ReactiveObjC/Info.plist; MACH_O_TYPE = staticlib; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; USER_HEADER_SEARCH_PATHS = ReactiveObjC/extobjc; }; name = Test; @@ -3182,7 +3182,6 @@ INFOPLIST_FILE = ReactiveObjCTests/Info.plist; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(PROJECT_NAME)Tests"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Test; }; From 6c8392c34b1eaecb995ec51f772764aa23bf84b0 Mon Sep 17 00:00:00 2001 From: vvveiii Date: Wed, 19 Aug 2020 21:36:27 +0800 Subject: [PATCH 12/15] Update travis.yml --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8d775d4d3..67e2f236b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,4 @@ +os: osx language: objective-c osx_image: xcode11.6 before_install: true @@ -9,7 +10,7 @@ branches: script: - script/build xcode_workspace: ReactiveObjC.xcworkspace -matrix: +jobs: include: - xcode_scheme: ReactiveObjC-macOS env: From 69c4c346b6fc61d9cab6dfe7bb014b778e607826 Mon Sep 17 00:00:00 2001 From: vvveiii Date: Wed, 19 Aug 2020 21:59:46 +0800 Subject: [PATCH 13/15] Update bitcode build settings --- ReactiveObjC.xcodeproj/project.pbxproj | 8 -------- 1 file changed, 8 deletions(-) diff --git a/ReactiveObjC.xcodeproj/project.pbxproj b/ReactiveObjC.xcodeproj/project.pbxproj index fe308e09b..0e569ca1d 100644 --- a/ReactiveObjC.xcodeproj/project.pbxproj +++ b/ReactiveObjC.xcodeproj/project.pbxproj @@ -2822,7 +2822,6 @@ CODE_SIGNING_REQUIRED = NO; COMPILER_INDEX_STORE_ENABLE = YES; CURRENT_PROJECT_VERSION = 1; - ENABLE_BITCODE = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu11; IPHONEOS_DEPLOYMENT_TARGET = 9.0; @@ -2857,7 +2856,6 @@ CODE_SIGNING_REQUIRED = NO; COMPILER_INDEX_STORE_ENABLE = YES; CURRENT_PROJECT_VERSION = 1; - ENABLE_BITCODE = YES; GCC_C_LANGUAGE_STANDARD = gnu11; IPHONEOS_DEPLOYMENT_TARGET = 9.0; MACOSX_DEPLOYMENT_TARGET = 10.11; @@ -2949,7 +2947,6 @@ DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; - ENABLE_BITCODE = YES; INFOPLIST_FILE = ReactiveObjC/Info.plist; MACH_O_TYPE = staticlib; USER_HEADER_SEARCH_PATHS = ReactiveObjC/extobjc; @@ -2965,7 +2962,6 @@ DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; - ENABLE_BITCODE = YES; INFOPLIST_FILE = ReactiveObjC/Info.plist; MACH_O_TYPE = staticlib; USER_HEADER_SEARCH_PATHS = ReactiveObjC/extobjc; @@ -3012,7 +3008,6 @@ CODE_SIGNING_REQUIRED = NO; COMPILER_INDEX_STORE_ENABLE = YES; CURRENT_PROJECT_VERSION = 1; - ENABLE_BITCODE = YES; GCC_C_LANGUAGE_STANDARD = gnu11; IPHONEOS_DEPLOYMENT_TARGET = 9.0; MACOSX_DEPLOYMENT_TARGET = 10.11; @@ -3071,7 +3066,6 @@ DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; - ENABLE_BITCODE = YES; INFOPLIST_FILE = ReactiveObjC/Info.plist; MACH_O_TYPE = staticlib; USER_HEADER_SEARCH_PATHS = ReactiveObjC/extobjc; @@ -3106,7 +3100,6 @@ CODE_SIGNING_REQUIRED = NO; COMPILER_INDEX_STORE_ENABLE = YES; CURRENT_PROJECT_VERSION = 1; - ENABLE_BITCODE = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu11; IPHONEOS_DEPLOYMENT_TARGET = 9.0; @@ -3166,7 +3159,6 @@ DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; - ENABLE_BITCODE = YES; INFOPLIST_FILE = ReactiveObjC/Info.plist; MACH_O_TYPE = staticlib; USER_HEADER_SEARCH_PATHS = ReactiveObjC/extobjc; From 85577b0e4acc7345521b572900dbd99825f6b533 Mon Sep 17 00:00:00 2001 From: vvveiii Date: Wed, 19 Aug 2020 23:03:42 +0800 Subject: [PATCH 14/15] Update RACKVOWrapperSpec.m --- ReactiveObjCTests/RACKVOWrapperSpec.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ReactiveObjCTests/RACKVOWrapperSpec.m b/ReactiveObjCTests/RACKVOWrapperSpec.m index 71197d672..705d983fd 100644 --- a/ReactiveObjCTests/RACKVOWrapperSpec.m +++ b/ReactiveObjCTests/RACKVOWrapperSpec.m @@ -571,6 +571,8 @@ + (void)configure:(Configuration *)configuration { __weak id identifier = nil; @autoreleasepool { + expect(targetClass).notTo(beNil()); + // Create an observable target that we control the memory management of. CFTypeRef target = CFBridgingRetain([[targetClass alloc] init]); expect((__bridge id)target).notTo(beNil()); From 93303257e95f153f773a1e6c59bdf0a180db1de5 Mon Sep 17 00:00:00 2001 From: vvveiii Date: Wed, 19 Aug 2020 23:23:36 +0800 Subject: [PATCH 15/15] DEBUG_INFORMATION_FORMAT = dwarf --- ReactiveObjC.xcodeproj/project.pbxproj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ReactiveObjC.xcodeproj/project.pbxproj b/ReactiveObjC.xcodeproj/project.pbxproj index 0e569ca1d..436cf834b 100644 --- a/ReactiveObjC.xcodeproj/project.pbxproj +++ b/ReactiveObjC.xcodeproj/project.pbxproj @@ -2822,6 +2822,7 @@ CODE_SIGNING_REQUIRED = NO; COMPILER_INDEX_STORE_ENABLE = YES; CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu11; IPHONEOS_DEPLOYMENT_TARGET = 9.0; @@ -2856,6 +2857,7 @@ CODE_SIGNING_REQUIRED = NO; COMPILER_INDEX_STORE_ENABLE = YES; CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; GCC_C_LANGUAGE_STANDARD = gnu11; IPHONEOS_DEPLOYMENT_TARGET = 9.0; MACOSX_DEPLOYMENT_TARGET = 10.11; @@ -3008,6 +3010,7 @@ CODE_SIGNING_REQUIRED = NO; COMPILER_INDEX_STORE_ENABLE = YES; CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; GCC_C_LANGUAGE_STANDARD = gnu11; IPHONEOS_DEPLOYMENT_TARGET = 9.0; MACOSX_DEPLOYMENT_TARGET = 10.11; @@ -3100,6 +3103,7 @@ CODE_SIGNING_REQUIRED = NO; COMPILER_INDEX_STORE_ENABLE = YES; CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu11; IPHONEOS_DEPLOYMENT_TARGET = 9.0;