Skip to content

Commit 88ba364

Browse files
Merge pull request #1605 from apollographql/drop/ios-9-thru-11
Drop iOS/tvOS 9-11, watchOS 3-4, macOS 10.10-10.13 support
2 parents 57a722e + 56d2402 commit 88ba364

13 files changed

Lines changed: 63 additions & 293 deletions

Apollo.podspec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ Pod::Spec.new do |s|
1515

1616
s.default_subspecs = 'Core'
1717

18-
s.ios.deployment_target = '9.0'
19-
s.osx.deployment_target = '10.10'
20-
s.tvos.deployment_target = '9.1'
21-
s.watchos.deployment_target = '3.0'
18+
s.ios.deployment_target = '12.0'
19+
s.osx.deployment_target = '10.14'
20+
s.tvos.deployment_target = '12.0'
21+
s.watchos.deployment_target = '5.0'
2222

2323
s.subspec 'Core' do |ss|
2424
ss.source_files = 'Sources/Apollo/*.swift','Sources/ApolloCore/*.swift'

Apollo.xcodeproj/project.pbxproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@
194194
9F27D4641D40379500715680 /* JSONStandardTypeConversions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F27D4631D40379500715680 /* JSONStandardTypeConversions.swift */; };
195195
9F295E311E27534800A24949 /* NormalizeQueryResults.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F295E301E27534800A24949 /* NormalizeQueryResults.swift */; };
196196
9F295E381E277B2A00A24949 /* GraphQLResultNormalizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F295E371E277B2A00A24949 /* GraphQLResultNormalizer.swift */; };
197-
9F30F02F255EDF8900506DE7 /* DispatchPreconditions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F30F02E255EDF8900506DE7 /* DispatchPreconditions.swift */; };
198197
9F39101725493DDC00AF54A6 /* FetchQueryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FA6ABC51EC0A9F7000017BE /* FetchQueryTests.swift */; };
199198
9F3910272549741400AF54A6 /* MockGraphQLServer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F3910262549741400AF54A6 /* MockGraphQLServer.swift */; };
200199
9F438D071E6C2FD9007BDC1A /* Apollo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FC750441D2A532C00458D91 /* Apollo.framework */; };
@@ -740,7 +739,6 @@
740739
9F27D4631D40379500715680 /* JSONStandardTypeConversions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JSONStandardTypeConversions.swift; sourceTree = "<group>"; };
741740
9F295E301E27534800A24949 /* NormalizeQueryResults.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NormalizeQueryResults.swift; sourceTree = "<group>"; };
742741
9F295E371E277B2A00A24949 /* GraphQLResultNormalizer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GraphQLResultNormalizer.swift; sourceTree = "<group>"; };
743-
9F30F02E255EDF8900506DE7 /* DispatchPreconditions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DispatchPreconditions.swift; sourceTree = "<group>"; };
744742
9F33D6A32566475600A1543F /* PossiblyDeferred.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PossiblyDeferred.swift; sourceTree = "<group>"; };
745743
9F3910262549741400AF54A6 /* MockGraphQLServer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockGraphQLServer.swift; sourceTree = "<group>"; };
746744
9F438D0B1E6C494C007BDC1A /* BatchedLoadTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BatchedLoadTests.swift; sourceTree = "<group>"; };
@@ -1193,7 +1191,6 @@
11931191
isa = PBXGroup;
11941192
children = (
11951193
9B6CB23D238077B60007259D /* Atomic.swift */,
1196-
9F30F02E255EDF8900506DE7 /* DispatchPreconditions.swift */,
11971194
9B68F06E241C649E00E97318 /* GraphQLOptional.swift */,
11981195
9B455CE82492D0A7002255A9 /* Extensions */,
11991196
);
@@ -2418,7 +2415,6 @@
24182415
9B455CE52492D0A3002255A9 /* ApolloExtension.swift in Sources */,
24192416
9B455CEB2492FB03002255A9 /* String+SHA.swift in Sources */,
24202417
9B455CE62492D0A3002255A9 /* OptionalBoolean.swift in Sources */,
2421-
9F30F02F255EDF8900506DE7 /* DispatchPreconditions.swift in Sources */,
24222418
9B455CDF2492D05E002255A9 /* Atomic.swift in Sources */,
24232419
9B455CE72492D0A3002255A9 /* Collection+Apollo.swift in Sources */,
24242420
);

Configuration/Shared/Workspace-Deployment-Targets.xcconfig

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// Base Deployment Targets
2-
IPHONEOS_DEPLOYMENT_TARGET = 9.0
3-
MACOSX_DEPLOYMENT_TARGET = 10.10
4-
TVOS_DEPLOYMENT_TARGET = 9.1
5-
WATCHOS_DEPLOYMENT_TARGET = 3.0
2+
IPHONEOS_DEPLOYMENT_TARGET = 12.0
3+
MACOSX_DEPLOYMENT_TARGET = 10.14
4+
TVOS_DEPLOYMENT_TARGET = 12.0
5+
WATCHOS_DEPLOYMENT_TARGET = 5.0
66

7-
WARNING_CFLAGS[sdk=iphone*] = $(inherited) -DAPI_TO_BE_DEPRECATED=8_0
8-
WARNING_CFLAGS[sdk=macosx*] = $(inherited) -DAPI_TO_BE_DEPRECATED=10_10
9-
WARNING_CFLAGS[sdk=tvos*] = $(inherited) -DAPI_TO_BE_DEPRECATED=9_1
10-
WARNING_CFLAGS[sdk=watchos*] = $(inherited) -DAPI_TO_BE_DEPRECATED=3_0
7+
WARNING_CFLAGS[sdk=iphone*] = $(inherited) -DAPI_TO_BE_DEPRECATED=12_0
8+
WARNING_CFLAGS[sdk=macosx*] = $(inherited) -DAPI_TO_BE_DEPRECATED=10_14
9+
WARNING_CFLAGS[sdk=tvos*] = $(inherited) -DAPI_TO_BE_DEPRECATED=12_0
10+
WARNING_CFLAGS[sdk=watchos*] = $(inherited) -DAPI_TO_BE_DEPRECATED=5_0
1111

1212
// macOS-specific default settings
1313
COMBINE_HIDPI_IMAGES[sdk=macosx*] = YES

Package.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ import PackageDescription
55

66
let package = Package(
77
name: "Apollo",
8+
platforms: [
9+
.iOS(.v12),
10+
.macOS(.v10_14),
11+
.tvOS(.v12),
12+
.watchOS(.v5)
13+
],
814
products: [
915
.library(
1016
name: "ApolloCore",

Sources/Apollo/GraphQLGETTransformer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public struct GraphQLGETTransformer {
2828
do {
2929
_ = try self.body.sorted(by: {$0.key < $1.key}).compactMap({ arg in
3030
if let value = arg.value as? GraphQLMap {
31-
let data = try JSONSerialization.dataSortedIfPossible(withJSONObject: value.jsonValue)
31+
let data = try JSONSerialization.sortedData(withJSONObject: value.jsonValue)
3232
if let string = String(data: data, encoding: .utf8) {
3333
queryItems.append(URLQueryItem(name: arg.key, value: string))
3434
}

Sources/Apollo/JSONSerialization+Sorting.swift

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,12 @@ import Foundation
22

33
extension JSONSerialization {
44

5-
/// Uses `sortedKeys` to create a stable representation of JSON objects when the operating system supports it.
5+
/// Uses `sortedKeys` to create a stable representation of JSON objects.
66
///
77
/// - Parameter object: The object to serialize
88
/// - Returns: The serialized data
99
/// - Throws: Errors related to the serialization of data.
10-
static func dataSortedIfPossible(withJSONObject object: Any) throws -> Data {
11-
// The `sortedKeys` option is not available on all platforms we
12-
// presently support, but we should use it where we can in
13-
// order to get stable JSON representations, especially if being
14-
// used in queries.
15-
if #available(iOS 11, macOS 10.13, watchOS 4, tvOS 11, *) {
16-
return try self.data(withJSONObject: object, options: [.sortedKeys])
17-
} else {
18-
return try self.data(withJSONObject: object)
19-
}
20-
}
21-
22-
/// Wrapper function so we don't have to scatter `if #available` all over the codebase to see if data can be sorted.
23-
static func dataCanBeSorted() -> Bool {
24-
if #available(iOS 11, macOS 10.13, watchOS 4, tvOS 11, *) {
25-
return true
26-
} else {
27-
return false
28-
}
10+
static func sortedData(withJSONObject object: Any) throws -> Data {
11+
return try self.data(withJSONObject: object, options: [.sortedKeys])
2912
}
3013
}

Sources/Apollo/JSONSerializationFormat.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Foundation
22

33
public final class JSONSerializationFormat {
44
public class func serialize(value: JSONEncodable) throws -> Data {
5-
return try JSONSerialization.dataSortedIfPossible(withJSONObject: value.jsonValue)
5+
return try JSONSerialization.sortedData(withJSONObject: value.jsonValue)
66
}
77

88
public class func deserialize(data: Data) throws -> JSONValue {

Sources/Apollo/URLSessionClient.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ open class URLSessionClient: NSObject, URLSessionDelegate, URLSessionTaskDelegat
154154
self.clearAllTasks()
155155
}
156156

157-
@available(OSX 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *)
158157
open func urlSession(_ session: URLSession,
159158
task: URLSessionTask,
160159
didFinishCollecting metrics: URLSessionTaskMetrics) {
@@ -234,7 +233,6 @@ open class URLSessionClient: NSObject, URLSessionDelegate, URLSessionTaskDelegat
234233
// No default implementation
235234
}
236235

237-
@available(iOS 11.0, OSXApplicationExtension 10.13, OSX 10.13, tvOS 11.0, watchOS 4.0, *)
238236
open func urlSession(_ session: URLSession,
239237
task: URLSessionTask,
240238
willBeginDelayedRequest request: URLRequest,
@@ -265,7 +263,6 @@ open class URLSessionClient: NSObject, URLSessionDelegate, URLSessionTaskDelegat
265263
}
266264
}
267265

268-
@available(iOS 9.0, OSXApplicationExtension 10.11, OSX 10.11, *)
269266
open func urlSession(_ session: URLSession,
270267
dataTask: URLSessionDataTask,
271268
didBecome streamTask: URLSessionStreamTask) {

Sources/ApolloCodegenLib/Basher.swift

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,10 @@ public struct Basher {
3737
]
3838
task.launchPath = "/bin/bash"
3939

40-
if #available(OSX 10.13, *) {
41-
if let url = url {
42-
task.currentDirectoryURL = url
43-
}
44-
try task.run()
45-
} else {
46-
if let path = url?.path {
47-
task.currentDirectoryPath = path
48-
}
49-
task.launch()
40+
if let url = url {
41+
task.currentDirectoryURL = url
5042
}
43+
try task.run()
5144

5245
task.waitUntilExit()
5346

Sources/ApolloCore/DispatchPreconditions.swift

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)