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

package:barback must be declared as a public dependency #120

Closed
scheglov opened this issue Aug 17, 2016 · 6 comments
Closed

package:barback must be declared as a public dependency #120

scheglov opened this issue Aug 17, 2016 · 6 comments
Assignees
Labels

Comments

@scheglov
Copy link
Contributor

@scheglov scheglov commented Aug 17, 2016

The library lib/transformer.dart has import 'package:barback/barback.dart';.

This means that the package barback must be a public dependency, not

dev_dependencies:
  barback: ^0.15.2

This prevents Analysis Server from building linked summaries for the package intl and the transitive list of packages that use it.

@bwilkerson @stereotype441 @nex3

@scheglov scheglov added the bug label Aug 17, 2016
@scheglov scheglov changed the title package:barback is NOT a package:barback must be declared as a public dependency Aug 17, 2016
@alan-knight
Copy link
Contributor

@alan-knight alan-knight commented Aug 17, 2016

So a package with a transformer has to have barback as a runtime dependency? That doesn't seem right.

@scheglov
Copy link
Contributor Author

@scheglov scheglov commented Aug 17, 2016

Well, either this, or lib/transformer.dart should be removed from lib.
You cannot use anything from dev_dependencies inside of lib.

@kevmoo @bwilkerson @stereotype441

@alan-knight
Copy link
Contributor

@alan-knight alan-knight commented Aug 17, 2016

That seems incompatible with the instructions for transformers at https://www.dartlang.org/tools/pub/transformers

@scheglov
Copy link
Contributor Author

@scheglov scheglov commented Aug 17, 2016

@munificent

The instructions also say:

In your package’s pubspec.yaml file, add a dependency on the barback package:

dependencies:
  barback: ^0.15.2
@munificent
Copy link
Member

@munificent munificent commented Aug 17, 2016

So a package with a transformer has to have barback as a runtime dependency?

dependencies doesn't mean "runtime" dependency so much as it means "public" dependency. By putting your transformer in lib/transformer.dart, you're saying that other packages can use intl's transformer.

That means when an app depends on intl, it also needs to transitively get barback so that intl's transformer has access to it. That means barback needs to be in dependencies, not dev_dependencies. The latter is for dependencies that are not transitive. Generally, that means for things you only use from within benchmark, example, test, and tool.

@alan-knight
Copy link
Contributor

@alan-knight alan-knight commented Aug 17, 2016

Ah, ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants