Skip to content

Commit 0fede34

Browse files
committed
Convert to Swift 5 and update dependencies
1 parent 66274a6 commit 0fede34

12 files changed

Lines changed: 83 additions & 47 deletions

File tree

Cartfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
github "Alamofire/Alamofire" ~> 4.7
2-
github "mxcl/PromiseKit" ~> 6.3
1+
github "Alamofire/Alamofire" ~> 5.1
2+
github "mxcl/PromiseKit" ~> 6.13

Cartfile.resolved

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
github "Alamofire/Alamofire" "4.7.3"
2-
github "mxcl/PromiseKit" "6.3.4"
1+
github "Alamofire/Alamofire" "5.1.0"
2+
github "mxcl/PromiseKit" "6.13.1"

Package.resolved

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ let package = Package(
1818
),
1919
],
2020
dependencies: [
21-
.package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.1"),
22-
.package(url: "https://github.com/mxcl/PromiseKit.git", from: "6.10.0")
21+
.package(url: "https://github.com/Alamofire/Alamofire.git", from: "5.1.0"),
22+
.package(url: "https://github.com/mxcl/PromiseKit.git", from: "6.13.1")
2323
],
2424
targets: [
2525
.target(

Sources/SupportingFiles/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>0.6.2</string>
18+
<string>$(MARKETING_VERSION)</string>
1919
<key>CFBundleVersion</key>
2020
<string>$(CURRENT_PROJECT_VERSION)</string>
2121
<key>NSPrincipalClass</key>

Sources/SwiftJSONRPC/RequestExecutor/HTTP/Client/AlamofireHTTPClient.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class AlamofireHTTPClient: HTTPClient
1717

1818
func perform(request: HTTPRequest, completionHandler: @escaping (HTTPClient.PerformRequestResult) -> Void)
1919
{
20-
Alamofire
20+
AF
2121
.request(request)
2222
.responseData(queue: responseQueue(), completionHandler: { result in
2323
switch result.result

Sources/SwiftJSONRPC/RequestExecutor/HTTP/Client/HTTPRequest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public struct HTTPRequest
2020

2121
public var headers: [String: String]
2222

23-
public var body: Data
23+
public var body: Data?
2424

2525
}
2626

Sources/SwiftJSONRPC/RequestExecutor/HTTP/HTTPRequestExecutor.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ public class HTTPRequestExecutor: RequestExecutor
259259
{
260260
_ = self.httpTasks.modify { httpTasks in
261261
var httpTasks = httpTasks
262-
if let idx = httpTasks.index(where: { $0.httpRequest == httpTask.httpRequest }) {
262+
if let idx = httpTasks.firstIndex(where: { $0.httpRequest == httpTask.httpRequest }) {
263263
httpTasks.remove(at: idx)
264264
}
265265
return httpTasks

SwiftJSONRPC.podspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "SwiftJSONRPC"
3-
s.version = "0.6.2"
3+
s.version = "0.7.0"
44
s.summary = "Swift JSON-RPC client based on Alamofire"
55
s.homepage = "https://github.com/kolyasev/SwiftJSONRPC"
66
s.license = 'MIT'
@@ -14,8 +14,8 @@ Pod::Spec.new do |s|
1414
s.source_files = 'Sources/**/*.swift'
1515

1616
s.frameworks = 'Foundation'
17-
s.dependency 'Alamofire', '~> 4.7'
18-
s.dependency 'PromiseKit', '~> 6.3'
17+
s.dependency 'Alamofire', '~> 5.1'
18+
s.dependency 'PromiseKit', '~> 6.13'
1919

2020
# TODO: Convert to Swift 3.x
2121
# s.dependency 'Atomic', '~> 1.0'

SwiftJSONRPC.xcodeproj/project.pbxproj

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
35DFC5F61F87711500B15E9D /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 35DFC5F51F87711200B15E9D /* Alamofire.framework */; };
1414
35DFC5F81F877B6800B15E9D /* Alamofire.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 35DFC5F51F87711200B15E9D /* Alamofire.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
1515
662C6A42212310B600274389 /* SwiftJSONRPC.h in Headers */ = {isa = PBXBuildFile; fileRef = 662C6A0E212310B500274389 /* SwiftJSONRPC.h */; settings = {ATTRIBUTES = (Public, ); }; };
16-
662C6A43212310B600274389 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 662C6A0F212310B500274389 /* Info.plist */; };
1716
662C6A44212310B600274389 /* Lock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 662C6A12212310B600274389 /* Lock.swift */; };
1817
662C6A45212310B600274389 /* Atomic.swift in Sources */ = {isa = PBXBuildFile; fileRef = 662C6A13212310B600274389 /* Atomic.swift */; };
1918
662C6A46212310B600274389 /* Cancelable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 662C6A16212310B600274389 /* Cancelable.swift */; };
@@ -47,6 +46,8 @@
4746
662C6A65212310B600274389 /* RequestRetrier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 662C6A40212310B600274389 /* RequestRetrier.swift */; };
4847
662C6A66212310B600274389 /* RPCClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 662C6A41212310B600274389 /* RPCClient.swift */; };
4948
666123D221245C0800DA0244 /* RPCService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 666123D121245C0800DA0244 /* RPCService.swift */; };
49+
66D5251F2454AAA30026F2D0 /* PromiseKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 66D5251E2454AAA30026F2D0 /* PromiseKit.framework */; };
50+
66D525242454AC740026F2D0 /* PromiseKit.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 66D5251E2454AAA30026F2D0 /* PromiseKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
5051
/* End PBXBuildFile section */
5152

5253
/* Begin PBXContainerItemProxy section */
@@ -66,6 +67,7 @@
6667
dstPath = "";
6768
dstSubfolderSpec = 10;
6869
files = (
70+
66D525242454AC740026F2D0 /* PromiseKit.framework in Copy Frameworks */,
6971
35DFC5F81F877B6800B15E9D /* Alamofire.framework in Copy Frameworks */,
7072
);
7173
name = "Copy Frameworks";
@@ -116,6 +118,7 @@
116118
662C6A40212310B600274389 /* RequestRetrier.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RequestRetrier.swift; sourceTree = "<group>"; };
117119
662C6A41212310B600274389 /* RPCClient.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RPCClient.swift; sourceTree = "<group>"; };
118120
666123D121245C0800DA0244 /* RPCService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RPCService.swift; sourceTree = "<group>"; };
121+
66D5251E2454AAA30026F2D0 /* PromiseKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PromiseKit.framework; path = Carthage/Build/iOS/PromiseKit.framework; sourceTree = "<group>"; };
119122
/* End PBXFileReference section */
120123

121124
/* Begin PBXFrameworksBuildPhase section */
@@ -124,6 +127,7 @@
124127
buildActionMask = 2147483647;
125128
files = (
126129
35DFC5F61F87711500B15E9D /* Alamofire.framework in Frameworks */,
130+
66D5251F2454AAA30026F2D0 /* PromiseKit.framework in Frameworks */,
127131
);
128132
runOnlyForDeploymentPostprocessing = 0;
129133
};
@@ -142,6 +146,7 @@
142146
isa = PBXGroup;
143147
children = (
144148
35DFC5F51F87711200B15E9D /* Alamofire.framework */,
149+
66D5251E2454AAA30026F2D0 /* PromiseKit.framework */,
145150
);
146151
name = Frameworks;
147152
sourceTree = "<group>";
@@ -407,15 +412,17 @@
407412
isa = PBXProject;
408413
attributes = {
409414
LastSwiftUpdateCheck = 0900;
410-
LastUpgradeCheck = 0900;
415+
LastUpgradeCheck = 1130;
411416
ORGANIZATIONNAME = "Denis Kolyasev";
412417
TargetAttributes = {
413418
35BC9BCC1F8669E400881541 = {
414419
CreatedOnToolsVersion = 9.0;
420+
LastSwiftMigration = 1130;
415421
ProvisioningStyle = Automatic;
416422
};
417423
35BC9BD51F8669E400881541 = {
418424
CreatedOnToolsVersion = 9.0;
425+
LastSwiftMigration = 1130;
419426
ProvisioningStyle = Automatic;
420427
};
421428
};
@@ -426,6 +433,7 @@
426433
hasScannedForEncodings = 0;
427434
knownRegions = (
428435
en,
436+
Base,
429437
);
430438
mainGroup = 35BC9BC31F8669E400881541;
431439
productRefGroup = 35BC9BCE1F8669E400881541 /* Products */;
@@ -443,7 +451,6 @@
443451
isa = PBXResourcesBuildPhase;
444452
buildActionMask = 2147483647;
445453
files = (
446-
662C6A43212310B600274389 /* Info.plist in Resources */,
447454
);
448455
runOnlyForDeploymentPostprocessing = 0;
449456
};
@@ -531,13 +538,15 @@
531538
CLANG_WARN_BOOL_CONVERSION = YES;
532539
CLANG_WARN_COMMA = YES;
533540
CLANG_WARN_CONSTANT_CONVERSION = YES;
541+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
534542
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
535543
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
536544
CLANG_WARN_EMPTY_BODY = YES;
537545
CLANG_WARN_ENUM_CONVERSION = YES;
538546
CLANG_WARN_INFINITE_RECURSION = YES;
539547
CLANG_WARN_INT_CONVERSION = YES;
540548
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
549+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
541550
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
542551
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
543552
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -566,7 +575,7 @@
566575
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
567576
GCC_WARN_UNUSED_FUNCTION = YES;
568577
GCC_WARN_UNUSED_VARIABLE = YES;
569-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
578+
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
570579
MTL_ENABLE_DEBUG_INFO = YES;
571580
ONLY_ACTIVE_ARCH = YES;
572581
SDKROOT = iphoneos;
@@ -591,13 +600,15 @@
591600
CLANG_WARN_BOOL_CONVERSION = YES;
592601
CLANG_WARN_COMMA = YES;
593602
CLANG_WARN_CONSTANT_CONVERSION = YES;
603+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
594604
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
595605
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
596606
CLANG_WARN_EMPTY_BODY = YES;
597607
CLANG_WARN_ENUM_CONVERSION = YES;
598608
CLANG_WARN_INFINITE_RECURSION = YES;
599609
CLANG_WARN_INT_CONVERSION = YES;
600610
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
611+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
601612
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
602613
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
603614
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -620,7 +631,7 @@
620631
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
621632
GCC_WARN_UNUSED_FUNCTION = YES;
622633
GCC_WARN_UNUSED_VARIABLE = YES;
623-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
634+
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
624635
MTL_ENABLE_DEBUG_INFO = NO;
625636
SDKROOT = iphoneos;
626637
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
@@ -633,6 +644,7 @@
633644
35BC9BE21F8669E400881541 /* Debug */ = {
634645
isa = XCBuildConfiguration;
635646
buildSettings = {
647+
CLANG_LINK_OBJC_RUNTIME = NO;
636648
CODE_SIGN_IDENTITY = "";
637649
CODE_SIGN_STYLE = Automatic;
638650
DEFINES_MODULE = YES;
@@ -645,19 +657,21 @@
645657
);
646658
INFOPLIST_FILE = "$(SRCROOT)/Sources/SupportingFiles/Info.plist";
647659
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
648-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
660+
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
649661
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
662+
MARKETING_VERSION = 0.7.0;
650663
PRODUCT_BUNDLE_IDENTIFIER = ru.kolyasev.SwiftJSONRPC;
651664
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
652665
SKIP_INSTALL = YES;
653-
SWIFT_VERSION = 4.0;
666+
SWIFT_VERSION = 5.0;
654667
TARGETED_DEVICE_FAMILY = "1,2";
655668
};
656669
name = Debug;
657670
};
658671
35BC9BE31F8669E400881541 /* Release */ = {
659672
isa = XCBuildConfiguration;
660673
buildSettings = {
674+
CLANG_LINK_OBJC_RUNTIME = NO;
661675
CODE_SIGN_IDENTITY = "";
662676
CODE_SIGN_STYLE = Automatic;
663677
DEFINES_MODULE = YES;
@@ -670,12 +684,13 @@
670684
);
671685
INFOPLIST_FILE = "$(SRCROOT)/Sources/SupportingFiles/Info.plist";
672686
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
673-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
687+
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
674688
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
689+
MARKETING_VERSION = 0.7.0;
675690
PRODUCT_BUNDLE_IDENTIFIER = ru.kolyasev.SwiftJSONRPC;
676691
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
677692
SKIP_INSTALL = YES;
678-
SWIFT_VERSION = 4.0;
693+
SWIFT_VERSION = 5.0;
679694
TARGETED_DEVICE_FAMILY = "1,2";
680695
};
681696
name = Release;
@@ -689,7 +704,7 @@
689704
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
690705
PRODUCT_BUNDLE_IDENTIFIER = ru.kolyasev.SwiftJSONRPCTests;
691706
PRODUCT_NAME = "$(TARGET_NAME)";
692-
SWIFT_VERSION = 4.0;
707+
SWIFT_VERSION = 5.0;
693708
TARGETED_DEVICE_FAMILY = "1,2";
694709
};
695710
name = Debug;
@@ -703,7 +718,7 @@
703718
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
704719
PRODUCT_BUNDLE_IDENTIFIER = ru.kolyasev.SwiftJSONRPCTests;
705720
PRODUCT_NAME = "$(TARGET_NAME)";
706-
SWIFT_VERSION = 4.0;
721+
SWIFT_VERSION = 5.0;
707722
TARGETED_DEVICE_FAMILY = "1,2";
708723
};
709724
name = Release;

0 commit comments

Comments
 (0)