How to make pub build show warnings/hints from all packages

588 views Asked by At

I have an app that has about 10 packages that I developed myself. I only run pub build on one of them and it is dependent on the other packages. When I run pub build I receive output like:

[Dart2JS on myapp_client|web/index.html_bootstrap.dart]:
3 warning(s) suppressed in package:myapp_shared.
[Warning from Dart2JS on myapp_client|web/index.html_bootstrap.dart]:
4 hint(s) suppressed in package:myapp_infra.
[Dart2JS on myapp_client|web/index.html_bootstrap.dart]:
8 warning(s) suppressed in package:myapp_client.

Since these warnings all come from my code I am interested in seeing the full warnings, I do not want them to be suppressed. How can I do this? I've seen that dart2js has a --show-package-warnings option but pub build does not have this. Also this option is not configurable in pubspec.yaml on the dart2js transformer.

2

There are 2 answers

1
Günter Zöchbauer On BEST ANSWER

It seems no such option is available.
With http://dartbug.com/9512 generating warnings for dependencies were suppressed but no exception for path dependencies (see codereview link in the linked issue).

1
Leukipp On

Günter and Jonas have kinda answered the question. Since it took me a few minutes to figure out the actual syntax I'd like to make it clear. Your pubspec.yaml should include the following lines:

- $dart2js:
    commandLineOptions: [--show-package-warnings]