Skip to content

Update minimum deployment target to macOS 13 #7313

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ let autoProducts = [swiftPMProduct, swiftPMDataModelProduct]
let package = Package(
name: "SwiftPM",
platforms: [
.macOS(.v12),
.iOS(.v15)
.macOS(.v13),
.iOS(.v16)
],
products:
autoProducts.flatMap {
Expand Down
1 change: 0 additions & 1 deletion Sources/Basics/FileSystem/TSCAdapters.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ public func withTemporaryDirectory<Result>(
}
}

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
public func withTemporaryDirectory<Result>(
dir: AbsolutePath? = nil, prefix: String = "TemporaryDirectory", removeTreeOnDeinit: Bool = false,
_ body: (AbsolutePath) async throws -> Result
Expand Down
6 changes: 0 additions & 6 deletions Sources/Basics/JSON+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,7 @@ extension JSONEncoder {
outputFormatting.insert(.prettyPrinted)
}
if !escapeSlashes {
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
if #available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) {
outputFormatting.insert(.withoutEscapingSlashes)
}
#elseif compiler(>=5.3)
outputFormatting.insert(.withoutEscapingSlashes)
#endif
}

encoder.outputFormatting = outputFormatting
Expand Down
1 change: 0 additions & 1 deletion Sources/PackageRegistryTool/PackageRegistryTool.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import PackageModel
import PackageRegistry
import Workspace

@available(macOS 10.15, macCatalyst 13, iOS 13, tvOS 13, watchOS 6, *)
public struct SwiftPackageRegistryTool: AsyncParsableCommand {
public static var configuration = CommandConfiguration(
commandName: "package-registry",
Expand Down
2 changes: 0 additions & 2 deletions Tests/BasicsTests/NetrcTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
import Basics
import XCTest

/// Netrc feature depends upon `NSTextCheckingResult.range(withName name: String) -> NSRange`,
/// which is only available in macOS 10.13+ at this time.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment seems like something that was here explaining an availability or #if statement, but that doesn't exist here anymore.

class NetrcTests: XCTestCase {
/// should load machines for a given inline format
func testLoadMachinesInline() throws {
Expand Down
4 changes: 0 additions & 4 deletions Tests/CommandsTests/TestToolTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,6 @@ final class TestToolTests: CommandsTestCase {
"Skipping \(#function) because swift-testing tests are not explicitly enabled"
)

if #unavailable(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, visionOS 1.0) {
throw XCTSkip("swift-testing unavailable")
}

try fixture(name: "Miscellaneous/TestDiscovery/SwiftTesting") { fixturePath in
do {
let (stdout, _) = try SwiftPM.Test.execute(["--enable-experimental-swift-testing", "--disable-xctest"], packagePath: fixturePath)
Expand Down
20 changes: 1 addition & 19 deletions Tests/SourceKitLSPAPITests/SourceKitLSPAPITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,27 +67,9 @@ extension SourceKitLSPAPI.BuildDescription {
}

let arguments = try buildTarget.compileArguments(for: file)
let result = arguments.firstIndex(of: partialArguments) != nil
let result = arguments.contains(partialArguments)

XCTAssertTrue(result, "could not match \(partialArguments) to actual arguments \(arguments)")
return result
}
}

// Since 'contains' is only available in macOS SDKs 13.0 or newer, we need our own little implementation.
extension RandomAccessCollection where Element: Equatable {
fileprivate func firstIndex(of pattern: some RandomAccessCollection<Element>) -> Index? {
guard !pattern.isEmpty && count >= pattern.count else {
return nil
}

var i = startIndex
for _ in 0..<(count - pattern.count + 1) {
if self[i...].starts(with: pattern) {
return i
}
i = self.index(after: i)
}
return nil
}
}