[flutter_tools] pass --compact-async to frontend_server (#104026)
This commit is contained in:
parent
4b1ff13459
commit
851c9521c7
@ -19,6 +19,12 @@ import 'base/platform.dart';
|
||||
import 'build_info.dart';
|
||||
import 'convert.dart';
|
||||
|
||||
/// Opt-in changes to the dart compilers.
|
||||
const List<String> kDartCompilerExperiments = <String>[
|
||||
// improve AOT code size.
|
||||
'--compact-async',
|
||||
];
|
||||
|
||||
/// The target model describes the set of core libraries that are available within
|
||||
/// the SDK.
|
||||
class TargetModel {
|
||||
@ -183,11 +189,13 @@ List<String> buildModeOptions(BuildMode mode, List<String> dartDefines) {
|
||||
'-Ddart.vm.profile=true',
|
||||
if (!dartDefines.any((String define) => define.startsWith('dart.vm.product')))
|
||||
'-Ddart.vm.product=false',
|
||||
...kDartCompilerExperiments,
|
||||
];
|
||||
case BuildMode.release:
|
||||
return <String>[
|
||||
'-Ddart.vm.profile=false',
|
||||
'-Ddart.vm.product=true',
|
||||
...kDartCompilerExperiments,
|
||||
];
|
||||
}
|
||||
throw Exception('Unknown BuildMode: $mode');
|
||||
|
@ -197,6 +197,7 @@ void main() {
|
||||
'--no-print-incremental-dependencies',
|
||||
'-Ddart.vm.profile=true',
|
||||
'-Ddart.vm.product=false',
|
||||
'--compact-async',
|
||||
'--no-link-platform',
|
||||
'--aot',
|
||||
'--tfa',
|
||||
@ -244,6 +245,7 @@ void main() {
|
||||
'--no-print-incremental-dependencies',
|
||||
'-Ddart.vm.profile=false',
|
||||
'-Ddart.vm.product=true',
|
||||
'--compact-async',
|
||||
'--no-link-platform',
|
||||
'--aot',
|
||||
'--tfa',
|
||||
|
@ -105,11 +105,13 @@ void main() {
|
||||
testWithoutContext('buildModeOptions removes matching profile define in profile mode', () {
|
||||
expect(buildModeOptions(BuildMode.profile, <String>['dart.vm.profile=true']), <String>[
|
||||
'-Ddart.vm.product=false',
|
||||
'--compact-async'
|
||||
]);
|
||||
});
|
||||
|
||||
testWithoutContext('buildModeOptions removes both matching profile and release define in profile mode', () {
|
||||
expect(buildModeOptions(BuildMode.profile, <String>['dart.vm.profile=false', 'dart.vm.product=true']), <String>[
|
||||
'--compact-async'
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user