-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Show output from pub get in flutter pub get
#106300
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
Conversation
|
@sigurdm is this ready for review? (it's marked a draft, but maybe that was by accident?) |
Yeah - I marked it as draft until I added the color-handling - but I think it should be good now. |
| final bool includeWindows; | ||
| if (template == FlutterProjectType.module) { | ||
| // The module template only supports iOS and Android. | ||
| includeIos = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we still check if platforms.contains('ios') (and ditto for android)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could - but it would change the current behaviour: https://github.com/flutter/flutter/pull/106300/files#diff-fa49e752dc7aba132fcab72c29e71c50541d612363171837a4658e0317fb7c9aL457
| break; | ||
| } | ||
|
|
||
| if (boolArgDeprecated('pub')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These commands are hard to read--can you explain why you're adding this here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, did this used to be called earlier in the _generateModule() and such helper functions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this is moved from the helper-functions.
| } | ||
| } | ||
|
|
||
| Future<void> _runWithRetries( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the difference between this and batch()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
runWithRetries will retry the command as long as the exit code is _kPubExitCodeUnavailable the and print the output of the last run.
batch will show only the last line of the output. Run only a single run.
I wanted to get rid of batch but it has a few call-sites that I didn't want to touch in this PR:
-
await pub.batch( -
await pub.batch(<String>['run', 'test', ...argResults!.rest], context: PubContext.runTest);
But looking at these it seems I can simplify batch even more None of those call sites do version solving (they to run test and deps)
I simplified batch and added documentation to _runWithRetries.
|
I'm going on 3 weeks vacation today. So don't expect responses before that. |
|
cc @Jasguerrero |
|
I've rebased this, could you take another look? |
christopherfujino
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code LGTM, although you have some failing tests.
|
Fixed the test, had to hack the analyze_snippets_code.dart tool a bit. There was also a bug if the example folder existed but had no pubspec.yaml - fixed that. |
thanks! when you're ready to merge, you can add the |
…ter#106300)" (flutter#110478)" This reverts commit 0e195e9.
Part of dart-lang/pub#2971 .
dart pub gethas detailed output about outdated dependencies. This is currently not exposed fromflutter pub get.We are missing out on at least this information:
Before:
Note how the warnings output really belongs to the resolution from the example.
After:
This PR also uses
pub get --example(implemented here) to resolve in './example' if it exists.Now the output from resolution in ./example is reduced as long as there are no errors.
Because
flutter pub getwill retrypub getuntil successful the output of each run is recorded, and only the output of the last run is shown.Fix: a small bug where
flutter createfor some templates would invoke pub even if given a--no-pubargument.Cleanup:
pub getwill no longer be invoked with --no-precompile (that is now default).Output from
pub getis also show when doingflutter create- that might be distracting - maybe we should turn that off:Also includes color in the pub terminal output (depending on the flutter terminal color detection):
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.