-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Analyzer plugin should support relative path dependencies #35281
Comments
Possibly so, but I'm not sure I understand the use case. The bootstrap package is expected to be a package like any other, referencing only code within itself or within other packages that can be referenced via a 'package:' URI. Under what condition(s) does this model fail to be sufficient? |
I wanted to play with the plugin system so I created a simple plugin based on the angular plugin. So I had something like:
where my name: my_plugin_loader
version: 0.0.0
description: Self-loader of the plugin.
dev_dependencies:
my_plugin:
path: ../.. |
And you can't reference 'my_plugin' via a package: URI because it hasn't been published yet. But you should be able to work around it for now by using an absolute path. You'll need to update it before publishing (assuming you do), and if you ever move the package on your file system, but it should otherwise be fine. |
We have an analyzer plugin with team-specific rules that we don't want to publish in a mono-repo with out code. Since the repo is used on many different machines, using an absolute path is inconvenient. (Now we have a bootstrap script that makes the path absolute.) |
A simple workaround is to have the packages (the bootstrap package and any it will depend on via relative paths) in the same Git repository. In this case, a relative path can be used to specify the location of dependencies within the Git repository. The trade-offs of this approach are as follows:
For example, if the bootstrap package needs to depend on the "dependable" package, the "pubspec.yaml" of the bootstrap package might look like this: name: 'plugin'
publish_to: 'none'
environment:
sdk: '>=3.7.0-209.1.beta<3.7.0-209.2.beta'
dev_dependencies:
dependable:
git:
url: '../../../..' #<The relative path from this file's enclosing folder to the repository root.
path: 'pkg/dependable' #<The path from the repository root to the "dependable" package root. |
(with
dart-2.1.0
)Creating a analysis server plugin I used a relative path dependency in the bootstrap package. When I tried to use the plugin nothing worked (no analysis error, no error that the plugin loading failed).
As the bootstrap package is copied in
~/.dartServer/.plugin_manager
the relative path is wrong from this place.Perhaps the path dependencies should be rewriten to absolute path when the bootstrap package is set up.
The text was updated successfully, but these errors were encountered: