Skip to content

Commit add7aa8

Browse files
authored
Merge pull request #383 from zapcannon87/developer
feat(rtm): embed Starscream and enhance read buffer size
2 parents 231a78c + c461f91 commit add7aa8

File tree

6 files changed

+1909
-30
lines changed

6 files changed

+1909
-30
lines changed

LeanCloud.podspec

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,22 @@ Pod::Spec.new do |s|
1616
s.watchos.deployment_target = '3.0'
1717

1818
s.subspec 'Foundation' do |ss|
19-
ss.dependency 'Alamofire', '~> 5.0'
19+
ss.dependency 'Alamofire', '~> 5.2'
2020

2121
ss.source_files = 'Sources/Foundation/**/*.{swift}'
2222
end
2323

2424
s.subspec 'RTM' do |ss|
25-
ss.dependency 'SwiftProtobuf', '~> 1.8'
26-
ss.dependency 'Starscream', '~> 3.1'
27-
ss.dependency 'GRDB.swift', '~> 4.9'
25+
ss.dependency 'SwiftProtobuf', '~> 1.10'
26+
ss.dependency 'GRDB.swift', '~> 4.14'
2827

2928
ss.dependency 'LeanCloud/Foundation', "#{s.version}"
3029

3130
ss.source_files = 'Sources/RTM/**/*.{swift}'
3231
end
3332

3433
s.subspec 'RTM-no-local-storage' do |ss|
35-
ss.dependency 'SwiftProtobuf', '~> 1.8'
36-
ss.dependency 'Starscream', '~> 3.1'
34+
ss.dependency 'SwiftProtobuf', '~> 1.10'
3735

3836
ss.dependency 'LeanCloud/Foundation', "#{s.version}"
3937

LeanCloud.xcodeproj/project.pbxproj

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
83FAF0931CC4D1E400A84063 /* LCObjectTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83FAF0921CC4D1E400A84063 /* LCObjectTestCase.swift */; };
6868
D302D340246BD259003D9274 /* LiveQueryTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = D302D33F246BD259003D9274 /* LiveQueryTestCase.swift */; };
6969
D303BD752328CB1C004AE13D /* SwiftProtobuf in Frameworks */ = {isa = PBXBuildFile; productRef = D303BD742328CB1C004AE13D /* SwiftProtobuf */; };
70-
D303BD782328CDFC004AE13D /* Starscream in Frameworks */ = {isa = PBXBuildFile; productRef = D303BD772328CDFC004AE13D /* Starscream */; };
7170
D303BD7B2328D062004AE13D /* GRDB in Frameworks */ = {isa = PBXBuildFile; productRef = D303BD7A2328D062004AE13D /* GRDB */; };
7271
D314AFA4219540A700C9C146 /* LeanCloud.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8342FCBB1C7B13A700C3CF15 /* LeanCloud.framework */; };
7372
D314AFA5219540A700C9C146 /* LeanCloud.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 8342FCBB1C7B13A700C3CF15 /* LeanCloud.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
@@ -83,6 +82,7 @@
8382
D33D36D922017DAC008C9BDA /* test.png in Resources */ = {isa = PBXBuildFile; fileRef = D33D36D722017DAC008C9BDA /* test.png */; };
8483
D33D36DC22019197008C9BDA /* test.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = D33D36DA22019197008C9BDA /* test.mp4 */; };
8584
D3457E79237955580030BEDE /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3457E78237955580030BEDE /* main.swift */; };
85+
D345990424C04FF4009E72DE /* WebSocket.swift in Sources */ = {isa = PBXBuildFile; fileRef = D345990024C04FF4009E72DE /* WebSocket.swift */; };
8686
D34F1BB92268263000251BC8 /* IMLocalStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = D34F1BB82268263000251BC8 /* IMLocalStorage.swift */; };
8787
D35EB5BD2328A6E000763E4E /* Alamofire in Frameworks */ = {isa = PBXBuildFile; productRef = D35EB5BC2328A6E000763E4E /* Alamofire */; };
8888
D363342022CD9EC300995DC1 /* EngineClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = D363341F22CD9EC300995DC1 /* EngineClient.swift */; };
@@ -228,6 +228,7 @@
228228
D33D36DA22019197008C9BDA /* test.mp4 */ = {isa = PBXFileReference; lastKnownFileType = file; path = test.mp4; sourceTree = "<group>"; };
229229
D3457E76237955580030BEDE /* CLI */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = CLI; sourceTree = BUILT_PRODUCTS_DIR; };
230230
D3457E78237955580030BEDE /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; };
231+
D345990024C04FF4009E72DE /* WebSocket.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WebSocket.swift; sourceTree = "<group>"; };
231232
D34F1BB82268263000251BC8 /* IMLocalStorage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IMLocalStorage.swift; sourceTree = "<group>"; };
232233
D363341F22CD9EC300995DC1 /* EngineClient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EngineClient.swift; sourceTree = "<group>"; };
233234
D363343522CDB0D300995DC1 /* LCEngineTestCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LCEngineTestCase.swift; sourceTree = "<group>"; };
@@ -258,7 +259,6 @@
258259
files = (
259260
D35EB5BD2328A6E000763E4E /* Alamofire in Frameworks */,
260261
D303BD752328CB1C004AE13D /* SwiftProtobuf in Frameworks */,
261-
D303BD782328CDFC004AE13D /* Starscream in Frameworks */,
262262
D303BD7B2328D062004AE13D /* GRDB in Frameworks */,
263263
D3D2E5EB237BBA4A007A2045 /* CFNetwork.framework in Frameworks */,
264264
);
@@ -464,6 +464,7 @@
464464
D3CA1116216DD77400629343 /* RTM */ = {
465465
isa = PBXGroup;
466466
children = (
467+
D345990024C04FF4009E72DE /* WebSocket.swift */,
467468
D3301278217727870007286A /* Command.pb.swift */,
468469
113D23D021901A71006B53EC /* RTMRouter.swift */,
469470
D324CD9121774A9B003FA35F /* RTMConnection.swift */,
@@ -516,7 +517,6 @@
516517
packageProductDependencies = (
517518
D35EB5BC2328A6E000763E4E /* Alamofire */,
518519
D303BD742328CB1C004AE13D /* SwiftProtobuf */,
519-
D303BD772328CDFC004AE13D /* Starscream */,
520520
D303BD7A2328D062004AE13D /* GRDB */,
521521
);
522522
productName = LeanCloud;
@@ -627,8 +627,8 @@
627627
packageReferences = (
628628
D35EB5BB2328A6E000763E4E /* XCRemoteSwiftPackageReference "Alamofire" */,
629629
D303BD732328CB1C004AE13D /* XCRemoteSwiftPackageReference "swift-protobuf" */,
630-
D303BD762328CDFC004AE13D /* XCRemoteSwiftPackageReference "Starscream" */,
631630
D303BD792328D062004AE13D /* XCRemoteSwiftPackageReference "GRDB" */,
631+
D345990524C0579C009E72DE /* XCRemoteSwiftPackageReference "swift-nio-zlib-support" */,
632632
);
633633
productRefGroup = 8342FCBC1C7B13A700C3CF15 /* Products */;
634634
projectDirPath = "";
@@ -718,6 +718,7 @@
718718
835F5D821D7E6808004D1A0E /* Response.swift in Sources */,
719719
835F5D861D7E6808004D1A0E /* SMSClient.swift in Sources */,
720720
835F5D7E1D7E6808004D1A0E /* ObjectUpdater.swift in Sources */,
721+
D345990424C04FF4009E72DE /* WebSocket.swift in Sources */,
721722
113D23D121901A71006B53EC /* RTMRouter.swift in Sources */,
722723
835F5D831D7E6808004D1A0E /* HTTPClient.swift in Sources */,
723724
119D16AF219A7FCE0023BFEF /* IMClient.swift in Sources */,
@@ -1206,31 +1207,31 @@
12061207
repositoryURL = "https://github.com/apple/swift-protobuf";
12071208
requirement = {
12081209
kind = upToNextMajorVersion;
1209-
minimumVersion = 1.8.0;
1210+
minimumVersion = 1.10.0;
12101211
};
12111212
};
1212-
D303BD762328CDFC004AE13D /* XCRemoteSwiftPackageReference "Starscream" */ = {
1213+
D303BD792328D062004AE13D /* XCRemoteSwiftPackageReference "GRDB" */ = {
12131214
isa = XCRemoteSwiftPackageReference;
1214-
repositoryURL = "https://github.com/daltoniam/Starscream";
1215+
repositoryURL = "https://github.com/groue/GRDB.swift";
12151216
requirement = {
12161217
kind = upToNextMajorVersion;
1217-
minimumVersion = 3.1.1;
1218+
minimumVersion = 4.14.0;
12181219
};
12191220
};
1220-
D303BD792328D062004AE13D /* XCRemoteSwiftPackageReference "GRDB" */ = {
1221+
D345990524C0579C009E72DE /* XCRemoteSwiftPackageReference "swift-nio-zlib-support" */ = {
12211222
isa = XCRemoteSwiftPackageReference;
1222-
repositoryURL = "https://github.com/groue/GRDB.swift";
1223+
repositoryURL = "https://github.com/apple/swift-nio-zlib-support";
12231224
requirement = {
12241225
kind = upToNextMajorVersion;
1225-
minimumVersion = 4.9.0;
1226+
minimumVersion = 1.0.0;
12261227
};
12271228
};
12281229
D35EB5BB2328A6E000763E4E /* XCRemoteSwiftPackageReference "Alamofire" */ = {
12291230
isa = XCRemoteSwiftPackageReference;
12301231
repositoryURL = "https://github.com/Alamofire/Alamofire";
12311232
requirement = {
12321233
kind = upToNextMajorVersion;
1233-
minimumVersion = 5.0.0;
1234+
minimumVersion = 5.2.0;
12341235
};
12351236
};
12361237
/* End XCRemoteSwiftPackageReference section */
@@ -1241,11 +1242,6 @@
12411242
package = D303BD732328CB1C004AE13D /* XCRemoteSwiftPackageReference "swift-protobuf" */;
12421243
productName = SwiftProtobuf;
12431244
};
1244-
D303BD772328CDFC004AE13D /* Starscream */ = {
1245-
isa = XCSwiftPackageProductDependency;
1246-
package = D303BD762328CDFC004AE13D /* XCRemoteSwiftPackageReference "Starscream" */;
1247-
productName = Starscream;
1248-
};
12491245
D303BD7A2328D062004AE13D /* GRDB */ = {
12501246
isa = XCSwiftPackageProductDependency;
12511247
package = D303BD792328D062004AE13D /* XCRemoteSwiftPackageReference "GRDB" */;

LeanCloudTests/RTMConnectionTestCase.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
import XCTest
1010
@testable import LeanCloud
11-
@testable import Starscream
1211

1312
class RTMConnectionTestCase: RTMBaseTestCase {
1413

Package.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,17 @@ let package = Package(
1515
.library(name: "LeanCloud", targets: ["LeanCloud"]),
1616
],
1717
dependencies: [
18-
.package(url: "https://github.com/Alamofire/Alamofire.git", .upToNextMajor(from: "5.0.0")),
19-
.package(url: "https://github.com/apple/swift-protobuf.git", .upToNextMajor(from: "1.8.0")),
20-
.package(url: "https://github.com/daltoniam/Starscream.git", .upToNextMajor(from: "3.1.0")),
21-
.package(url: "https://github.com/groue/GRDB.swift.git", .upToNextMajor(from: "4.9.0"))
18+
.package(url: "https://github.com/Alamofire/Alamofire.git", .upToNextMajor(from: "5.2.0")),
19+
.package(url: "https://github.com/apple/swift-protobuf.git", .upToNextMajor(from: "1.10.0")),
20+
.package(url: "https://github.com/apple/swift-nio-zlib-support.git", from: "1.0.0"),
21+
.package(url: "https://github.com/groue/GRDB.swift.git", .upToNextMajor(from: "4.14.0"))
2222
],
2323
targets: [
2424
.target(
2525
name: "LeanCloud",
2626
dependencies: [
2727
"Alamofire",
2828
"SwiftProtobuf",
29-
"Starscream",
3029
"GRDB"
3130
],
3231
path: "Sources"

Sources/RTM/RTMConnection.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import Foundation
1010
#if os(iOS) || os(tvOS)
1111
import UIKit
1212
#endif
13-
import Starscream
1413
import Alamofire
1514

1615
enum RTMService: Int32 {

0 commit comments

Comments
 (0)