Skip to content

feat: add Swift Package Manager support for iOS#61

Draft
nicklasl wants to merge 4 commits into
mainfrom
nicklasl/add-spm-support
Draft

feat: add Swift Package Manager support for iOS#61
nicklasl wants to merge 4 commits into
mainfrom
nicklasl/add-spm-support

Conversation

@nicklasl
Copy link
Copy Markdown
Member

@nicklasl nicklasl commented Jun 5, 2026

Summary

  • Adds Package.swift manifest so the iOS plugin resolves via SPM (Flutter 3.44+ default)
  • Moves plugin Swift source to SPM-expected directory layout (ios/confidence_flutter_sdk/Sources/)
  • Updates podspec to reference new source paths while maintaining CocoaPods backward compatibility
  • Existing CI workflow unchanged — submodule copy still provides Confidence sources for CocoaPods builds

Test plan

  • CocoaPods: flutter build ios --no-codesign succeeds
  • SPM: swift package resolve resolves confidence-sdk-swift at 1.5.0
  • CI: verify existing iOS integration test passes
  • Manual: test with a Flutter 3.44+ project using SPM

🤖 Generated with Claude Code

nicklasl and others added 4 commits June 5, 2026 11:29
Flutter 3.44+ uses SPM by default. This adds a Package.swift manifest
so the plugin resolves via SPM while keeping CocoaPods backward compat.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
SPM builds Confidence as a separate module requiring an explicit
import. CocoaPods compiles everything in one module so the import
is unnecessary. #if canImport handles both paths.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds a parallel ios-test-spm job using Flutter 3.44.0 which defaults
to Swift Package Manager. Renames existing job to ios-test-cocoapods.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
SPM derives package identity from the git repo URL (confidence-sdk-flutter)
which doesn't match the plugin name (confidence_flutter_sdk). Vendor
Confidence sources directly instead of using an external SPM dependency
to avoid the identity conflict. Add FlutterFramework dependency required
by Flutter 3.41+. Update SPM CI job to copy sources from submodule.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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