Skip to content

Commit

Permalink
Bump Deployment Targets (#3717)
Browse files Browse the repository at this point in the history
### Issue Link 🔗
#3716

### Goals ⚽
This PR bumps the deployment targets to the iOS 11 generation to fix
issues when using Xcode 14.3.

### Implementation Details 🚧
Deployment target bumps and removal of relevant conditionals.
  • Loading branch information
jshier committed May 9, 2023
1 parent 0a4e521 commit e065ed9
Show file tree
Hide file tree
Showing 15 changed files with 81 additions and 54 deletions.
8 changes: 4 additions & 4 deletions Alamofire.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ Pod::Spec.new do |s|
s.source = { :git => 'https://github.com/Alamofire/Alamofire.git', :tag => s.version }
s.documentation_url = 'https://alamofire.github.io/Alamofire/'

s.ios.deployment_target = '10.0'
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '10.0'
s.watchos.deployment_target = '3.0'
s.ios.deployment_target = '11.0'
s.osx.deployment_target = '10.13'
s.tvos.deployment_target = '11.0'
s.watchos.deployment_target = '4.0'

s.swift_versions = ['5']

Expand Down
16 changes: 8 additions & 8 deletions Alamofire.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2090,8 +2090,8 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = Source/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MACOSX_DEPLOYMENT_TARGET = 10.12;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 5.6.4;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = (
Expand All @@ -2103,9 +2103,9 @@
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 5.0;
TVOS_DEPLOYMENT_TARGET = 10.0;
TVOS_DEPLOYMENT_TARGET = 11.0;
VERSIONING_SYSTEM = "apple-generic";
WATCHOS_DEPLOYMENT_TARGET = 3.0;
WATCHOS_DEPLOYMENT_TARGET = 4.0;
};
name = Debug;
};
Expand Down Expand Up @@ -2156,8 +2156,8 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = Source/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MACOSX_DEPLOYMENT_TARGET = 10.12;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 5.6.4;
OTHER_LDFLAGS = (
"-framework",
Expand All @@ -2169,10 +2169,10 @@
SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 5.0;
TVOS_DEPLOYMENT_TARGET = 10.0;
TVOS_DEPLOYMENT_TARGET = 11.0;
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
WATCHOS_DEPLOYMENT_TARGET = 3.0;
WATCHOS_DEPLOYMENT_TARGET = 4.0;
};
name = Release;
};
Expand Down
16 changes: 8 additions & 8 deletions Example/iOS Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -409,16 +409,16 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MACOSX_DEPLOYMENT_TARGET = 10.12;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MACOSX_DEPLOYMENT_TARGET = 10.13;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TVOS_DEPLOYMENT_TARGET = 10.0;
WATCHOS_DEPLOYMENT_TARGET = 3.0;
TVOS_DEPLOYMENT_TARGET = 11.0;
WATCHOS_DEPLOYMENT_TARGET = 4.0;
};
name = Debug;
};
Expand Down Expand Up @@ -462,16 +462,16 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MACOSX_DEPLOYMENT_TARGET = 10.12;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MACOSX_DEPLOYMENT_TARGET = 10.13;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TVOS_DEPLOYMENT_TARGET = 10.0;
TVOS_DEPLOYMENT_TARGET = 11.0;
VALIDATE_PRODUCT = YES;
WATCHOS_DEPLOYMENT_TARGET = 3.0;
WATCHOS_DEPLOYMENT_TARGET = 4.0;
};
name = Release;
};
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.7
// swift-tools-version:5.8
//
// Package.swift
//
Expand Down
8 changes: 4 additions & 4 deletions Package@swift-5.5.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
import PackageDescription

let package = Package(name: "Alamofire",
platforms: [.macOS(.v10_12),
.iOS(.v10),
.tvOS(.v10),
.watchOS(.v3)],
platforms: [.macOS(.v10_13),
.iOS(.v11),
.tvOS(.v11),
.watchOS(.v4)],
products: [.library(name: "Alamofire",
targets: ["Alamofire"])],
targets: [.target(name: "Alamofire",
Expand Down
8 changes: 4 additions & 4 deletions Package@swift-5.6.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
import PackageDescription

let package = Package(name: "Alamofire",
platforms: [.macOS(.v10_12),
.iOS(.v10),
.tvOS(.v10),
.watchOS(.v3)],
platforms: [.macOS(.v10_13),
.iOS(.v11),
.tvOS(.v11),
.watchOS(.v4)],
products: [.library(name: "Alamofire",
targets: ["Alamofire"])],
targets: [.target(name: "Alamofire",
Expand Down
48 changes: 48 additions & 0 deletions Package@swift-5.7.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// swift-tools-version:5.7
//
// Package.swift
//
// Copyright (c) 2022 Alamofire Software Foundation (http://alamofire.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//

import PackageDescription

let package = Package(name: "Alamofire",
platforms: [.macOS(.v10_13),
.iOS(.v11),
.tvOS(.v11),
.watchOS(.v4)],
products: [.library(name: "Alamofire",
targets: ["Alamofire"])],
targets: [.target(name: "Alamofire",
path: "Source",
exclude: ["Info.plist"],
linkerSettings: [.linkedFramework("CFNetwork",
.when(platforms: [.iOS,
.macOS,
.tvOS,
.watchOS]))]),
.testTarget(name: "AlamofireTests",
dependencies: ["Alamofire"],
path: "Tests",
exclude: ["Info.plist", "Test Plans"],
resources: [.process("Resources")])],
swiftLanguageVersions: [.v5])
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![Alamofire: Elegant Networking in Swift](https://raw.githubusercontent.com/Alamofire/Alamofire/master/Resources/AlamofireLogo.png)

[![Swift](https://img.shields.io/badge/Swift-5.3_5.4_5.5_5.6-orange?style=flat-square)](https://img.shields.io/badge/Swift-5.3_5.4_5.5_5.6-Orange?style=flat-square)
[![Swift](https://img.shields.io/badge/Swift-5.5_5.6_5.7_5.8-orange?style=flat-square)](https://img.shields.io/badge/Swift-5.5_5.6_5.7_5.8-Orange?style=flat-square)
[![Platforms](https://img.shields.io/badge/Platforms-macOS_iOS_tvOS_watchOS_Linux_Windows-yellowgreen?style=flat-square)](https://img.shields.io/badge/Platforms-macOS_iOS_tvOS_watchOS_Linux_Windows-Green?style=flat-square)
[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/Alamofire.svg?style=flat-square)](https://img.shields.io/cocoapods/v/Alamofire.svg)
[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat-square)](https://github.com/Carthage/Carthage)
Expand Down Expand Up @@ -63,7 +63,7 @@ In order to keep Alamofire focused specifically on core networking implementatio

| Platform | Minimum Swift Version | Installation | Status |
| --- | --- | --- | --- |
| iOS 10.0+ / macOS 10.12+ / tvOS 10.0+ / watchOS 3.0+ | 5.3 | [CocoaPods](#cocoapods), [Carthage](#carthage), [Swift Package Manager](#swift-package-manager), [Manual](#manually) | Fully Tested |
| iOS 11.0+ / macOS 10.13+ / tvOS 11.0+ / watchOS 4.0+ | 5.5 | [CocoaPods](#cocoapods), [Carthage](#carthage), [Swift Package Manager](#swift-package-manager), [Manual](#manually) | Fully Tested |
| Linux | Latest Only | [Swift Package Manager](#swift-package-manager) | Building But Unsupported |
| Windows | Latest Only | [Swift Package Manager](#swift-package-manager) | Building But Unsupported |

Expand Down
2 changes: 0 additions & 2 deletions Source/EventMonitor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public protocol EventMonitor {
func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?)

/// Event called during `URLSessionTaskDelegate`'s `urlSession(_:taskIsWaitingForConnectivity:)` method.
@available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *)
func urlSession(_ session: URLSession, taskIsWaitingForConnectivity task: URLSessionTask)

// MARK: URLSessionDataDelegate Events
Expand Down Expand Up @@ -376,7 +375,6 @@ public final class CompositeEventMonitor: EventMonitor {
performEvent { $0.urlSession(session, task: task, didCompleteWithError: error) }
}

@available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *)
public func urlSession(_ session: URLSession, taskIsWaitingForConnectivity task: URLSessionTask) {
performEvent { $0.urlSession(session, taskIsWaitingForConnectivity: task) }
}
Expand Down
9 changes: 1 addition & 8 deletions Source/HTTPHeaders.swift
Original file line number Diff line number Diff line change
Expand Up @@ -355,14 +355,7 @@ extension HTTPHeader {
///
/// See the [Accept-Encoding HTTP header documentation](https://tools.ietf.org/html/rfc7230#section-4.2.3) .
public static let defaultAcceptEncoding: HTTPHeader = {
let encodings: [String]
if #available(iOS 11.0, macOS 10.13, tvOS 11.0, watchOS 4.0, *) {
encodings = ["br", "gzip", "deflate"]
} else {
encodings = ["gzip", "deflate"]
}

return .acceptEncoding(encodings.qualityEncoded())
.acceptEncoding(["br", "gzip", "deflate"].qualityEncoded())
}()

/// Returns Alamofire's default `Accept-Language` header, generated by querying `Locale` for the user's
Expand Down
1 change: 0 additions & 1 deletion Source/ParameterEncoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ open class JSONParameterEncoder: ParameterEncoder {
}

/// Returns an encoder with `JSONEncoder.outputFormatting` set to `.sortedKeys`.
@available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *)
public static var sortedKeys: JSONParameterEncoder {
let encoder = JSONEncoder()
encoder.outputFormatting = .sortedKeys
Expand Down
4 changes: 0 additions & 4 deletions Source/ServerTrustEvaluation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -704,15 +704,11 @@ extension AlamofireExtension where ExtendedType == SecCertificate {

guard let createdTrust = trust, trustCreationStatus == errSecSuccess else { return nil }

#if swift(>=5.3.1) // SecTrustCopyKey not visible in Xcode <= 12.1, despite being a 2020 API.
if #available(iOS 14, macOS 11, tvOS 14, watchOS 7, *) {
return SecTrustCopyKey(createdTrust)
} else {
return SecTrustCopyPublicKey(createdTrust)
}
#else
return SecTrustCopyPublicKey(createdTrust)
#endif
}
}

Expand Down
1 change: 0 additions & 1 deletion Source/SessionDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ extension SessionDelegate: URLSessionTaskDelegate {
}
}

@available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *)
open func urlSession(_ session: URLSession, taskIsWaitingForConnectivity task: URLSessionTask) {
eventMonitor?.urlSession(session, taskIsWaitingForConnectivity: task)
}
Expand Down
1 change: 0 additions & 1 deletion Tests/ParameterEncoderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ final class JSONParameterEncoderTests: BaseTestCase {

final class SortedKeysJSONParameterEncoderTests: BaseTestCase {
func testTestJSONEncoderSortedKeysHasSortedKeys() throws {
guard #available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) else { return }
// Given
let encoder = JSONParameterEncoder.sortedKeys
let request = Endpoint().urlRequest
Expand Down
7 changes: 1 addition & 6 deletions Tests/SessionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -359,12 +359,7 @@ final class SessionTestCase: BaseTestCase {
waitForExpectations(timeout: timeout)

// Then
if #available(iOS 11.0, macOS 10.13, tvOS 11.0, watchOS 4.0, *) {
XCTAssertTrue(brotliResponse?.result.isSuccess == true)
} else {
XCTAssertTrue(brotliResponse?.result.isFailure == true)
}

XCTAssertTrue(brotliResponse?.result.isSuccess == true)
XCTAssertTrue(gzipResponse?.result.isSuccess == true)
XCTAssertTrue(deflateResponse?.result.isSuccess == true)
}
Expand Down

0 comments on commit e065ed9

Please sign in to comment.