-
Notifications
You must be signed in to change notification settings - Fork 28.7k
Symlink SwiftPM plugins in the same directory #168932
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
Conversation
.childDirectory('FlutterGeneratedPluginSwiftPackage') | ||
.childFile('Package.swift'); | ||
Directory get flutterSwiftPackagesDirectory => | ||
hostAppRoot.childDirectory('Flutter').childDirectory('ephemeral').childDirectory('Packages'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have constants for these strings anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I wish we didn't have to make the filesystem layout a public API rather than an implementation detail as has traditionally been the case, but with the way SwiftPM overrides works it seems like we don't have a better option.
This PR symlinks SwiftPM plugins in the same directory so that they're relative to each other and the
FlutterGeneratedPluginSwiftPackage
.This allows plugins to depend on each other via relative paths.
For example,
Then in plugin_b's Package.swift, you can do the following to add a dependency on plugin_a:
Addresses #166528 and incremental change toward #166489.
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.