Skip to content

Commit 8817ad5

Browse files
authored
Update minimum deployment target to macOS 13 (#7313)
1 parent 02f047a commit 8817ad5

File tree

7 files changed

+3
-35
lines changed

7 files changed

+3
-35
lines changed

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ let autoProducts = [swiftPMProduct, swiftPMDataModelProduct]
7676
let package = Package(
7777
name: "SwiftPM",
7878
platforms: [
79-
.macOS(.v12),
80-
.iOS(.v15)
79+
.macOS(.v13),
80+
.iOS(.v16)
8181
],
8282
products:
8383
autoProducts.flatMap {

Sources/Basics/FileSystem/TSCAdapters.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ public func withTemporaryDirectory<Result>(
5959
}
6060
}
6161

62-
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
6362
public func withTemporaryDirectory<Result>(
6463
dir: AbsolutePath? = nil, prefix: String = "TemporaryDirectory", removeTreeOnDeinit: Bool = false,
6564
_ body: (AbsolutePath) async throws -> Result

Sources/Basics/JSON+Extensions.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,7 @@ extension JSONEncoder {
114114
outputFormatting.insert(.prettyPrinted)
115115
}
116116
if !escapeSlashes {
117-
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
118-
if #available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) {
119-
outputFormatting.insert(.withoutEscapingSlashes)
120-
}
121-
#elseif compiler(>=5.3)
122117
outputFormatting.insert(.withoutEscapingSlashes)
123-
#endif
124118
}
125119

126120
encoder.outputFormatting = outputFormatting

Sources/PackageRegistryTool/PackageRegistryTool.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import PackageModel
1818
import PackageRegistry
1919
import Workspace
2020

21-
@available(macOS 10.15, macCatalyst 13, iOS 13, tvOS 13, watchOS 6, *)
2221
public struct SwiftPackageRegistryTool: AsyncParsableCommand {
2322
public static var configuration = CommandConfiguration(
2423
commandName: "package-registry",

Tests/BasicsTests/NetrcTests.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
import Basics
1414
import XCTest
1515

16-
/// Netrc feature depends upon `NSTextCheckingResult.range(withName name: String) -> NSRange`,
17-
/// which is only available in macOS 10.13+ at this time.
1816
class NetrcTests: XCTestCase {
1917
/// should load machines for a given inline format
2018
func testLoadMachinesInline() throws {

Tests/CommandsTests/TestToolTests.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,10 +286,6 @@ final class TestToolTests: CommandsTestCase {
286286
"Skipping \(#function) because swift-testing tests are not explicitly enabled"
287287
)
288288

289-
if #unavailable(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, visionOS 1.0) {
290-
throw XCTSkip("swift-testing unavailable")
291-
}
292-
293289
try fixture(name: "Miscellaneous/TestDiscovery/SwiftTesting") { fixturePath in
294290
do {
295291
let (stdout, _) = try SwiftPM.Test.execute(["--enable-experimental-swift-testing", "--disable-xctest"], packagePath: fixturePath)

Tests/SourceKitLSPAPITests/SourceKitLSPAPITests.swift

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -67,27 +67,9 @@ extension SourceKitLSPAPI.BuildDescription {
6767
}
6868

6969
let arguments = try buildTarget.compileArguments(for: file)
70-
let result = arguments.firstIndex(of: partialArguments) != nil
70+
let result = arguments.contains(partialArguments)
7171

7272
XCTAssertTrue(result, "could not match \(partialArguments) to actual arguments \(arguments)")
7373
return result
7474
}
7575
}
76-
77-
// Since 'contains' is only available in macOS SDKs 13.0 or newer, we need our own little implementation.
78-
extension RandomAccessCollection where Element: Equatable {
79-
fileprivate func firstIndex(of pattern: some RandomAccessCollection<Element>) -> Index? {
80-
guard !pattern.isEmpty && count >= pattern.count else {
81-
return nil
82-
}
83-
84-
var i = startIndex
85-
for _ in 0..<(count - pattern.count + 1) {
86-
if self[i...].starts(with: pattern) {
87-
return i
88-
}
89-
i = self.index(after: i)
90-
}
91-
return nil
92-
}
93-
}

0 commit comments

Comments
 (0)