Skip to content

Commit b235a89

Browse files
fix: change minimum supported ios version to 14 & fix Nimble issues
1 parent 8317c78 commit b235a89

File tree

11 files changed

+100
-82
lines changed

11 files changed

+100
-82
lines changed

Package.resolved

+38-40
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,41 @@
11
{
2-
"object": {
3-
"pins": [
4-
{
5-
"package": "CwlCatchException",
6-
"repositoryURL": "https://github.com/mattgallagher/CwlCatchException.git",
7-
"state": {
8-
"branch": null,
9-
"revision": "35f9e770f54ce62dd8526470f14c6e137cef3eea",
10-
"version": "2.1.1"
11-
}
12-
},
13-
{
14-
"package": "CwlPreconditionTesting",
15-
"repositoryURL": "https://github.com/mattgallagher/CwlPreconditionTesting.git",
16-
"state": {
17-
"branch": null,
18-
"revision": "c21f7bab5ca8eee0a9998bbd17ca1d0eb45d4688",
19-
"version": "2.1.0"
20-
}
21-
},
22-
{
23-
"package": "Nimble",
24-
"repositoryURL": "https://github.com/Quick/Nimble.git",
25-
"state": {
26-
"branch": null,
27-
"revision": "c93f16c25af5770f0d3e6af27c9634640946b068",
28-
"version": "9.2.1"
29-
}
30-
},
31-
{
32-
"package": "Quick",
33-
"repositoryURL": "https://github.com/Quick/Quick.git",
34-
"state": {
35-
"branch": null,
36-
"revision": "f9d519828bb03dfc8125467d8f7b93131951124c",
37-
"version": "5.0.1"
38-
}
2+
"pins" : [
3+
{
4+
"identity" : "cwlcatchexception",
5+
"kind" : "remoteSourceControl",
6+
"location" : "https://github.com/mattgallagher/CwlCatchException.git",
7+
"state" : {
8+
"revision" : "3ef6999c73b6938cc0da422f2c912d0158abb0a0",
9+
"version" : "2.2.0"
3910
}
40-
]
41-
},
42-
"version": 1
11+
},
12+
{
13+
"identity" : "cwlpreconditiontesting",
14+
"kind" : "remoteSourceControl",
15+
"location" : "https://github.com/mattgallagher/CwlPreconditionTesting.git",
16+
"state" : {
17+
"revision" : "2ef56b2caf25f55fa7eef8784c30d5a767550f54",
18+
"version" : "2.2.1"
19+
}
20+
},
21+
{
22+
"identity" : "nimble",
23+
"kind" : "remoteSourceControl",
24+
"location" : "https://github.com/Quick/Nimble.git",
25+
"state" : {
26+
"revision" : "831000dd1939bc2096df572c5fd156f41d858bfa",
27+
"version" : "12.1.0"
28+
}
29+
},
30+
{
31+
"identity" : "quick",
32+
"kind" : "remoteSourceControl",
33+
"location" : "https://github.com/Quick/Quick.git",
34+
"state" : {
35+
"revision" : "9913828ef3554e6cc1a57797c9f8dfd136c6c9d6",
36+
"version" : "7.1.0"
37+
}
38+
}
39+
],
40+
"version" : 2
4341
}

Podfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
workspace 'RSDKUtils.xcworkspace'
22
project 'RSDKUtils.xcodeproj'
33

4-
platform :ios, '12.0'
4+
platform :ios, '14.0'
55

66
use_frameworks!
77

Podfile.lock

+33-13
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
11
PODS:
2-
- Nimble (10.0.0)
2+
- CwlCatchException (2.2.0):
3+
- CwlCatchExceptionSupport (~> 2.2.0)
4+
- CwlCatchExceptionSupport (2.2.0)
5+
- CwlMachBadInstructionHandler (2.2.0)
6+
- CwlPosixPreconditionTesting (2.2.0)
7+
- CwlPreconditionTesting (2.2.1):
8+
- CwlCatchException (~> 2.2.0)
9+
- CwlMachBadInstructionHandler (~> 2.2.0)
10+
- CwlPosixPreconditionTesting (~> 2.2.0)
11+
- Nimble (13.3.0):
12+
- CwlPreconditionTesting (~> 2.2.0)
313
- Quick (5.0.1)
4-
- RSDKUtils (4.2.0):
5-
- RSDKUtils/Main (= 4.2.0)
6-
- RSDKUtils/Main (4.2.0):
14+
- RSDKUtils (4.2.0-sanpshot):
15+
- RSDKUtils/Main (= 4.2.0-sanpshot)
16+
- RSDKUtils/Main (4.2.0-sanpshot):
717
- RSDKUtils/RLogger
8-
- RSDKUtils/Nimble (4.2.0):
18+
- RSDKUtils/Nimble (4.2.0-sanpshot):
919
- Nimble
1020
- RSDKUtils/Main
11-
- RSDKUtils/REventLogger (4.2.0):
21+
- RSDKUtils/REventLogger (4.2.0-sanpshot):
1222
- RSDKUtils/Main
13-
- RSDKUtils/RLogger (4.2.0)
14-
- RSDKUtils/TestHelpers (4.2.0):
23+
- RSDKUtils/RLogger (4.2.0-sanpshot)
24+
- RSDKUtils/TestHelpers (4.2.0-sanpshot):
1525
- RSDKUtils/Main
16-
- SwiftLint (0.51.0)
26+
- SwiftLint (0.55.1)
1727

1828
DEPENDENCIES:
1929
- Nimble
@@ -27,6 +37,11 @@ DEPENDENCIES:
2737

2838
SPEC REPOS:
2939
trunk:
40+
- CwlCatchException
41+
- CwlCatchExceptionSupport
42+
- CwlMachBadInstructionHandler
43+
- CwlPosixPreconditionTesting
44+
- CwlPreconditionTesting
3045
- Nimble
3146
- Quick
3247
- SwiftLint
@@ -36,11 +51,16 @@ EXTERNAL SOURCES:
3651
:path: "./RSDKUtils.podspec"
3752

3853
SPEC CHECKSUMS:
39-
Nimble: 5316ef81a170ce87baf72dd961f22f89a602ff84
54+
CwlCatchException: 51bf8319009a31104ea6f0568730d1ecc25b6454
55+
CwlCatchExceptionSupport: 1345d6adb01a505933f2bc972dab60dcb9ce3e50
56+
CwlMachBadInstructionHandler: ea1030428925d9bf340882522af30712fb4bf356
57+
CwlPosixPreconditionTesting: a125dee731883f2582715f548c6b6c92c7fde145
58+
CwlPreconditionTesting: ccfd08aca58d14e04062b2a3dd2fd52e09857453
59+
Nimble: 3ac6c6b0b7e9835d1540b6507d8054b12a415536
4060
Quick: 749aa754fd1e7d984f2000fe051e18a3a9809179
41-
RSDKUtils: 4ef7a283108a78e879f335c788d78bbd5699f907
42-
SwiftLint: 1b7561918a19e23bfed960e40759086e70f4dba5
61+
RSDKUtils: 5ea71ba3d42b66fb3ae8934161acdbeb275a3d59
62+
SwiftLint: 3fe909719babe5537c552ee8181c0031392be933
4363

44-
PODFILE CHECKSUM: 8a4402b65acba7b2f575d044fe019c2be6438d7e
64+
PODFILE CHECKSUM: 9f29c14487bce601194343a3e0b8304e001bdd2d
4565

4666
COCOAPODS: 1.15.2

RSDKUtils.podspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
Pod::Spec.new do |s|
22
s.name = "RSDKUtils"
3-
s.version = "4.2.0"
3+
s.version = "4.2.0-sanpshot"
44
s.authors = "Rakuten Ecosystem Mobile"
55
s.summary = "Rakuten's SDK Team internal utilities module."
66
s.homepage = "https://github.com/rakutentech/ios-sdkutils"
77
s.license = { :type => 'MIT', :file => 'LICENSE' }
88
s.source = { :git => "https://github.com/rakutentech/ios-sdkutils.git", :tag => s.version.to_s }
99
s.platforms = { :ios => '14.0', :watchos => '6.0' }
10-
s.swift_versions = ['5.4', '5.5', 5.9]
10+
s.swift_versions = ['5.4', '5.5', '5.9']
1111
s.resources = ['Sources/Resources/PrivacyInfo.xcprivacy']
1212
s.requires_arc = true
1313
s.pod_target_xcconfig = {

RSDKUtils.xcodeproj/project.pbxproj

+2
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,7 @@
498498
BUNDLE_LOADER = "$(TEST_HOST)";
499499
CODE_SIGN_IDENTITY = "iPhone Developer";
500500
INFOPLIST_FILE = "Tests/Tests-Info.plist";
501+
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
501502
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
502503
SDKROOT = iphoneos;
503504
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator watchos watchsimulator";
@@ -515,6 +516,7 @@
515516
BUNDLE_LOADER = "$(TEST_HOST)";
516517
CODE_SIGN_IDENTITY = "iPhone Developer";
517518
INFOPLIST_FILE = "Tests/Tests-Info.plist";
519+
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
518520
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
519521
SDKROOT = iphoneos;
520522
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator watchos watchsimulator";

Sources/RSDKUtilsMain/AnalyticsBroadcaster.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public extension NSNotification.Name {
1515
/// - Parameter dataObject: Optional dictionary to pass in any other data to RAT.
1616
/// - Parameter customAccountNumber: When set, the event will be sent to this RAT account number instead of the one set in the app (optional).
1717
/// The value should be a positive integer.
18-
@objc public class func sendEventName(_ name: String, dataObject: [String: Any]? = nil, customAccountNumber: NSNumber? = nil) {
18+
@objc public static func sendEventName(_ name: String, dataObject: [String: Any]? = nil, customAccountNumber: NSNumber? = nil) {
1919
var parameters: [String: Any] = ["eventName": name]
2020
if let dataObject = dataObject {
2121
parameters["eventData"] = dataObject

Sources/RSDKUtilsMain/DependencyInjection/AnyDependenciesContainer.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ struct SwiftyDependenciesContainer<T: Equatable> {
5555

5656
/// Returns an instance for a given type
5757
/// @warning Returns the first found instance for a given type
58-
func resolve<T>(_ typeToResolve: T.Type) -> T? {
58+
func resolve<U>(_ typeToResolve: U.Type) -> U? {
5959
let result = elements.first {
60-
guard let element = $0 as? T else {
60+
guard let element = $0 as? U else {
6161
return false
6262
}
6363
return type(of: element) == typeToResolve
6464
}
6565

66-
return result as? T
66+
return result as? U
6767
}
6868
}

Sources/RSDKUtilsMain/Networking/Reachability.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public class Reachability: ReachabilityType {
125125
_ = unmanagedWeakSelf.retain()
126126
return UnsafeRawPointer(unmanagedWeakSelf.toOpaque())
127127
},
128-
release: { (info: UnsafeRawPointer) -> Void in
128+
release: { (info: UnsafeRawPointer) in
129129
let unmanagedWeakSelf = UnmanagedWeakSelf.fromOpaque(info)
130130
unmanagedWeakSelf.release()
131131
},

Sources/RSDKUtilsNimble/NimbleExtensions.swift

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import Foundation
22
import Nimble
33

4-
public extension Expectation {
4+
public extension SyncExpectation {
55

66
func toAfterTimeout(file: FileString = #file,
77
line: UInt = #line,
8-
_ predicate: Nimble.Predicate<T>,
8+
_ predicate: Nimble.Matcher<Value>,
99
timeout: TimeInterval = 1.0) {
1010

1111
let timeForExecution: TimeInterval = 1.0
@@ -20,7 +20,7 @@ public extension Expectation {
2020

2121
func toAfterTimeoutNot(file: FileString = #file,
2222
line: UInt = #line,
23-
_ predicate: Nimble.Predicate<T>,
23+
_ predicate: Nimble.Matcher<Value>,
2424
timeout: TimeInterval = 1.0) {
2525

2626
let timeForExecution: TimeInterval = 1.0
@@ -33,7 +33,7 @@ public extension Expectation {
3333
}
3434
}
3535

36-
private func evaluateExpression() throws -> T? {
36+
private func evaluateExpression() throws -> Value? {
3737
try self.expression.evaluate()
3838
}
3939
}
@@ -42,17 +42,17 @@ public extension Expectation {
4242
/// if they are not in the same order.
4343
public func elementsEqualOrderAgnostic<Col1: Collection, Col2: Collection>(
4444
_ expectedValue: Col2?
45-
) -> Nimble.Predicate<Col1> where Col1.Element: Equatable, Col1.Element == Col2.Element {
46-
return Predicate.define("elementsEqualOrderAgnostic <\(stringify(expectedValue))>") { (actualExpression, msg) in
45+
) -> Nimble.Matcher<Col1> where Col1.Element: Equatable, Col1.Element == Col2.Element {
46+
return Matcher.define("elementsEqualOrderAgnostic <\(stringify(expectedValue))>") { (actualExpression, msg) in
4747
let actualValue = try actualExpression.evaluate()
4848
switch (expectedValue, actualValue) {
4949
case (nil, _?):
50-
return PredicateResult(status: .fail, message: msg.appendedBeNilHint())
50+
return MatcherResult(status: .fail, message: msg.appendedBeNilHint())
5151
case (nil, nil), (_, nil):
52-
return PredicateResult(status: .fail, message: msg)
52+
return MatcherResult(status: .fail, message: msg)
5353
case (let expected?, let actual?):
5454
let matches = expected.count == actual.count && expected.allSatisfy { actual.contains($0) }
55-
return PredicateResult(bool: matches, message: msg)
55+
return MatcherResult(bool: matches, message: msg)
5656
}
5757
}
5858
}

Sources/RSDKUtilsTestHelpers/URLSessionMock.swift

+1-3
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,7 @@ public final class URLSessionMock: URLSession {
8686
}
8787
return "\"\(item.name)\": \"\(value)\""
8888
}.compactMap { $0 }
89-
guard let jsonData = "{\(array.joined(separator: ","))}".data(using: .utf8) else {
90-
return nil
91-
}
89+
let jsonData = Data("{\(array.joined(separator: ","))}".utf8)
9290
return try? JSONDecoder().decode(modelType.self, from: jsonData)
9391
}
9492

Tests/Tests/URLSessionMockSpec.swift

+9-9
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ final class URLSessionMockSpec: QuickSpec {
157157
httpVersion: nil,
158158
headerFields: nil)
159159
let expectedError = NSError(domain: "mock.domain", code: 1234, userInfo: ["user": "info"])
160-
let expectedData = "data".data(using: .utf8)
160+
let expectedData = Data("data".utf8)
161161
sessionMock.httpResponse = expectedResponse
162162
sessionMock.responseError = expectedError
163163
sessionMock.responseData = expectedData
@@ -200,9 +200,9 @@ final class URLSessionMockSpec: QuickSpec {
200200
context("when calling decodeSentData()") {
201201

202202
it("should succeed if all expected parameters are present") {
203-
let jsonData = """
203+
let jsonData = Data("""
204204
{"identifier":100, "isTest":true, "appVersion":"1.2.3", "sdkVersion":"0.0.5"}
205-
""".data(using: .utf8)!
205+
""".utf8)
206206

207207
var request = URLRequest(url: URL(string: "https://google.com")!)
208208
request.httpBody = jsonData
@@ -221,9 +221,9 @@ final class URLSessionMockSpec: QuickSpec {
221221
}
222222

223223
it("should succeed if there are optional parameters in the json") {
224-
let jsonData = """
224+
let jsonData = Data("""
225225
{"identifier":100, "isTest":true, "appVersion":"1.2.3", "sdkVersion":"0.0.5", "locale":"pl"}
226-
""".data(using: .utf8)!
226+
""".utf8)
227227

228228
var request = URLRequest(url: URL(string: "https://google.com")!)
229229
request.httpBody = jsonData
@@ -242,9 +242,9 @@ final class URLSessionMockSpec: QuickSpec {
242242
}
243243

244244
it("should fail if not all expected parameters are present") {
245-
let jsonData = """
245+
let jsonData = Data("""
246246
{"identifier":100, "isTest":true, "appVersion":"1.2.3"}
247-
""".data(using: .utf8)!
247+
""".utf8)
248248

249249
var request = URLRequest(url: URL(string: "https://google.com")!)
250250
request.httpBody = jsonData
@@ -259,9 +259,9 @@ final class URLSessionMockSpec: QuickSpec {
259259
}
260260

261261
it("should fail if parameter type does not match") {
262-
let jsonData = """
262+
let jsonData = Data("""
263263
{"identifier":"id", "isTest":true, "appVersion":"1.2.3", "sdkVersion":"0.0.5"}
264-
""".data(using: .utf8)!
264+
""".utf8)
265265

266266
var request = URLRequest(url: URL(string: "https://google.com")!)
267267
request.httpBody = jsonData

0 commit comments

Comments
 (0)