Skip to content

Commit 5b92a51

Browse files
author
Sunita Prajapati
committed
fix: correct Package.swift to properly declare SPM support
Add linkedFramework linker settings, use hyphenated library product name, and set static library type — matching the pattern required for Flutter's tooling to detect SPM support and avoid falling back to CocoaPods.
1 parent a160ebe commit 5b92a51

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

‎packages/core/ios/Package.swift‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@ let package = Package(
99
.iOS("12.0"),
1010
],
1111
products: [
12-
.library(name: "segment_analytics", targets: ["segment_analytics"]),
12+
.library(name: "segment-analytics", type: .static, targets: ["segment_analytics"]),
1313
],
14-
dependencies: [],
1514
targets: [
1615
.target(
1716
name: "segment_analytics",
1817
dependencies: [],
19-
path: "Classes"
18+
path: "Classes",
19+
linkerSettings: [
20+
.linkedFramework("Flutter", .when(platforms: [.iOS])),
21+
]
2022
),
2123
]
22-
)
24+
)

‎packages/core/macos/Package.swift‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@ let package = Package(
99
.macOS("10.14"),
1010
],
1111
products: [
12-
.library(name: "segment_analytics", targets: ["segment_analytics"]),
12+
.library(name: "segment-analytics", type: .static, targets: ["segment_analytics"]),
1313
],
14-
dependencies: [],
1514
targets: [
1615
.target(
1716
name: "segment_analytics",
1817
dependencies: [],
19-
path: "Classes"
18+
path: "Classes",
19+
linkerSettings: [
20+
.linkedFramework("FlutterMacOS", .when(platforms: [.macOS])),
21+
]
2022
),
2123
]
2224
)

0 commit comments

Comments
 (0)