Skip to content

Commit 2d2fe32

Browse files
authored
Merge pull request #434 from zapcannon87/master
release: 17.10.0
2 parents c32ba45 + 442a182 commit 2d2fe32

File tree

7 files changed

+51
-44
lines changed

7 files changed

+51
-44
lines changed

.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
17.9.2
1+
17.10.0

LeanCloud.podspec

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'LeanCloud'
3-
s.version = '17.9.2'
3+
s.version = '17.10.0'
44
s.license = { :type => 'Apache License, Version 2.0', :file => 'LICENSE' }
55
s.summary = 'LeanCloud Swift SDK'
66
s.homepage = 'https://leancloud.cn/'
@@ -10,7 +10,7 @@ Pod::Spec.new do |s|
1010
s.swift_version = '5.0'
1111
s.default_subspec = 'RTM'
1212

13-
s.ios.deployment_target = '10.0'
13+
s.ios.deployment_target = '11.0'
1414
s.osx.deployment_target = '10.12'
1515
s.tvos.deployment_target = '10.0'
1616
s.watchos.deployment_target = '3.0'
@@ -22,16 +22,16 @@ Pod::Spec.new do |s|
2222
end
2323

2424
s.subspec 'RTM' do |ss|
25-
ss.dependency 'SwiftProtobuf', '~> 1.17'
26-
ss.dependency 'GRDB.swift', '~> 5.8'
25+
ss.dependency 'SwiftProtobuf', '~> 1.18'
26+
ss.dependency 'GRDB.swift', '~> 5.12'
2727

2828
ss.dependency 'LeanCloud/Foundation', "#{s.version}"
2929

3030
ss.source_files = 'Sources/RTM/**/*.{swift}'
3131
end
3232

3333
s.subspec 'RTM-no-local-storage' do |ss|
34-
ss.dependency 'SwiftProtobuf', '~> 1.17'
34+
ss.dependency 'SwiftProtobuf', '~> 1.18'
3535

3636
ss.dependency 'LeanCloud/Foundation', "#{s.version}"
3737

LeanCloud.xcodeproj/project.pbxproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@
867867
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
868868
GCC_WARN_UNUSED_FUNCTION = YES;
869869
GCC_WARN_UNUSED_VARIABLE = YES;
870-
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
870+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
871871
MTL_ENABLE_DEBUG_INFO = YES;
872872
ONLY_ACTIVE_ARCH = YES;
873873
SDKROOT = iphoneos;
@@ -922,7 +922,7 @@
922922
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
923923
GCC_WARN_UNUSED_FUNCTION = YES;
924924
GCC_WARN_UNUSED_VARIABLE = YES;
925-
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
925+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
926926
MTL_ENABLE_DEBUG_INFO = NO;
927927
SDKROOT = iphoneos;
928928
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
@@ -949,7 +949,7 @@
949949
DYLIB_INSTALL_NAME_BASE = "@rpath";
950950
INFOPLIST_FILE = LeanCloud/Info.plist;
951951
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
952-
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
952+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
953953
LD_RUNPATH_SEARCH_PATHS = (
954954
"$(inherited)",
955955
"@executable_path/Frameworks",
@@ -982,7 +982,7 @@
982982
DYLIB_INSTALL_NAME_BASE = "@rpath";
983983
INFOPLIST_FILE = LeanCloud/Info.plist;
984984
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
985-
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
985+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
986986
LD_RUNPATH_SEARCH_PATHS = (
987987
"$(inherited)",
988988
"@executable_path/Frameworks",
@@ -1007,7 +1007,7 @@
10071007
CODE_SIGN_STYLE = Automatic;
10081008
DEVELOPMENT_TEAM = 7J5XFNL99Q;
10091009
INFOPLIST_FILE = LeanCloudTests/Info.plist;
1010-
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
1010+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
10111011
LD_RUNPATH_SEARCH_PATHS = (
10121012
"$(inherited)",
10131013
"@executable_path/Frameworks",
@@ -1028,7 +1028,7 @@
10281028
CODE_SIGN_STYLE = Automatic;
10291029
DEVELOPMENT_TEAM = 7J5XFNL99Q;
10301030
INFOPLIST_FILE = LeanCloudTests/Info.plist;
1031-
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
1031+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
10321032
LD_RUNPATH_SEARCH_PATHS = (
10331033
"$(inherited)",
10341034
"@executable_path/Frameworks",
@@ -1208,15 +1208,15 @@
12081208
repositoryURL = "https://github.com/apple/swift-protobuf";
12091209
requirement = {
12101210
kind = upToNextMajorVersion;
1211-
minimumVersion = 1.17.0;
1211+
minimumVersion = 1.18.0;
12121212
};
12131213
};
12141214
D303BD792328D062004AE13D /* XCRemoteSwiftPackageReference "GRDB" */ = {
12151215
isa = XCRemoteSwiftPackageReference;
12161216
repositoryURL = "https://github.com/groue/GRDB.swift";
12171217
requirement = {
12181218
kind = upToNextMajorVersion;
1219-
minimumVersion = 5.8.0;
1219+
minimumVersion = 5.12.0;
12201220
};
12211221
};
12221222
D35EB5BB2328A6E000763E4E /* XCRemoteSwiftPackageReference "Alamofire" */ = {

LeanCloudTests/IMClientTestCase.swift

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class IMClientTestCase: RTMBaseTestCase {
5959
delay()
6060
XCTAssertNil(wClient)
6161
}
62-
62+
6363
func testOpenAndClose() {
6464
let client: IMClient = try! IMClient(ID: uuid, options: [])
6565

@@ -109,10 +109,10 @@ class IMClientTestCase: RTMBaseTestCase {
109109
XCTAssertTrue(user.signUp().isSuccess)
110110

111111
guard let objectID = user.objectId?.value,
112-
let sessionToken = user.sessionToken?.value else {
113-
XCTFail()
114-
return
115-
}
112+
let sessionToken = user.sessionToken?.value else {
113+
XCTFail()
114+
return
115+
}
116116

117117
var clientFromUser: IMClient! = try! IMClient(
118118
user: user,
@@ -158,7 +158,7 @@ class IMClientTestCase: RTMBaseTestCase {
158158
delegator.clientEvent = { c, e in
159159
XCTAssertTrue(Thread.isMainThread)
160160
if c === client,
161-
case .sessionDidPause(error: _) = e {
161+
case .sessionDidPause(error: _) = e {
162162
XCTAssertEqual(client.sessionState, .paused)
163163
pauseExp.fulfill()
164164
}
@@ -190,7 +190,7 @@ class IMClientTestCase: RTMBaseTestCase {
190190

191191
func testSessionConflict() {
192192
if let fileURL = LCApplication.default.currentInstallationFileURL,
193-
FileManager.default.fileExists(atPath: fileURL.path) {
193+
FileManager.default.fileExists(atPath: fileURL.path) {
194194
try! FileManager.default.removeItem(at: fileURL)
195195
}
196196

@@ -286,7 +286,7 @@ class IMClientTestCase: RTMBaseTestCase {
286286
}
287287

288288
if let fileURL = LCApplication.default.currentInstallationFileURL,
289-
FileManager.default.fileExists(atPath: fileURL.path) {
289+
FileManager.default.fileExists(atPath: fileURL.path) {
290290
try! FileManager.default.removeItem(at: fileURL)
291291
}
292292
}
@@ -337,6 +337,7 @@ class IMClientTestCase: RTMBaseTestCase {
337337
client.sessionToken = self.uuid
338338
client.sessionTokenExpiration = Date(timeIntervalSinceNow: 36000)
339339

340+
var ob: NSObjectProtocol?
340341
expecting(
341342
description: "Pause -> Resume -> First-Reopen Then session token expired, Final Second-Reopen success",
342343
count: 4)
@@ -354,7 +355,7 @@ class IMClientTestCase: RTMBaseTestCase {
354355
XCTFail()
355356
}
356357
}
357-
let _ = NotificationCenter.default.addObserver(
358+
ob = NotificationCenter.default.addObserver(
358359
forName: IMClient.TestSessionTokenExpiredNotification,
359360
object: client,
360361
queue: .main
@@ -367,6 +368,9 @@ class IMClientTestCase: RTMBaseTestCase {
367368
client.connection.disconnect()
368369
client.connection.connect()
369370
}
371+
if let ob = ob {
372+
NotificationCenter.default.removeObserver(ob)
373+
}
370374
}
371375

372376
func testReportDeviceToken() {
@@ -379,7 +383,7 @@ class IMClientTestCase: RTMBaseTestCase {
379383
let exp = expectation(description: "client report device token success")
380384
exp.expectedFulfillmentCount = 2
381385
let otherDeviceToken: String = uuid
382-
let _ = NotificationCenter.default.addObserver(forName: IMClient.TestReportDeviceTokenNotification, object: client, queue: OperationQueue.main) { (notification) in
386+
let ob = NotificationCenter.default.addObserver(forName: IMClient.TestReportDeviceTokenNotification, object: client, queue: OperationQueue.main) { (notification) in
383387
let result = notification.userInfo?["result"] as? RTMConnection.CommandCallback.Result
384388
XCTAssertEqual(result?.command?.cmd, .report)
385389
XCTAssertEqual(result?.command?.op, .uploaded)
@@ -392,6 +396,7 @@ class IMClientTestCase: RTMBaseTestCase {
392396
}
393397
wait(for: [exp], timeout: timeout)
394398
XCTAssertEqual(otherDeviceToken, client.currentDeviceToken)
399+
NotificationCenter.default.removeObserver(ob)
395400
}
396401

397402
func testSessionQuery() {
@@ -452,7 +457,7 @@ class IMClientTestCase: RTMBaseTestCase {
452457
wait(for: [queryExp2], timeout: timeout)
453458
}
454459

455-
#if canImport(GRDB)
460+
#if canImport(GRDB)
456461
func testPrepareLocalStorage() {
457462
expecting { (exp) in
458463
let notUseLocalStorageClient = try! IMClient(ID: uuid, options: [])
@@ -589,7 +594,7 @@ class IMClientTestCase: RTMBaseTestCase {
589594
})
590595
}
591596
}
592-
597+
593598
checker(.lastMessageSentTimestamp(descending: true))
594599
checker(.lastMessageSentTimestamp(descending: false))
595600
checker(.updatedTimestamp(descending: true))
@@ -599,7 +604,7 @@ class IMClientTestCase: RTMBaseTestCase {
599604

600605
XCTAssertEqual(client.convCollection.count, 2)
601606
}
602-
#endif
607+
#endif
603608
}
604609

605610
extension IMClientTestCase {
@@ -651,14 +656,14 @@ extension IMClientTestCase {
651656
parameters: ["session_token": sessionToken])
652657
{ (response) in
653658
guard let value = response.value as? [String: Any],
654-
let client_id = value["client_id"] as? String,
655-
client_id == client.ID,
656-
let signature = value["signature"] as? String,
657-
let timestamp = value["timestamp"] as? Int64,
658-
let nonce = value["nonce"] as? String else {
659-
XCTFail()
660-
return
661-
}
659+
let client_id = value["client_id"] as? String,
660+
client_id == client.ID,
661+
let signature = value["signature"] as? String,
662+
let timestamp = value["timestamp"] as? Int64,
663+
let nonce = value["nonce"] as? String else {
664+
XCTFail()
665+
return
666+
}
662667
completion(IMSignature(
663668
signature: signature,
664669
timestamp: timestamp,

LeanCloudTests/RTMConnectionTestCase.swift

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ class RTMConnectionTestCase: RTMBaseTestCase {
3434
serverURL: "leancloud.cn")
3535

3636
for imProtocol in
37-
[RTMConnection.LCIMProtocol.protobuf1,
38-
RTMConnection.LCIMProtocol.protobuf3]
37+
[RTMConnection.LCIMProtocol.protobuf1,
38+
RTMConnection.LCIMProtocol.protobuf3]
3939
{
4040
let connectionRegistry: () -> RTMConnectionManager.InstantMessagingRegistry = {
4141
let registry: RTMConnectionManager.InstantMessagingRegistry
@@ -305,13 +305,13 @@ class RTMConnectionTestCase: RTMBaseTestCase {
305305
let delegator = tuple.1
306306

307307
let oldDate = Date().timeIntervalSince1970
308-
308+
var ob: NSObjectProtocol?
309309
expecting(expectation: {
310310
let exp = self.expectation(description: "goaway")
311311
exp.expectedFulfillmentCount = 3
312312
return exp
313313
}) { exp in
314-
NotificationCenter.default.addObserver(
314+
ob = NotificationCenter.default.addObserver(
315315
forName: RTMConnection.TestGoawayCommandReceivedNotification,
316316
object: connection,
317317
queue: OperationQueue.main)
@@ -333,11 +333,13 @@ class RTMConnectionTestCase: RTMBaseTestCase {
333333
}(), response: WebSocket.WSResponse())
334334
}
335335
}
336-
336+
if let ob = ob {
337+
NotificationCenter.default.removeObserver(ob)
338+
}
337339
XCTAssertNotNil(connection.rtmRouter?.table)
338340
XCTAssertGreaterThan(connection.rtmRouter!.table!.createdTimestamp, oldDate)
339341
}
340-
342+
341343
func testThrottlingOutCommand() {
342344
let peerID = uuid
343345
let tuple = connectedConnection()
@@ -435,7 +437,7 @@ extension RTMConnectionTestCase {
435437
func connectedConnection(
436438
application: LCApplication = .default,
437439
peerID: String = uuid)
438-
-> (RTMConnection, Delegator)
440+
-> (RTMConnection, Delegator)
439441
{
440442
let connection = try! RTMConnectionManager.default.register(
441443
application: application,

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import PackageDescription
66
let package = Package(
77
name: "LeanCloud",
88
platforms: [
9-
.iOS(.v10),
9+
.iOS(.v11),
1010
.macOS(.v10_12),
1111
.tvOS(.v10),
1212
.watchOS(.v3)

Sources/Foundation/Version.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
import Foundation
1010

1111
public struct Version {
12-
public static let versionString = "17.9.2"
12+
public static let versionString = "17.10.0"
1313
}

0 commit comments

Comments
 (0)