feat(darwin): migrate to Swift Package Manager#323
Merged
Conversation
Signed-off-by: Caijinglong <cjl_spy@163.com>
- Added FVM version cache to .gitignore files. - Updated melos.yaml to include commands for building iOS with and without Swift Package Manager. - Modified GitHub Actions workflow for iOS builds to utilize new build commands. - Updated .gitignore in flutter_image_compress to exclude build artifacts. - Added new Swift package files for Flutter integration in flutter_image_compress example. - Updated pubspec.lock to reflect dependency version changes. Signed-off-by: Caijinglong <cjl_spy@163.com>
Signed-off-by: Caijinglong <cjl_spy@163.com>
|
Hey @CaiJingLong, do you have any updates on this? |
- Reorganize flutter_image_compress_common Obj-C sources into Sources/flutter_image_compress_common/ layout with public headers under include/flutter_image_compress_common/. Add Package.swift declaring SwiftPM dependencies on SDWebImage 5.19+, SDWebImageWebPCoder 0.14+, and Mantle 2.2+. Keep iOS 9.0 deployment floor to match dependencies and existing podspec. - Switch native dependency imports to @import (Mantle's SPM headers are flat and not namespaced under <Mantle/...>). Add explicit <UIKit/UIKit.h> to CompressHandler.h that CocoaPods provided implicitly. - Add Package.swift for flutter_image_compress_macos and move the Swift source into Sources/flutter_image_compress_macos/ (macOS 10.15, FlutterMacOS only). - Update podspecs to point at new source paths. CocoaPods integration continues to work. - Add example/integration_test/compress_test.dart — behavior baseline covering all four APIs, JPEG/PNG/WebP/HEIC container assertions, EXIF preservation & orientation, rotation invariants, and transparency. Registers a flutter_image_compress/test MethodChannel in the example app (iOS + macOS) that exposes native EXIF key inspection. - Add integration_test_{iOS,macOS} matrix jobs (SPM + CocoaPods) to CI. - Add melos scripts verify_{ios,macos}_behavior. Verified locally: iOS simulator 14/14 on both SPM and CocoaPods paths; macOS 9/9 + 5 platform-gated skips on both paths. Closes #322, #356, #360, #365. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
path_provider.getTemporaryDirectory() returns a path inside the container's Library/Caches on sandboxed macOS builds, but the directory is not created on first launch. On a fresh CI runner this causes File.writeAsBytesSync to fail with PathNotFoundException — a locally launched app happens to have created the directory on prior runs, which is why this only surfaces in CI. Route all test scratch writes through ensureScratchDirectory() which creates the directory if missing. iOS/Android are unaffected (path already existed) but the fix is safe there too. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Xcode's DerivedData is a per-machine build cache and should never be tracked. It leaked into the macOS example directory (19 files, ~555 lines of xcactivitylog / plist noise). Add `**/DerivedData/` to the root .gitignore and remove the tracked copy. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The root .gitignore already excludes pubspec.lock; example/pubspec.lock was tracked before that rule landed. Remove it from the index so future `flutter pub get` doesn't dirty the tree. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Not sure this fix is working across the board. I have linked this branch directly in my pubspec I have confirmed pub get has downloaded the correct branch |
|
@adam-langley-minrisk I think you forget that we must override all sub projects meanwhile. dependency_overrides:
flutter_image_compress_common:
git:
url: https://github.com/fluttercandies/flutter_image_compress.git
path: packages/flutter_image_compress_common
ref: support-swift-package-manager
flutter_image_compress_macos:
git:
url: https://github.com/fluttercandies/flutter_image_compress.git
path: packages/flutter_image_compress_macos
ref: support-swift-package-manager |
This was referenced Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.