Fix macOS relative plugin Xcode file path#183593
Conversation
There was a problem hiding this comment.
Code Review
This pull request modifies the Swift Package Manager integration migration to correctly calculate relative plugin paths for macOS. It introduces platform-specific logic to use a different base directory for path calculation on macOS versus iOS. The corresponding tests are updated to reflect this change, including adding a managedDirectory property to the fake Xcode project for testing purposes.
| "sourceTree": "<group>" | ||
| }'''; | ||
| if (includePlugin) { | ||
| final pluginLeadingPath = platform == FlutterDarwinPlatform.ios ? '../../' : '../../../'; |
There was a problem hiding this comment.
The logic for determining pluginLeadingPath is also present on line 3595. To adhere to the style guide principle of avoiding duplication, consider extracting this logic into a private top-level helper function. For example:
String _getPluginLeadingPath(FlutterDarwinPlatform platform) {
return platform == FlutterDarwinPlatform.ios ? '../../' : '../../../';
}You could then call this function here and on line 3595.
References
- The style guide recommends avoiding duplication of state or logic to maintain a single source of truth. This logic for determining the plugin path is duplicated in two places within this test file. (link)
stuartmorgan-g
left a comment
There was a problem hiding this comment.
LGTM
I'm curious why the group on iOS doesn't use its path, but I guess at this point trying to change it would be a nightmare.
I think it's because iOS uses and macOS uses |
|
Right, I'm just curious why |
Oh yeah that I'm not sure about |
flutter/flutter@9e36adb...732e05d 2026-03-13 engine-flutter-autoroll@skia.org Roll Dart SDK from 330b797abd09 to d5f6d3c17499 (1 revision) (flutter/flutter#183640) 2026-03-13 engine-flutter-autoroll@skia.org Roll Skia from 9eb5598e1b2c to 029229d8be91 (3 revisions) (flutter/flutter#183638) 2026-03-13 engine-flutter-autoroll@skia.org Roll Skia from 9be8fdf31ff4 to 9eb5598e1b2c (2 revisions) (flutter/flutter#183630) 2026-03-13 victorsanniay@gmail.com Add awaits to flutter/test callsites (flutter/flutter#183487) 2026-03-13 victorsanniay@gmail.com Add await to more flutter/flutter callsites (flutter/flutter#183413) 2026-03-13 engine-flutter-autoroll@skia.org Roll Dart SDK from d1d84ab7ef0d to 330b797abd09 (2 revisions) (flutter/flutter#183624) 2026-03-13 34465683+rkishan516@users.noreply.github.com refactor: remove material import from sliver_resizing_header_test and sliver_prototype_item_extent_test (flutter/flutter#183562) 2026-03-13 36861262+QuncCccccc@users.noreply.github.com Fix reselection issue after the text is cleared (flutter/flutter#183545) 2026-03-13 engine-flutter-autoroll@skia.org Roll Skia from 255bd243276b to 9be8fdf31ff4 (5 revisions) (flutter/flutter#183616) 2026-03-12 git@reb0.org ci: Remove `bringup` from orchestrator for windows_arm_host_engine on Linux (flutter/flutter#183574) 2026-03-12 chingjun@google.com Use operator<=> instead of std::less for UniqueID. (flutter/flutter#183600) 2026-03-12 30870216+gaaclarke@users.noreply.github.com Specified the repo the cp label will be removed from (flutter/flutter#183611) 2026-03-12 1961493+harryterkelsen@users.noreply.github.com [web] Fix Web SDK build on macOS (flutter/flutter#183549) 2026-03-12 engine-flutter-autoroll@skia.org Roll Skia from 38761e1803d0 to 255bd243276b (3 revisions) (flutter/flutter#183603) 2026-03-12 engine-flutter-autoroll@skia.org Roll Dart SDK from 2e1e7a09fce6 to d1d84ab7ef0d (1 revision) (flutter/flutter#183604) 2026-03-12 15619084+vashworth@users.noreply.github.com Fix macOS relative plugin Xcode file path (flutter/flutter#183593) 2026-03-12 30870216+gaaclarke@users.noreply.github.com Made cp labels get rejected on issues. (flutter/flutter#183595) 2026-03-12 engine-flutter-autoroll@skia.org Roll Packages from ecace66 to 02f231f (4 revisions) (flutter/flutter#183594) 2026-03-12 engine-flutter-autoroll@skia.org Roll Dart SDK from 59be21f25f2d to 2e1e7a09fce6 (1 revision) (flutter/flutter#183577) 2026-03-12 engine-flutter-autoroll@skia.org Roll Skia from 46f41493ebf4 to 38761e1803d0 (6 revisions) (flutter/flutter#183590) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC stuartmorgan@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…r#11242) flutter/flutter@9e36adb...732e05d 2026-03-13 engine-flutter-autoroll@skia.org Roll Dart SDK from 330b797abd09 to d5f6d3c17499 (1 revision) (flutter/flutter#183640) 2026-03-13 engine-flutter-autoroll@skia.org Roll Skia from 9eb5598e1b2c to 029229d8be91 (3 revisions) (flutter/flutter#183638) 2026-03-13 engine-flutter-autoroll@skia.org Roll Skia from 9be8fdf31ff4 to 9eb5598e1b2c (2 revisions) (flutter/flutter#183630) 2026-03-13 victorsanniay@gmail.com Add awaits to flutter/test callsites (flutter/flutter#183487) 2026-03-13 victorsanniay@gmail.com Add await to more flutter/flutter callsites (flutter/flutter#183413) 2026-03-13 engine-flutter-autoroll@skia.org Roll Dart SDK from d1d84ab7ef0d to 330b797abd09 (2 revisions) (flutter/flutter#183624) 2026-03-13 34465683+rkishan516@users.noreply.github.com refactor: remove material import from sliver_resizing_header_test and sliver_prototype_item_extent_test (flutter/flutter#183562) 2026-03-13 36861262+QuncCccccc@users.noreply.github.com Fix reselection issue after the text is cleared (flutter/flutter#183545) 2026-03-13 engine-flutter-autoroll@skia.org Roll Skia from 255bd243276b to 9be8fdf31ff4 (5 revisions) (flutter/flutter#183616) 2026-03-12 git@reb0.org ci: Remove `bringup` from orchestrator for windows_arm_host_engine on Linux (flutter/flutter#183574) 2026-03-12 chingjun@google.com Use operator<=> instead of std::less for UniqueID. (flutter/flutter#183600) 2026-03-12 30870216+gaaclarke@users.noreply.github.com Specified the repo the cp label will be removed from (flutter/flutter#183611) 2026-03-12 1961493+harryterkelsen@users.noreply.github.com [web] Fix Web SDK build on macOS (flutter/flutter#183549) 2026-03-12 engine-flutter-autoroll@skia.org Roll Skia from 38761e1803d0 to 255bd243276b (3 revisions) (flutter/flutter#183603) 2026-03-12 engine-flutter-autoroll@skia.org Roll Dart SDK from 2e1e7a09fce6 to d1d84ab7ef0d (1 revision) (flutter/flutter#183604) 2026-03-12 15619084+vashworth@users.noreply.github.com Fix macOS relative plugin Xcode file path (flutter/flutter#183593) 2026-03-12 30870216+gaaclarke@users.noreply.github.com Made cp labels get rejected on issues. (flutter/flutter#183595) 2026-03-12 engine-flutter-autoroll@skia.org Roll Packages from ecace66 to 02f231f (4 revisions) (flutter/flutter#183594) 2026-03-12 engine-flutter-autoroll@skia.org Roll Dart SDK from 59be21f25f2d to 2e1e7a09fce6 (1 revision) (flutter/flutter#183577) 2026-03-12 engine-flutter-autoroll@skia.org Roll Skia from 46f41493ebf4 to 38761e1803d0 (6 revisions) (flutter/flutter#183590) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC stuartmorgan@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…r#11242) flutter/flutter@9e36adb...732e05d 2026-03-13 engine-flutter-autoroll@skia.org Roll Dart SDK from 330b797abd09 to d5f6d3c17499 (1 revision) (flutter/flutter#183640) 2026-03-13 engine-flutter-autoroll@skia.org Roll Skia from 9eb5598e1b2c to 029229d8be91 (3 revisions) (flutter/flutter#183638) 2026-03-13 engine-flutter-autoroll@skia.org Roll Skia from 9be8fdf31ff4 to 9eb5598e1b2c (2 revisions) (flutter/flutter#183630) 2026-03-13 victorsanniay@gmail.com Add awaits to flutter/test callsites (flutter/flutter#183487) 2026-03-13 victorsanniay@gmail.com Add await to more flutter/flutter callsites (flutter/flutter#183413) 2026-03-13 engine-flutter-autoroll@skia.org Roll Dart SDK from d1d84ab7ef0d to 330b797abd09 (2 revisions) (flutter/flutter#183624) 2026-03-13 34465683+rkishan516@users.noreply.github.com refactor: remove material import from sliver_resizing_header_test and sliver_prototype_item_extent_test (flutter/flutter#183562) 2026-03-13 36861262+QuncCccccc@users.noreply.github.com Fix reselection issue after the text is cleared (flutter/flutter#183545) 2026-03-13 engine-flutter-autoroll@skia.org Roll Skia from 255bd243276b to 9be8fdf31ff4 (5 revisions) (flutter/flutter#183616) 2026-03-12 git@reb0.org ci: Remove `bringup` from orchestrator for windows_arm_host_engine on Linux (flutter/flutter#183574) 2026-03-12 chingjun@google.com Use operator<=> instead of std::less for UniqueID. (flutter/flutter#183600) 2026-03-12 30870216+gaaclarke@users.noreply.github.com Specified the repo the cp label will be removed from (flutter/flutter#183611) 2026-03-12 1961493+harryterkelsen@users.noreply.github.com [web] Fix Web SDK build on macOS (flutter/flutter#183549) 2026-03-12 engine-flutter-autoroll@skia.org Roll Skia from 38761e1803d0 to 255bd243276b (3 revisions) (flutter/flutter#183603) 2026-03-12 engine-flutter-autoroll@skia.org Roll Dart SDK from 2e1e7a09fce6 to d1d84ab7ef0d (1 revision) (flutter/flutter#183604) 2026-03-12 15619084+vashworth@users.noreply.github.com Fix macOS relative plugin Xcode file path (flutter/flutter#183593) 2026-03-12 30870216+gaaclarke@users.noreply.github.com Made cp labels get rejected on issues. (flutter/flutter#183595) 2026-03-12 engine-flutter-autoroll@skia.org Roll Packages from ecace66 to 02f231f (4 revisions) (flutter/flutter#183594) 2026-03-12 engine-flutter-autoroll@skia.org Roll Dart SDK from 59be21f25f2d to 2e1e7a09fce6 (1 revision) (flutter/flutter#183577) 2026-03-12 engine-flutter-autoroll@skia.org Roll Skia from 46f41493ebf4 to 38761e1803d0 (6 revisions) (flutter/flutter#183590) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC stuartmorgan@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Fixes flutter#183591. ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
Fixes flutter#183591. ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
…r#11242) flutter/flutter@9e36adb...732e05d 2026-03-13 engine-flutter-autoroll@skia.org Roll Dart SDK from 330b797abd09 to d5f6d3c17499 (1 revision) (flutter/flutter#183640) 2026-03-13 engine-flutter-autoroll@skia.org Roll Skia from 9eb5598e1b2c to 029229d8be91 (3 revisions) (flutter/flutter#183638) 2026-03-13 engine-flutter-autoroll@skia.org Roll Skia from 9be8fdf31ff4 to 9eb5598e1b2c (2 revisions) (flutter/flutter#183630) 2026-03-13 victorsanniay@gmail.com Add awaits to flutter/test callsites (flutter/flutter#183487) 2026-03-13 victorsanniay@gmail.com Add await to more flutter/flutter callsites (flutter/flutter#183413) 2026-03-13 engine-flutter-autoroll@skia.org Roll Dart SDK from d1d84ab7ef0d to 330b797abd09 (2 revisions) (flutter/flutter#183624) 2026-03-13 34465683+rkishan516@users.noreply.github.com refactor: remove material import from sliver_resizing_header_test and sliver_prototype_item_extent_test (flutter/flutter#183562) 2026-03-13 36861262+QuncCccccc@users.noreply.github.com Fix reselection issue after the text is cleared (flutter/flutter#183545) 2026-03-13 engine-flutter-autoroll@skia.org Roll Skia from 255bd243276b to 9be8fdf31ff4 (5 revisions) (flutter/flutter#183616) 2026-03-12 git@reb0.org ci: Remove `bringup` from orchestrator for windows_arm_host_engine on Linux (flutter/flutter#183574) 2026-03-12 chingjun@google.com Use operator<=> instead of std::less for UniqueID. (flutter/flutter#183600) 2026-03-12 30870216+gaaclarke@users.noreply.github.com Specified the repo the cp label will be removed from (flutter/flutter#183611) 2026-03-12 1961493+harryterkelsen@users.noreply.github.com [web] Fix Web SDK build on macOS (flutter/flutter#183549) 2026-03-12 engine-flutter-autoroll@skia.org Roll Skia from 38761e1803d0 to 255bd243276b (3 revisions) (flutter/flutter#183603) 2026-03-12 engine-flutter-autoroll@skia.org Roll Dart SDK from 2e1e7a09fce6 to d1d84ab7ef0d (1 revision) (flutter/flutter#183604) 2026-03-12 15619084+vashworth@users.noreply.github.com Fix macOS relative plugin Xcode file path (flutter/flutter#183593) 2026-03-12 30870216+gaaclarke@users.noreply.github.com Made cp labels get rejected on issues. (flutter/flutter#183595) 2026-03-12 engine-flutter-autoroll@skia.org Roll Packages from ecace66 to 02f231f (4 revisions) (flutter/flutter#183594) 2026-03-12 engine-flutter-autoroll@skia.org Roll Dart SDK from 59be21f25f2d to 2e1e7a09fce6 (1 revision) (flutter/flutter#183577) 2026-03-12 engine-flutter-autoroll@skia.org Roll Skia from 46f41493ebf4 to 38761e1803d0 (6 revisions) (flutter/flutter#183590) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC stuartmorgan@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Fixes #183591.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.