[flutter_tools] inject output preferences at the top level (#58875)

The tool was setting the output preferences in a sub-context. Originally these were not injected before the arg parsers were created, though that was fixed by the lazy command creation. Once local engine is removed, the inner flutter_command Zone can be removed.
This commit is contained in:
Jonah Williams
2020-06-10 12:13:06 -07:00
committed by GitHub
parent e7b4d2b80e
commit dca6320fe4
5 changed files with 167 additions and 74 deletions

View File

@@ -11,6 +11,7 @@ import 'src/base/template.dart';
// The build_runner code generation is provided here to make it easier to
// avoid introducing the dependency into google3. Not all build* packages
// are synced internally.
import 'src/base/terminal.dart';
import 'src/build_runner/build_runner.dart';
import 'src/build_runner/mustache_template.dart';
import 'src/build_runner/resident_web_runner.dart';
@@ -135,6 +136,11 @@ Future<void> main(List<String> args) async {
stdio: globals.stdio,
terminal: globals.terminal,
outputPreferences: globals.outputPreferences,
))
)),
OutputPreferences: () => OutputPreferences.fromArguments(
args,
stdio: globals.stdio,
userMessages: globals.userMessages,
),
});
}