From d6792a267232c84f56b211f3c9abff7396b3efac Mon Sep 17 00:00:00 2001 From: Anders Bertelrud Date: Tue, 8 Jun 2021 18:29:43 -0700 Subject: [PATCH] [5.5] Extend the availability annotations for the Netrc support to cover all the Darwin platforms (#218) This extends the availability based on the version numbers in the annotation for `NSTextCheckingResult.range(withName name: String) -> NSRange`. Otherwise, ToolsSupportCore can no longer build on for example iOS, because the default minimum deployment targets for the various platforms are really old (e.g. iOS 9). (cherry picked from commit d6c996e9ab8565bbf9f2f9b3be35671ba32dcfe7) --- Sources/TSCUtility/Netrc.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/TSCUtility/Netrc.swift b/Sources/TSCUtility/Netrc.swift index 850b941c..53c3010c 100644 --- a/Sources/TSCUtility/Netrc.swift +++ b/Sources/TSCUtility/Netrc.swift @@ -24,9 +24,9 @@ extension AuthorizationProviding { #if os(macOS) /* Netrc feature depends upon `NSTextCheckingResult.range(withName name: String) -> NSRange`, - which is only available in macOS 10.13+ at this time. + which is only available in macOS 10.13+, iOS 11+, etc at this time. */ -@available (OSX 10.13, *) +@available (macOS 10.13, iOS 11, tvOS 11, watchOS 4, *) /// Container of parsed netrc connection settings public struct Netrc: AuthorizationProviding { /// Representation of `machine` connection settings & `default` connection settings. @@ -97,7 +97,7 @@ public struct Netrc: AuthorizationProviding { } } -@available (OSX 10.13, *) +@available (macOS 10.13, iOS 11, tvOS 11, watchOS 4, *) public extension Netrc { enum Error: Swift.Error { case invalidFilePath @@ -135,14 +135,14 @@ public extension Netrc { } } -@available (OSX 10.13, *) +@available (macOS 10.13, iOS 11, tvOS 11, watchOS 4, *) extension Netrc.Error: CustomNSError { public var errorUserInfo: [String : Any] { return [NSLocalizedDescriptionKey: "\(self)"] } } -@available (OSX 10.13, *) +@available (macOS 10.13, iOS 11, tvOS 11, watchOS 4, *) fileprivate enum RegexUtil { @frozen fileprivate enum Token: String, CaseIterable { case machine, login, password, account, macdef, `default`