Unverified Commit 851c9521 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

[flutter_tools] pass --compact-async to frontend_server (#104026)

parent 4b1ff134
......@@ -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'
]);
});
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment