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

Comments

Projects
None yet
3 participants
@scheglov
Copy link
Contributor

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Member

alan-knight commented Aug 17, 2016

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

@scheglov

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Member

alan-knight commented Aug 17, 2016

Ah, ok.

@alan-knight alan-knight self-assigned this Aug 17, 2016

alan-knight added a commit that referenced this issue Aug 19, 2016

Move barback out of dev dependencies ( #120 )
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130783906
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment