-
Notifications
You must be signed in to change notification settings - Fork 28.7k
Dependency injection Attach command #113227
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
Dependency injection Attach command #113227
Conversation
required ProcessInfo processInfo, | ||
required FileSystem fileSystem, | ||
}): _artifacts = artifacts, | ||
_hotRunnerFactory = (hotRunnerFactory == null) ? HotRunnerFactory() : hotRunnerFactory, |
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.
_hotRunnerFactory = (hotRunnerFactory == null) ? HotRunnerFactory() : hotRunnerFactory, | |
_hotRunnerFactory = hotRunnerFactory ?? HotRunnerFactory(), |
@@ -316,7 +345,7 @@ known, it can be explicitly provided to attach via the command-line, e.g. | |||
).asBroadcastStream(); | |||
} | |||
|
|||
globals.terminal.usesTerminalUi = daemon == null; | |||
_terminal.usesTerminalUi = daemon == null; |
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.
Seems strange to me that we set this here; I would think that we would do it somewhere earlier. I'm just talking out loud though, keeping status quo LGTM for now.
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.
LGTM with a nit about using ??
over ternary
Thanks for migrating this command! |
@@ -438,7 +564,16 @@ void main() { | |||
}); | |||
|
|||
testUsingContext('exits when multiple devices connected', () async { | |||
final AttachCommand command = AttachCommand(); | |||
final AttachCommand command = AttachCommand( |
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 btw, are we still relying on all the overrides here? I would have hoped we could use testWithoutContext
after this refactor.
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.
I just tried using testWithoutContext
but it seems like the attach command and the BufferLogger
used in this tests still needs a context
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.
Annoyingly FlutterCommand
depends on globals :(
Part of: #107607
Pre-launch Checklist
///
).