diff options
author | Mathew Huusko V <mhuusko5@gmail.com> | 2017-06-02 18:42:17 +0100 |
---|---|---|
committer | Paul Beusterien <paulbeusterien@google.com> | 2017-06-02 10:42:17 -0700 |
commit | 5c59342e6e19989c012877362af529b3d5d0abeb (patch) | |
tree | 457f5da7c41ee45b8d3f55f83017fff2ab718781 /Firebase/Database | |
parent | 6f700dd6c81711a8605c2587b4f2acfd4e07466b (diff) |
macOS (#38)
* Example/Core: create macOS app/tests target
* Example/Core: Core_Example/Tests -> Core_Example/Tests_iOS
* Example/Core: macOS building/tests passing
* Example/Database: separate iOS/macOS targets
* BuildFrameworks: macOS
* .travis.yml, test.sh: AllUnitTests -> AllUnitTests_iOS
* test.sh: add AllUnitTests_macOS
* Example/Storage: Example/Tests->_iOS
* Example/Storage: macOS
* test.sh: try to prevent double error 65
* test.sh: build before test
* Example/Auth|Messaging: -> _iOS
* Example/Auth: macOS build
* Example/Auth: macOS passing
* Example/Firebase: pod de/re-integrate; fix static DerivedData references; copy phase for OCMock
* Example/Firebase: manually copied OCMock, Products Dir vs. Frameworks
* Example/Firebase: copied OCMock, prevent header removal
* Example/Storage: integration tests sdk fix
* Example/Auth: macOS exclude FIRAuthAppCredentialManager; cleanup
* Firebase/Core: remove nullability annotation
* Firebase/Core|Database: correct TARGET_X usage for correctness and anticipation of OS_WATCH|TV branches
* build.swift: style fix
* Firebase/Core: FIRLogger: fix macOS intermittent va_list error
Diffstat (limited to 'Firebase/Database')
-rw-r--r-- | Firebase/Database/Core/FPersistentConnection.m | 6 | ||||
-rw-r--r-- | Firebase/Database/Core/FRepo.m | 6 | ||||
-rw-r--r-- | Firebase/Database/FirebaseDatabase.podspec | 1 | ||||
-rw-r--r-- | Firebase/Database/Persistence/FLevelDBStorageEngine.m | 6 | ||||
-rw-r--r-- | Firebase/Database/Realtime/FWebSocketConnection.m | 4 | ||||
-rw-r--r-- | Firebase/Database/third_party/SocketRocket/FSRWebSocket.m | 6 |
6 files changed, 15 insertions, 14 deletions
diff --git a/Firebase/Database/Core/FPersistentConnection.m b/Firebase/Database/Core/FPersistentConnection.m index 0eb1f9f..9298f6d 100644 --- a/Firebase/Database/Core/FPersistentConnection.m +++ b/Firebase/Database/Core/FPersistentConnection.m @@ -922,15 +922,15 @@ static void reachabilityCallback(SCNetworkReachabilityRef ref, SCNetworkReachabi - (void) sendConnectStats { NSMutableDictionary *stats = [NSMutableDictionary dictionary]; -#if TARGET_OS_IPHONE + #if TARGET_OS_IOS if (self.config.persistenceEnabled) { stats[@"persistence.ios.enabled"] = @1; } -#else // this must be OSX then + #elif TARGET_OS_OSX if (self.config.persistenceEnabled) { stats[@"persistence.osx.enabled"] = @1; } -#endif + #endif NSString *sdkVersion = [[FIRDatabase sdkVersion] stringByReplacingOccurrencesOfString:@"." withString:@"-"]; NSString *sdkStatName = [NSString stringWithFormat:@"sdk.objc.%@", sdkVersion]; stats[sdkStatName] = @1; diff --git a/Firebase/Database/Core/FRepo.m b/Firebase/Database/Core/FRepo.m index 06cc253..f04d0f1 100644 --- a/Firebase/Database/Core/FRepo.m +++ b/Firebase/Database/Core/FRepo.m @@ -50,7 +50,7 @@ #import "FValueEventRegistration.h" #import "FEmptyNode.h" -#ifdef TARGET_OS_IPHONE +#if TARGET_OS_IOS #import <UIKit/UIKit.h> #endif @@ -543,7 +543,7 @@ return; // Targetted compilation is ONLY for testing. UIKit is weak-linked in actual release build. -#if TARGET_OS_IPHONE + #if TARGET_OS_IOS // The idea is to wait until any outstanding sets get written to disk. Since the sets might still be in our // dispatch queue, we wait for the dispatch queue to catch up and for persistence to catch up. // This may be undesirable though. The dispatch queue might just be processing a bunch of incoming data or @@ -563,7 +563,7 @@ FFLog(@"I-RDB038018", @"Background task completed. Queue time: %f", finishTime); [application endBackgroundTask:bgTask]; }); -#endif + #endif } #pragma mark - diff --git a/Firebase/Database/FirebaseDatabase.podspec b/Firebase/Database/FirebaseDatabase.podspec index 4db371e..6c966ce 100644 --- a/Firebase/Database/FirebaseDatabase.podspec +++ b/Firebase/Database/FirebaseDatabase.podspec @@ -20,6 +20,7 @@ Simplify your iOS development, grow your user base, and monetize more effectivel s.source = { :git => 'https://github.com/firebase/firebase-ios-sdk.git', :tag => s.version.to_s } s.social_media_url = 'https://twitter.com/Firebase' s.ios.deployment_target = '7.0' + s.osx.deployment_target = '10.10' s.source_files = '**/*.[mh]', 'third_party/Wrap-leveldb/APLevelDB.mm', diff --git a/Firebase/Database/Persistence/FLevelDBStorageEngine.m b/Firebase/Database/Persistence/FLevelDBStorageEngine.m index 4b324b8..e887c08 100644 --- a/Firebase/Database/Persistence/FLevelDBStorageEngine.m +++ b/Firebase/Database/Persistence/FLevelDBStorageEngine.m @@ -204,13 +204,13 @@ static NSString* trackedQueryKeysKey(NSUInteger trackedQueryId, NSString *key) { } + (NSString *) firebaseDir { -#if TARGET_OS_IPHONE + #if TARGET_OS_IOS NSArray *dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDir = [dirPaths objectAtIndex:0]; return [documentsDir stringByAppendingPathComponent:@"firebase"]; -#else // this must be OSX then + #elif TARGET_OS_OSX return [NSHomeDirectory() stringByAppendingPathComponent:@".firebase"]; -#endif + #endif } - (APLevelDB *)createDB:(NSString *)name { diff --git a/Firebase/Database/Realtime/FWebSocketConnection.m b/Firebase/Database/Realtime/FWebSocketConnection.m index 52e2296..ea64795 100644 --- a/Firebase/Database/Realtime/FWebSocketConnection.m +++ b/Firebase/Database/Realtime/FWebSocketConnection.m @@ -22,7 +22,7 @@ #import "FStringUtilities.h" #import "FIRDatabase_Private.h" -#if TARGET_OS_IPHONE +#if TARGET_OS_IOS #import <UIKit/UIKit.h> #endif @@ -82,7 +82,7 @@ BOOL hasUiDeviceClass = NO; // Targetted compilation is ONLY for testing. UIKit is weak-linked in actual release build. - #if TARGET_OS_IPHONE + #if TARGET_OS_IOS Class uiDeviceClass = NSClassFromString(@"UIDevice"); if (uiDeviceClass) { systemVersion = [uiDeviceClass currentDevice].systemVersion; diff --git a/Firebase/Database/third_party/SocketRocket/FSRWebSocket.m b/Firebase/Database/third_party/SocketRocket/FSRWebSocket.m index c2b395c..54fcf27 100644 --- a/Firebase/Database/third_party/SocketRocket/FSRWebSocket.m +++ b/Firebase/Database/third_party/SocketRocket/FSRWebSocket.m @@ -16,7 +16,7 @@ #import "FSRWebSocket.h" -#if TARGET_OS_IPHONE +#if TARGET_OS_IOS #define HAS_ICU #endif @@ -26,9 +26,9 @@ #import <unicode/utf8.h> #endif -#if TARGET_OS_IPHONE +#if TARGET_OS_IOS #import <Endian.h> -#else +#elif TARGET_OS_OSX #import <CoreServices/CoreServices.h> #endif |