Skip to content

feat: add Swift Package Manager support for iOS and macOS - #2

Merged
AmisKwok merged 1 commit into
mainfrom
chore/release-1.0.2
Sep 14, 2026
Merged

AmisKwok merged 1 commit into
mainfrom
chore/release-1.0.2

Conversation

@AmisKwok

@AmisKwok AmisKwok commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

Summary / 摘要

Adds Swift Package Manager support for iOS and macOS and releases the package as 1.0.2. + 为 iOS 与 macOS 增加 Swift Package Manager 支持,并发布 1.0.2。

Changes / 变更

  • Added Package.swift for iOS and macOS so the plugin resolves in SwiftPM-based projects; native sources moved to ios|macos/zero_network_kit/Sources/zero_network_kit/ and both podspecs were repointed at the new source_files / resource_bundles. / 新增 iOS 与 macOS 的 Package.swift,使插件可在 SwiftPM 工程中解析;原生源码移至 ios|macos/zero_network_kit/Sources/zero_network_kit/,两个 podspec 的 source_files 与 resource_bundles 同步指向新路径。
  • Fixed the pub.dev description — it still advertised five platforms after Web support shipped; it now lists all six. / 修复 pub.dev 描述——Web 支持上线后仍只宣传五个平台,现列出全部六个。
  • Fixed the macOS podspec template leftovers (placeholder summary, example.com homepage, Your Company author) and the iOS author, and enabled the privacy manifest resource bundle on both platforms. / 修复 macOS podspec 残留的模板值(占位 summary、example.com 主页、Your Company 作者)与 iOS 作者信息,并在两个平台启用隐私清单资源包。
  • Bumped the version to 1.0.2 across pubspec.yaml, both podspecs, README.md, README_zh.md, CHANGELOG.md and the example lockfile; docs/ was rebuilt by the pre-commit sync hook. / 在 pubspec.yaml、两个 podspec、README.md、README_zh.md、CHANGELOG.md 与 example lockfile 中统一升级到 1.0.2;docs/ 由 pre-commit 同步钩子重建。
  • Documented the dual distribution layout (CocoaPods podspec + Swift Package) in AGENTS.md and corrected the stale native source paths. / 在 AGENTS.md 中记录「CocoaPods + SwiftPM 双发布」布局,并修正已失效的原生源码路径。

Context / 背景

Projects that have migrated away from CocoaPods could not resolve the plugin at all, since only a podspec shipped. Adding a Swift Package manifest next to the existing podspec keeps both integration paths working without touching the public Dart API, so this is a patch release rather than a minor one. The doc/metadata fixes are bundled because both podspecs had to be edited anyway. / 已从 CocoaPods 迁移走的工程此前完全无法解析本插件(只提供了 podspec)。在保留 podspec 的同时新增 Swift Package 清单,两条集成路径都能工作,且未改动公开 Dart API,因此按补丁版本发布而非次版本。文档与元信息修复随本次一并提交,因为两个 podspec 本就需要改动。

Checklist / 检查项

  • Title follows Conventional Commits / 标题符合约定式提交
  • CI checks pass after merge / 合入后 CI 通过

Test plan

  • flutter pub get, flutter analyze (no issues), dart format --set-exit-if-changed . (0 changed), flutter test (49/49 passed). / 本地四项校验全绿。
  • Resolve the plugin in a SwiftPM-only iOS/macOS app and confirm getPlatformVersion / getNetworkDetails respond over the method channel. / 在纯 SwiftPM 的 iOS/macOS 工程中解析插件,确认方法通道可正常返回。
  • Confirm the three required checks are green: Analyze & Test, Pana Score Check, Check PR Title (Conventional Commits). / 确认三项必需检查全部通过。

🤖 Generated with Zero Buddy

iOS and macOS now ship a Package.swift alongside the CocoaPods podspec, so the plugin keeps working in projects that have migrated to SwiftPM. Native sources moved to Sources/zero_network_kit/ under each platform directory, and both podspecs point at the new paths.

Also fixes the pub.dev description to list all six platforms, and replaces the leftover macOS podspec template metadata plus the iOS author with the real project values, enabling the privacy manifest resource bundle on both platforms.

Bump version to 1.0.2 and update README, CHANGELOG and AGENTS accordingly.
@AmisKwok
AmisKwok merged commit 2f2a3ce into main Sep 14, 2026
10 checks passed
@AmisKwok
AmisKwok deleted the chore/release-1.0.2 branch September 14, 2026 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant