From 3e4729d397d98520a87c681bfc85a0171b846e3e Mon Sep 17 00:00:00 2001 From: noppe Date: Sun, 17 Jan 2021 03:00:40 +0900 Subject: [PATCH 1/3] Change iOS deployment target for Xcode 12 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This removes the warning about iOS 8 no longer being supported in Xcode 12 while maintaining support for older versions of Xcode. Technically checking the compiler version isn’t an exact 1:1 for checking for Xcode version, but in practice should work in all scenarios. --- Package.swift | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Package.swift b/Package.swift index 9ce875e0..53cfe938 100644 --- a/Package.swift +++ b/Package.swift @@ -1,11 +1,22 @@ // swift-tools-version:5.0 import PackageDescription +var platforms: [SupportedPlatform] { + #if compiler(<5.3) + return [ + .macOS(.v10_10), .iOS(.v8), .tvOS(.v9), .watchOS(.v2) + ] + #else + // Xcode 12 (which ships with Swift 5.3) drops support for iOS 8 + return [ + .macOS(.v10_10), .iOS(.v9), .tvOS(.v9), .watchOS(.v2) + ] + #endif +} + let package = Package( name: "APIKit", - platforms: [ - .macOS(.v10_10), .iOS(.v8), .tvOS(.v9), .watchOS(.v2) - ], + platforms: platforms, products: [ .library(name: "APIKit", targets: ["APIKit"]), ], From c3562f37db2bc7cd3c4e6d12b354cb1d7e6ce9a2 Mon Sep 17 00:00:00 2001 From: Econa77 Date: Sat, 1 Jan 2022 11:48:36 +0900 Subject: [PATCH 2/3] Change iOS deployment target version --- Package.swift | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/Package.swift b/Package.swift index 53cfe938..a9bf0445 100644 --- a/Package.swift +++ b/Package.swift @@ -1,22 +1,11 @@ // swift-tools-version:5.0 import PackageDescription -var platforms: [SupportedPlatform] { - #if compiler(<5.3) - return [ - .macOS(.v10_10), .iOS(.v8), .tvOS(.v9), .watchOS(.v2) - ] - #else - // Xcode 12 (which ships with Swift 5.3) drops support for iOS 8 - return [ - .macOS(.v10_10), .iOS(.v9), .tvOS(.v9), .watchOS(.v2) - ] - #endif -} - let package = Package( name: "APIKit", - platforms: platforms, + platforms: [ + .macOS(.v10_10), .iOS(.v9), .tvOS(.v9), .watchOS(.v2) + ], products: [ .library(name: "APIKit", targets: ["APIKit"]), ], From 2292b02513c676826f479fd96054fdaab7c29e94 Mon Sep 17 00:00:00 2001 From: Econa77 Date: Sat, 1 Jan 2022 11:57:20 +0900 Subject: [PATCH 3/3] Also supported for CocoaPods and Carthage --- APIKit.podspec | 2 +- Configurations/Base.xcconfig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/APIKit.podspec b/APIKit.podspec index df51df1f..908cfadd 100644 --- a/APIKit.podspec +++ b/APIKit.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| "Yosuke Ishikawa" => "y@ishkawa.org" } - s.ios.deployment_target = "8.0" + s.ios.deployment_target = "9.0" s.osx.deployment_target = "10.10" if s.respond_to?(:watchos) s.watchos.deployment_target = "2.0" diff --git a/Configurations/Base.xcconfig b/Configurations/Base.xcconfig index cf59d8cd..3a036335 100644 --- a/Configurations/Base.xcconfig +++ b/Configurations/Base.xcconfig @@ -27,6 +27,6 @@ VERSIONING_SYSTEM = apple-generic CODE_SIGNING_REQUIRED = NO CODE_SIGN_IDENTITY = MACOSX_DEPLOYMENT_TARGET = 10.10 -IPHONEOS_DEPLOYMENT_TARGET = 8.0 +IPHONEOS_DEPLOYMENT_TARGET = 9.0 WATCHOS_DEPLOYMENT_TARGET = 2.0 TVOS_DEPLOYMENT_TARGET = 9.0