Create plugin symlinks for Windows and Linux#50599
Create plugin symlinks for Windows and Linux#50599stuartmorgan-g merged 4 commits intoflutter:masterfrom
Conversation
This makes ephemeral symlinks to each plugin, for use by build systems. This is similar to the logic implemented in the Podfile on iOS and macOS, but managed internally to the Flutter tool. Exploration for addressing flutter#32719 and flutter#32720 Related to flutter#41146
|
I tested this branch on FDE's CI, and it passed on both AppVeyor and GitHub actions, so fortunately it looks like it's normal for CI setups to have the necessary permissions to make symlinks on Windows (which was my primary concern with doing this). |
jonahwilliams
left a comment
There was a problem hiding this comment.
LGTM with some nits
| /// Replaces [symlinkDirectory] with a directory containing symlinks to each plugin | ||
| /// listed in [platformPlugins]. | ||
| void _createPlatformPluginSymlinks(Directory symlinkDirectory, List<dynamic> platformPlugins) { | ||
| // Start fresh each time to avoid stale links. |
There was a problem hiding this comment.
Is there some data we could track to avoid blowing the whole thing away? It seems like this might come back to bite us if we induce dependent build systems to do more work than necessary because of it.
There was a problem hiding this comment.
Changed to only fully recreate when the plugin list actually changes, and to do repairs (in case someone nukes ephemeral/) on each build. In practice I don't think it would affect build systems since it's a containing directory, not the project or sources, that is the symlink, but this version is still pretty low risk in terms of things getting out of sync.
Description
This makes ephemeral symlinks to each plugin, for use by build systems.
This is similar to the logic implemented in the Podfile on iOS and
macOS, but managed internally to the Flutter tool.
This allows for build system integrations (e.g., .sln references to
projects) not to have developer-specific paths, as with iOS/macOS.
Related Issues
Exploration for addressing #32719 and #32720
Related to #41146
Tests
I added the following tests: createPluginSymlink test group
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Did any tests fail when you ran them? Please read [Handling breaking changes].