Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

[path_provider] Merge iOS and macOS implementations #6988

Merged
merged 16 commits into from
Jan 19, 2023

Conversation

stuartmorgan
Copy link
Contributor

@stuartmorgan stuartmorgan commented Jan 18, 2023

This merges path_provide_ios and path_provide_macos into a new path_provide_foundations that replaces both of those packages, as described in flutter/flutter#117941:

  • Renames path_provide_macos to path_provider_foundation, since the macOS implementation is the Swift implementation, which is what we want to use going forward.
  • Moves the implementation files to a shared darwin directory (adding sharedDarwinSource to the pubspec, allowing symlink-free support for Flutter master), adjusting the code and podspec slightly to make it iOS-compatible (including adding the search paths workaround this time!)
  • Adds iOS support to the example, via flutter create-ing a new iOS example and wiring it up to use the existing native unit test. (This was done instead of moving the example from path_provider_ios since it seemed better to have the example be in Swift as well now.)
  • Removes path_provider_ios.

This incidentally addresses the iOS part of flutter/flutter#93198. While it's unlikely to be a particularly useful path on iOS, the existing macOS implementation works fine on iOS, it's easier to just use it than to explicitly disable it for iOS, and there's no reason I can think of not to support it.

Once this lands and has been published, a follow-up will update path_provider to use this new package instead of the other two, and the old ones will be marked as deprecated on pub.dev.

Most of flutter/flutter#117941
iOS part of flutter/flutter#93198

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/plugins repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@stuartmorgan stuartmorgan added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 18, 2023
@auto-submit auto-submit bot merged commit e0c24db into flutter:main Jan 19, 2023
@stuartmorgan stuartmorgan deleted the path-provider-create-foundation branch January 19, 2023 02:44
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 19, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 19, 2023
mauricioluz pushed a commit to mauricioluz/plugins that referenced this pull request Jan 26, 2023
* Rename directory; no changes

* Exclude new plugin from build-all during the transition

* Rename files and classes, update metadata

* Make error messages non-macOS-specific

* Move implementation to shared location

* IGNORE IN REVIEW add symlinks

* Add macOS symlink readme

* Add iOS support with sharedDarwinSource

* Add iOS example freshly created from template

* Add iOS symlinks

* Add missing library directory to example, for parity with iOS

* Move unit test to shared location, and add iOS unit test target using it

* Add the Swift search paths to podspec

* Remove path_provider_ios

* Update CODEOWNERS

* Add copyrights to example files
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
autosubmit Merge PR when tree becomes green via auto submit App p: path_provider platform-ios platform-macos
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants