8000 Add support for Swift package manager by EchoEllet · Pull Request #573 · macosui/macos_ui · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add support for Swift package manager #573

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

EchoEllet
Copy link
@EchoEllet EchoEllet commented Jun 4, 2025

Swift Package Manager support

This PR is the same as macosui/macos_window_utils.dart#66 but for macos_ui.

The PRs Adrian-Samoticha/appkit_ui_element_colors#2 and macosui/macos_window_utils.dart#66, in addition to this one, make changes for macos_ui and its plugin dependencies to support the Swift package manager without using CocoaPods.

Testing

  1. Run the following:
flutter config --enable-swift-package-manager
  1. Add the following to your pubspec.yaml:
dependency_overrides:
  # Remove the override if this PR is merged: https://github.com/macosui/macos_window_utils.dart/pull/66
  macos_window_utils:
    git:
      url: https://github.com/EchoEllet/macos_window_utils.dart
      ref: feat/swift-package-manager
  # Remove the override if this PR is merged: https://github.com/macosui/macos_ui/pull/573
  macos_ui:
    git:
      url: https://github.com/EchoEllet/macos_ui
      ref: feat/swift-package-manager
  1. Run flutter pub get in your app project, and you should be able to build without CocoaPods integration or CocoaPods installed on your system.
  2. Run flutter pub upgrade to ensure the transitive dependency appkit_ui_element_colors is 1.0.1 or newer (to ensure Add support for Swift package manager Adrian-Samoticha/appkit_ui_element_colors#2 is applied).

Related Issues

Pre-launch Checklist

  • I have incremented the package version as appropriate and updated CHANGELOG.md with my changes
  • I have added/updated relevant documentation
  • I have run "optimize/organize imports" on all changed files
  • I have addressed all analyzer warnings as best I could

@EchoEllet
Copy link
Author
EchoEllet commented Jun 4, 2025

I think I have missed something, Podfile is referenced in README.md. In this case, I think we could update the reference to indicate that this is only required when using CocoaPods.

@Adrian-Samoticha
Copy link
Member

Yeah. Considering that SPM isn’t enabled by default, we should probably describe how to enable it in that section as well.

@EchoEllet
Copy link
Author
EchoEllet commented Jun 5, 2025

Considering that SPM isn’t enabled by default,

We can either include the command to enable it or point to this link: https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-app-developers#how-to-turn-on-swift-package-manager.

@Adrian-Samoticha
Copy link
Member

Yeah, maybe pointing to the link is preferable just in case anything changes in the future.

@EchoEllet
Copy link
Author
EchoEllet commented Jun 7, 2025

So when users include the macos_ui plugin, they will also depend on the Swift package of the plugin, and by default, when a plugin requires a higher OS version than the app project, they will get a build failure from Xcode rather than CocoaPods.

I think we need to update README to:

  • Indicates the Podfile is required only when using CocoaPods. The minimum version change to the Xcode project is enough when using Swift Package Manager.
  • Indicates that the Xcode minimum version change is always required even when using CocoaPods.
  • Add a link on how to enable Swift package manager.
  • Optionally, we could include error messages when the setup is not done properly either with CocoaPods or Swift package manager as this will be helpful for users who search on Google as soon as they found the error, maybe somewhere in the FAQ.

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.

Swift package manager support
2 participants
0