From 868523d7d9531f8a5dc92c2fcf84383d7b5cb0de Mon Sep 17 00:00:00 2001 From: YoloMao Date: Mon, 18 Sep 2023 17:48:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20macOS=20=E4=BD=BF=E7=94=A8=20swiftPM=20?= =?UTF-8?q?=E9=9B=86=E6=88=90=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 原因: 虽然 MobileDebugger 仅在 iOS 下集成,但 swiftPM 还是会先编译 MD 的依赖再进行平台判断,也就是 screenshot,导致找不到 UIKit 报错 --- .../project.xcworkspace/contents.xcworkspacedata | 2 +- Package.swift | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Example/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Example/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 55dc151a8..919434a62 100644 --- a/Example/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/Example/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:"> diff --git a/Package.swift b/Package.swift index 8778452b4..84d9ed552 100644 --- a/Package.swift +++ b/Package.swift @@ -316,7 +316,7 @@ let package = Package( dependencies: [ "GrowingTrackerCore", "GrowingService_WebSocket", - "GrowingService_Screenshot", + .target(name: "GrowingService_Screenshot", condition: .when(platforms: [.iOS])), ], path: "Modules/MobileDebugger", cSettings: [ @@ -328,8 +328,8 @@ let package = Package( dependencies: [ "GrowingAutotrackerCore", "GrowingService_WebSocket", - "GrowingService_Screenshot", - "GrowingModule_Hybrid", + .target(name: "GrowingService_Screenshot", condition: .when(platforms: [.iOS])), + .target(name: "GrowingModule_Hybrid", condition: .when(platforms: [.iOS, .macCatalyst])), ], path: "Modules/WebCircle", cSettings: [