[flutter_tool] allow disabling profile mode timeline traces (#97622)

This commit is contained in:
Jonah Williams
2022-02-02 16:00:16 -08:00
committed by GitHub
parent 4a7e30f87d
commit 0b72d5ca58
2 changed files with 19 additions and 4 deletions

View File

@@ -177,8 +177,12 @@ List<String> buildModeOptions(BuildMode mode, List<String> dartDefines) {
];
case BuildMode.profile:
return <String>[
'-Ddart.vm.profile=true',
'-Ddart.vm.product=false',
// These checks allow the CLI to override the value of this define for
// benchmarks with most timeline traces disabled.
if (!dartDefines.any((String define) => define.startsWith('dart.vm.profile')))
'-Ddart.vm.profile=true',
if (!dartDefines.any((String define) => define.startsWith('dart.vm.product')))
'-Ddart.vm.product=false',
];
case BuildMode.release:
return <String>[