Skip to content
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

Open
a14n opened this issue Nov 28, 2018 · 4 comments
Open

Analyzer plugin should support relative path dependencies #35281

a14n opened this issue Nov 28, 2018 · 4 comments
Labels
analyzer-plugin area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug

Comments

@a14n
Copy link
Contributor

a14n commented Nov 28, 2018

(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.

@bwilkerson
Copy link
Member

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?

@a14n
Copy link
Contributor Author

a14n commented Nov 28, 2018

I wanted to play with the plugin system so I created a simple plugin based on the angular plugin. So I had something like:

my_plugin
 lib
  starter.dart
 tools
  analyzer_plugin
   bin
    plugin.dart
   pubspec.yaml
 pubspec.yaml

where my my_plugin/tools/analyzer_plugin/pubspec.yaml is:

name: my_plugin_loader
version: 0.0.0
description: Self-loader of the plugin.
dev_dependencies:
  my_plugin:
    path: ../..

@bwilkerson
Copy link
Member

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.

@bwilkerson bwilkerson added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. type-enhancement A request for a change that isn't a bug analyzer-plugin labels Nov 28, 2018
@stereotype441 stereotype441 added the P2 A bug or feature request we're likely to work on label Nov 28, 2018
@spkersten
Copy link
Contributor

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-plugin area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

4 participants