From aeca1aa1e9966e1c51bfb549d14101c652ed69bf Mon Sep 17 00:00:00 2001 From: Owen Voorhees Date: Tue, 2 Dec 2025 13:20:32 -0800 Subject: [PATCH] Add iOS/Catalyst deployment targets --- .github/workflows/pull_request.yml | 1 + Package.swift | 6 +++++- .../LanguageServerProtocolTransport/JSONRPCConnection.swift | 2 ++ Sources/ToolsProtocolsTestSupport/PerfTestCase.swift | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 2f2adae66..da870c814 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -23,6 +23,7 @@ jobs: windows_swift_versions: '["nightly-main"]' enable_linux_static_sdk_build: true enable_macos_checks: true + enable_ios_checks: true macos_exclude_xcode_versions: "[{\"xcode_version\": \"16.3\"}, {\"xcode_version\": \"16.4\"}]" macos_pre_build_command: ./.github/scripts/prebuild.sh cmake-smoke-test: diff --git a/Package.swift b/Package.swift index 1a1fe770d..ac4fe2742 100644 --- a/Package.swift +++ b/Package.swift @@ -206,7 +206,11 @@ if buildOnlyTests { let package = Package( name: "swift-tools-protocols", - platforms: [.macOS(.v14)], + platforms: [ + .macOS(.v14), + .iOS(.v17), + .macCatalyst(.v17), + ], products: products, dependencies: dependencies, targets: targets, diff --git a/Sources/LanguageServerProtocolTransport/JSONRPCConnection.swift b/Sources/LanguageServerProtocolTransport/JSONRPCConnection.swift index 5f07daf0e..e8293551d 100644 --- a/Sources/LanguageServerProtocolTransport/JSONRPCConnection.swift +++ b/Sources/LanguageServerProtocolTransport/JSONRPCConnection.swift @@ -196,6 +196,7 @@ public final class JSONRPCConnection: Connection { sendIO.setLimit(highWater: Int.max) } + #if os(macOS) || !canImport(Darwin) /// Creates and starts a `JSONRPCConnection` that connects to a subprocess launched with the specified arguments. /// /// `client` is the message handler that handles the messages sent from the subprocess to SourceKit-LSP. @@ -267,6 +268,7 @@ public final class JSONRPCConnection: Connection { return (connection, process) } + #endif // os(macOS) || !canImport(Darwin) deinit { assert(state == .closed) diff --git a/Sources/ToolsProtocolsTestSupport/PerfTestCase.swift b/Sources/ToolsProtocolsTestSupport/PerfTestCase.swift index badcbfe18..a23c21fbc 100644 --- a/Sources/ToolsProtocolsTestSupport/PerfTestCase.swift +++ b/Sources/ToolsProtocolsTestSupport/PerfTestCase.swift @@ -24,7 +24,7 @@ open class PerfTestCase: XCTestCase { #if !ENABLE_PERF_TESTS - #if os(macOS) + #if canImport(Darwin) open override func startMeasuring() {} open override func stopMeasuring() {} open override func measureMetrics(