From 91be24ec834dd8b7555e2eea3ecfbf3613483d72 Mon Sep 17 00:00:00 2001 From: Pedro Date: Fri, 20 Jun 2025 14:57:10 +0200 Subject: [PATCH 1/2] Replace compile-time directives with target platform conditions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use Package.swift target platform conditions instead of compile-time #if directives for EventSource dependency. This leverages Swift Package Manager's native dependency support for platform-specific targets at runtime rather than compile-time. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- Package.swift | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Package.swift b/Package.swift index 9f1cb351..47a50133 100644 --- a/Package.swift +++ b/Package.swift @@ -7,21 +7,16 @@ import PackageDescription var dependencies: [Package.Dependency] = [ .package(url: "https://github.com/apple/swift-system.git", from: "1.0.0"), .package(url: "https://github.com/apple/swift-log.git", from: "1.5.0"), + .package(url: "https://github.com/loopwork-ai/eventsource.git", from: "1.1.0") ] // Target dependencies needed on all platforms var targetDependencies: [Target.Dependency] = [ .product(name: "SystemPackage", package: "swift-system"), .product(name: "Logging", package: "swift-log"), + .product(name: "EventSource", package: "eventsource", condition: .when(platforms: [.macOS, .iOS, .tvOS, .visionOS, .watchOS])) ] -// Add EventSource only on Apple platforms (non-Linux) -#if !os(Linux) - dependencies.append( - .package(url: "https://github.com/loopwork-ai/eventsource.git", from: "1.1.0")) - targetDependencies.append(.product(name: "EventSource", package: "eventsource")) -#endif - let package = Package( name: "mcp-swift-sdk", platforms: [ From 8795e6c0fdbcdd3b9bdb932de1b41e988f2c79e6 Mon Sep 17 00:00:00 2001 From: Mattt Date: Sun, 10 Aug 2025 05:43:38 -0700 Subject: [PATCH 2/2] Update reference for EventSource package --- Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index 47a50133..9ced03cb 100644 --- a/Package.swift +++ b/Package.swift @@ -7,7 +7,7 @@ import PackageDescription var dependencies: [Package.Dependency] = [ .package(url: "https://github.com/apple/swift-system.git", from: "1.0.0"), .package(url: "https://github.com/apple/swift-log.git", from: "1.5.0"), - .package(url: "https://github.com/loopwork-ai/eventsource.git", from: "1.1.0") + .package(url: "https://github.com/mattt/eventsource.git", from: "1.1.0") ] // Target dependencies needed on all platforms