Skip to content

Commit 851c952

Browse files
author
Jonah Williams
authored
[flutter_tools] pass --compact-async to frontend_server (#104026)
1 parent 4b1ff13 commit 851c952

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

packages/flutter_tools/lib/src/compile.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ import 'base/platform.dart';
1919
import 'build_info.dart';
2020
import 'convert.dart';
2121

22+
/// Opt-in changes to the dart compilers.
23+
const List<String> kDartCompilerExperiments = <String>[
24+
// improve AOT code size.
25+
'--compact-async',
26+
];
27+
2228
/// The target model describes the set of core libraries that are available within
2329
/// the SDK.
2430
class TargetModel {
@@ -183,11 +189,13 @@ List<String> buildModeOptions(BuildMode mode, List<String> dartDefines) {
183189
'-Ddart.vm.profile=true',
184190
if (!dartDefines.any((String define) => define.startsWith('dart.vm.product')))
185191
'-Ddart.vm.product=false',
192+
...kDartCompilerExperiments,
186193
];
187194
case BuildMode.release:
188195
return <String>[
189196
'-Ddart.vm.profile=false',
190197
'-Ddart.vm.product=true',
198+
...kDartCompilerExperiments,
191199
];
192200
}
193201
throw Exception('Unknown BuildMode: $mode');

packages/flutter_tools/test/general.shard/compile_batch_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ void main() {
197197
'--no-print-incremental-dependencies',
198198
'-Ddart.vm.profile=true',
199199
'-Ddart.vm.product=false',
200+
'--compact-async',
200201
'--no-link-platform',
201202
'--aot',
202203
'--tfa',
@@ -244,6 +245,7 @@ void main() {
244245
'--no-print-incremental-dependencies',
245246
'-Ddart.vm.profile=false',
246247
'-Ddart.vm.product=true',
248+
'--compact-async',
247249
'--no-link-platform',
248250
'--aot',
249251
'--tfa',

packages/flutter_tools/test/general.shard/compile_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,13 @@ void main() {
105105
testWithoutContext('buildModeOptions removes matching profile define in profile mode', () {
106106
expect(buildModeOptions(BuildMode.profile, <String>['dart.vm.profile=true']), <String>[
107107
'-Ddart.vm.product=false',
108+
'--compact-async'
108109
]);
109110
});
110111

111112
testWithoutContext('buildModeOptions removes both matching profile and release define in profile mode', () {
112113
expect(buildModeOptions(BuildMode.profile, <String>['dart.vm.profile=false', 'dart.vm.product=true']), <String>[
114+
'--compact-async'
113115
]);
114116
});
115117
}

0 commit comments

Comments
 (0)