Browse Source

New Realm version

Marino Faggiana 6 years ago
parent
commit
e5ce833cba

+ 1 - 1
Cartfile.resolved

@@ -9,6 +9,6 @@ github "ealeksandrov/EAIntroView" "2.12.0"
 github "ealeksandrov/EARestrictedScrollView" "1.1.0"
 github "jdg/MBProgressHUD" "1.1.0"
 github "kishikawakatsumi/UICKeyChainStore" "v2.1.2"
-github "realm/realm-cocoa" "v3.11.2"
+github "realm/realm-cocoa" "v3.12.0"
 github "sgr-ksmt/PDFGenerator" "2.1"
 github "tilltue/TLPhotoPicker" "1.7.7"

+ 52 - 14
Carthage/Checkouts/realm-cocoa/.jenkins.yml

@@ -6,6 +6,7 @@ xcode_version:
   - 9.3
   - 9.4
   - 10.0
+  - 10.1
 target:
   - osx
   - docs
@@ -44,8 +45,11 @@ configuration:
 # | 9.4   | Debug        | X   |      |            |             |           |           |         |           |           |      |                |                   |                      |                       |                       |                        |             |
 # | 9.4   | Release      | X   |      | X          | X           | X         | X         | X       | X         |           | X    |                |                   |                      |                       |                       |                        |             |
 # | -------------------- | --- | ---- | ---------- | ----------- | --------- | --------- | ------- | --------- | --------- | ---- | -------------- | ----------------- | -------------------- | --------------------- | --------------------- | ---------------------- | ----------- |
-# | 10.0  | Debug        | X   |      |            | X           | X         | X         | X       |           |           | X    |                |                   |                      |                       |                       |                        |             |
-# | 10.0  | Release      | X   | X    | X          | X           | X         | X         | X       | X         | X         | X    | X              | X                 |                      |                       | X                     |                        | X           |
+# | 10.0  | Debug        | X   |      |            |             |           |           |         |           |           |      |                |                   |                      |                       |                       |                        |             |
+# | 10.0  | Release      | X   |      | X          | X           | X         | X         | X       | X         |           | X    |                |                   |                      |                       |                       |                        |             |
+# | -------------------- | --- | ---- | ---------- | ----------- | --------- | --------- | ------- | --------- | --------- | ---- | -------------- | ----------------- | -------------------- | --------------------- | --------------------- | ---------------------- | ----------- |
+# | 10.1  | Debug        | X   |      |            | X           | X         | X         | X       |           |           | X    |                |                   |                      |                       |                       |                        |             |
+# | 10.1  | Release      | X   | X    | X          | X           | X         | X         | X       | X         | X         | X    | X              | X                 |                      |                       | X                     |                        | X           |
 # +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
 
 exclude:
@@ -59,6 +63,8 @@ exclude:
     target: docs
   - xcode_version: 9.4
     target: docs
+  - xcode_version: 10.0
+    target: docs
   - target: docs
     configuration: Debug
 
@@ -75,6 +81,9 @@ exclude:
   - xcode_version: 10.0
     target: ios-static
     configuration: Debug
+  - xcode_version: 10.1
+    target: ios-static
+    configuration: Debug
 
   ################
   # ios-dynamic
@@ -89,11 +98,14 @@ exclude:
   - xcode_version: 9.4
     target: ios-dynamic
     configuration: Debug
+  - xcode_version: 10.0
+    target: ios-dynamic
+    configuration: Debug
 
   ################
   # ios-swift
   ################
-  # Skip 9.2/9.3/9.4 Debug
+  # Skip 9.2/9.3/9.4/10.0 Debug
   - xcode_version: 9.2
     target: ios-swift
     configuration: Debug
@@ -103,11 +115,14 @@ exclude:
   - xcode_version: 9.4
     target: ios-swift
     configuration: Debug
+  - xcode_version: 10.0
+    target: ios-swift
+    configuration: Debug
 
   ################
   # osx-swift
   ################
-  # Skip 9.2/9.3/9.4 Debug
+  # Skip 9.2/9.3/9.4/10.0 Debug
   - xcode_version: 9.2
     target: osx-swift
     configuration: Debug
@@ -117,11 +132,14 @@ exclude:
   - xcode_version: 9.4
     target: osx-swift
     configuration: Debug
+  - xcode_version: 10.0
+    target: osx-swift
+    configuration: Debug
 
   ################
   # watchos
   ################
-  # Skip 9.2/9.3/9.4 Debug
+  # Skip 9.2/9.3/9.4/10.0 Debug
   - xcode_version: 9.2
     target: watchos
     configuration: Debug
@@ -131,6 +149,9 @@ exclude:
   - xcode_version: 9.4
     target: watchos
     configuration: Debug
+  - xcode_version: 10.0
+    target: watchos
+    configuration: Debug
 
   ################
   # cocoapods
@@ -142,20 +163,22 @@ exclude:
   ################
   # swiftlint
   ################
-  # Just run on 10.0 Release
+  # Just run on 10.1 Release
   - xcode_version: 9.2
     target: swiftlint
   - xcode_version: 9.3
     target: swiftlint
   - xcode_version: 9.4
     target: swiftlint
+  - xcode_version: 10.0
+    target: swiftlint
   - target: swiftlint
     configuration: Debug
 
   ################
   # tvos
   ################
-  # Skip 9.2/9.3/9.4 Debug
+  # Skip 9.2/9.3/9.4/10.0 Debug
   - xcode_version: 9.2
     target: tvos
     configuration: Debug
@@ -165,33 +188,40 @@ exclude:
   - xcode_version: 9.4
     target: tvos
     configuration: Debug
+  - xcode_version: 10.0
+    target: tvos
+    configuration: Debug
 
   ################
   # osx-encryption
   ################
-  # Just run on 9.2/10.0 Release
+  # Just run on 9.2/10.1 Release
   - xcode_version: 9.3
     target: osx-encryption
   - xcode_version: 9.4
     target: osx-encryption
+  - xcode_version: 10.0
+    target: osx-encryption
   - target: osx-encryption
     configuration: Debug
 
   ################
   # osx-object-server
   ################
-  # Just run on 9.2/10.0 Release
+  # Just run on 9.2/10.1 Release
   - xcode_version: 9.3
     target: osx-object-server
   - xcode_version: 9.4
     target: osx-object-server
+  - xcode_version: 10.01
+    target: osx-object-server
   - target: osx-object-server
     configuration: Debug
 
   ################
   # ios-device-objc-ios8
   ################
-  # Just run on 9.2/9.4 Release
+  # Just run on 9.2/10.1 Release
   - xcode_version: 9.3
     target: ios-device-objc-ios8
   - xcode_version: 10.0
@@ -202,45 +232,53 @@ exclude:
   ################
   # ios-device-swift-ios8
   ################
-  # Just run on 9.2/10.0 Release
+  # Just run on 9.2/10.1 Release
   - xcode_version: 9.3
     target: ios-device-swift-ios8
   - xcode_version: 9.4
     target: ios-device-swift-ios8
+  - xcode_version: 10.1
+    target: ios-device-swift-ios8
   - target: ios-device-swift-ios8
     configuration: Debug
 
   ################
   # ios-device-objc-ios10
   ################
-  # Just run on 9.2/10.0 Release
+  # Just run on 9.2/10.1 Release
   - xcode_version: 9.3
     target: ios-device-objc-ios10
   - xcode_version: 9.4
     target: ios-device-objc-ios10
+  - xcode_version: 10.0
+    target: ios-device-objc-ios10
   - target: ios-device-objc-ios10
     configuration: Debug
 
   ################
   # ios-device-swift-ios10
   ################
-  # Just run on 9.2/10.0 Release
+  # Just run on 9.2/10.1 Release
   - xcode_version: 9.3
     target: ios-device-swift-ios10
   - xcode_version: 9.4
     target: ios-device-swift-ios10
+  - xcode_version: 10.1
+    target: ios-device-swift-ios10
   - target: ios-device-swift-ios10
     configuration: Debug
 
   ################
   # tvos-device
   ################
-  # Just run on 10.0 Release
+  # Just run on 10.1 Release
   - xcode_version: 9.2
     target: tvos-device
   - xcode_version: 9.3
     target: tvos-device
   - xcode_version: 9.4
     target: tvos-device
+  - xcode_version: 10.0
+    target: tvos-device
   - target: tvos-device
     configuration: Debug

+ 18 - 0
Carthage/Checkouts/realm-cocoa/CHANGELOG.md

@@ -1,3 +1,21 @@
+3.12.0 Release notes (2018-11-26)
+=============================================================
+
+### Enhancements
+
+* Add a User-Agent header to HTTP requests made to the Realm Object Server. By
+  default, this contains information about the Realm library version and your
+  app's bundle ID. The application identifier can be customized by setting
+  `RLMSyncManager.sharedManager.userAgent`/`SyncManager.shared.userAgent` prior
+  to opening a synchronized Realm.
+  (PR: https://github.com/realm/realm-cocoa/pull/6007).
+* Add Xcode 10.1 binary to the prebuilt package.
+
+### Compatibility
+
+* File format: Generates Realms with format v9 (Reads and upgrades all previous formats)
+* Realm Object Server: 3.11.0 or later.
+
 3.11.2 Release notes (2018-11-15)
 =============================================================
 

+ 3 - 3
Carthage/Checkouts/realm-cocoa/Jenkinsfile.releasability

@@ -1,8 +1,8 @@
-swiftVersions = ['3.2.3', '3.3', '4.0.3', '4.1', '4.1.2', '4.2']
+swiftVersions = ['3.2.3', '3.3', '3.3.2', '3.4', '3.4.1', '4.0.3', '4.1', '4.1.2', '4.2', '4.2.1']
 platforms = ['osx', 'ios', 'watchos', 'tvos']
 platformNames = ['osx': 'macOS', 'ios': 'iOS', 'watchos': 'watchOS', 'tvos': 'tvOS']
-carthageXcodeVersion = '9.4'
-carthageSwiftVersion = '3.3.2'
+carthageXcodeVersion = '10.1'
+carthageSwiftVersion = '3.4.1'
 
 def installationTest(platform, test, language) {
   return {

+ 1 - 0
Carthage/Checkouts/realm-cocoa/Realm/ObjectServerTests/RLMSyncTestCase.mm

@@ -526,6 +526,7 @@ static NSURL *syncDirectoryForChildProcess() {
                            withIntermediateDirectories:YES attributes:nil error:&error];
     s_managerForTest = [[RLMSyncManager alloc] initWithCustomRootDirectory:clientDataRoot];
     [RLMSyncManager sharedManager].logLevel = RLMSyncLogLevelOff;
+    [RLMSyncManager sharedManager].userAgent = self.name;
 }
 
 - (void)tearDown {

+ 12 - 2
Carthage/Checkouts/realm-cocoa/Realm/RLMSyncManager.h

@@ -76,11 +76,21 @@ typedef void(^RLMSyncErrorReportingBlock)(NSError *, RLMSyncSession * _Nullable)
 @property (nullable, nonatomic, copy) RLMSyncErrorReportingBlock errorHandler;
 
 /**
- A reverse-DNS string uniquely identifying this application. In most cases this is automatically set by the SDK, and
- does not have to be explicitly configured.
+ A reverse-DNS string uniquely identifying this application. In most cases this
+ is automatically set by the SDK, and does not have to be explicitly configured.
  */
 @property (nonatomic, copy) NSString *appID;
 
+/**
+ A string identifying this application which is included in the User-Agent
+ header of sync connections. By default, this will be the application's bundle
+ identifier.
+
+ This property must be set prior to opening a synchronized Realm for the first
+ time. Any modifications made after opening a Realm will be ignored.
+ */
+@property (nonatomic, copy) NSString *userAgent;
+
 /**
  The logging threshold which newly opened synced Realms will use. Defaults to
  `RLMSyncLogLevelInfo`.

+ 16 - 1
Carthage/Checkouts/realm-cocoa/Realm/RLMSyncManager.mm

@@ -29,6 +29,10 @@
 #import "sync/sync_manager.hpp"
 #import "sync/sync_session.hpp"
 
+#if !defined(REALM_COCOA_VERSION)
+#import "RLMVersion.h"
+#endif
+
 using namespace realm;
 using Level = realm::util::Logger::Level;
 
@@ -110,7 +114,13 @@ static RLMSyncManager *s_sharedManager = nil;
         bool should_encrypt = !getenv("REALM_DISABLE_METADATA_ENCRYPTION") && !RLMIsRunningInPlayground();
         auto mode = should_encrypt ? SyncManager::MetadataMode::Encryption : SyncManager::MetadataMode::NoEncryption;
         rootDirectory = rootDirectory ?: [NSURL fileURLWithPath:RLMDefaultDirectoryForBundleIdentifier(nil)];
-        SyncManager::shared().configure(rootDirectory.path.UTF8String, mode, "", none, true);
+        @autoreleasepool {
+            bool isSwift = !!NSClassFromString(@"RealmSwiftObjectUtil");
+            auto userAgent = [[NSMutableString alloc] initWithFormat:@"Realm%@/%@",
+                              isSwift ? @"Swift" : @"ObjectiveC", REALM_COCOA_VERSION];
+            SyncManager::shared().configure(rootDirectory.path.UTF8String, mode, RLMStringDataWithNSString(userAgent), none, true);
+            SyncManager::shared().set_user_agent(RLMStringDataWithNSString(self.appID));
+        }
         return self;
     }
     return nil;
@@ -123,6 +133,11 @@ static RLMSyncManager *s_sharedManager = nil;
     return _appID;
 }
 
+- (void)setUserAgent:(NSString *)userAgent {
+    SyncManager::shared().set_user_agent(RLMStringDataWithNSString(userAgent));
+    _userAgent = userAgent;
+}
+
 #pragma mark - Passthrough properties
 
 - (RLMSyncLogLevel)logLevel {

+ 2 - 2
Carthage/Checkouts/realm-cocoa/Realm/Realm-Info.plist

@@ -17,11 +17,11 @@
 	<key>CFBundlePackageType</key>
 	<string>FMWK</string>
 	<key>CFBundleShortVersionString</key>
-	<string>3.11.2</string>
+	<string>3.12.0</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>3.11.2</string>
+	<string>3.12.0</string>
 	<key>NSHumanReadableCopyright</key>
 	<string>Copyright © 2014 Realm. All rights reserved.</string>
 	<key>NSPrincipalClass</key>

+ 11 - 2
Carthage/Checkouts/realm-cocoa/build.sh

@@ -1193,7 +1193,7 @@ EOM
 
     package-*-swift)
         PLATFORM=$(echo $COMMAND | cut -d - -f 2)
-        for version in 9.1 9.2 9.3 9.4 10.0; do
+        for version in 9.2 9.3 9.4 10.0 10.1; do
             REALM_XCODE_VERSION=$version
             REALM_SWIFT_VERSION=
             set_xcode_and_swift_versions
@@ -1206,7 +1206,8 @@ EOM
         ln -s swift-4.1 swift-3.3
         ln -s swift-4.1.2 swift-3.3.2
         ln -s swift-4.2 swift-3.4
-        zip --symlinks -r realm-swift-framework-$PLATFORM.zip swift-3.2.3 swift-3.3 swift-3.3.2 swift-3.4 swift-4.0.3 swift-4.1 swift-4.1.2 swift-4.2
+        ln -s swift-4.2.1 swift-3.4.1
+        zip --symlinks -r realm-swift-framework-$PLATFORM.zip swift-3.2.3 swift-3.3 swift-3.3.2 swift-3.4 swift-3.4.1 swift-4.0.3 swift-4.1 swift-4.1.2 swift-4.2 swift-4.2.1
         ;;
 
     package-*-swift-3.2.3)
@@ -1241,6 +1242,14 @@ EOM
         zip --symlinks -r realm-swift-framework-$PLATFORM-swift-3.4.zip swift-3.4
         ;;
 
+    package-*-swift-3.4.1)
+        PLATFORM=$(echo $COMMAND | cut -d - -f 2)
+        mkdir -p build/$PLATFORM
+        cd build/$PLATFORM
+        ln -s swift-4.2.1 swift-3.4.1
+        zip --symlinks -r realm-swift-framework-$PLATFORM-swift-3.4.1.zip swift-3.4.1
+        ;;
+
     package-*-swift-*)
         PLATFORM=$(echo $COMMAND | cut -d - -f 2)
         REALM_SWIFT_VERSION=$(echo $COMMAND | cut -d - -f 4)

+ 2 - 2
Carthage/Checkouts/realm-cocoa/dependencies.list

@@ -1,4 +1,4 @@
-VERSION=3.11.2
+VERSION=3.12.0
 REALM_CORE_VERSION=5.12.1
 REALM_SYNC_VERSION=3.13.3
-REALM_OBJECT_SERVER_VERSION=3.11.5
+REALM_OBJECT_SERVER_VERSION=3.13.1