Skip to content

Conversation

ened
Copy link
Collaborator

@ened ened commented Aug 1, 2025

Summary

  • Adds Swift Package Manager support for iOS plugin while maintaining full CocoaPods compatibility
  • Restructures iOS plugin to SPM-compliant directory layout (Sources/workmanager_apple/)
  • Updates CI to test both dependency managers via matrix build strategy
  • Creates Package.swift configuration for SPM integration

Fixes #580

Breaking Changes

None - maintains full backward compatibility with existing CocoaPods workflows.

ened and others added 3 commits July 31, 2025 21:46
- Create SPM-compliant directory structure: Sources/workmanager_apple/
- Move all Swift files from Classes/ to Sources/workmanager_apple/
- Preserve pigeon subdirectory structure
- Update podspec to reference new file locations: Sources/workmanager_apple/**/*
- Update Pigeon configuration to generate Swift files in new location
- Add comprehensive SPM migration plan documentation

✅ Verified: CocoaPods builds successfully with new structure
✅ Backward compatibility: No breaking changes for existing users

This prepares the foundation for Swift Package Manager support while
maintaining full CocoaPods compatibility.
- Add Package.swift with iOS 14+ target and proper resource handling
- Configure SPM target for workmanager_apple with Sources/workmanager_apple path
- Include Resources/PrivacyInfo.xcprivacy processing for SPM
- Support Swift tools version 5.9

✅ Verified: SPM builds successfully with flutter config --enable-swift-package-manager
✅ Verified: CocoaPods backward compatibility maintained
✅ Verified: Both dependency managers work independently

Users can now choose their preferred dependency manager:
- CocoaPods: flutter config --no-enable-swift-package-manager
- SPM: flutter config --enable-swift-package-manager

This completes the core SPM migration while maintaining full backward compatibility.
Integrates Swift Package Manager testing into the examples.yml workflow:
- Matrix build strategy tests both dependency managers
- SPM build removes Podfile for pure testing
- Maintains backward compatibility with CocoaPods

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link

docs-page bot commented Aug 1, 2025

To view this pull requests documentation preview, visit the following URL:

docs.page/fluttercommunity/flutter_workmanager~631

Documentation is deployed and generated using docs.page.

ened added 2 commits August 1, 2025 07:02
Reverts unintended changes to Podfile that were accidentally included in the previous commit
- Apply swiftlint fixes to Package.swift
- Apply dart formatting to workmanager_api.dart
- Update Podfile.lock checksum after iOS build
@ened ened merged commit e2e1d54 into main Aug 1, 2025
18 of 19 checks passed
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.

Add Swift Package Manager support
1 participant