Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 24 additions & 19 deletions flutter_frontend_server/lib/server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -111,25 +111,30 @@ Future<int> starter(
final Directory temp =
Directory.systemTemp.createTempSync('train_frontend_server');
try {
final String outputTrainingDill = path.join(temp.path, 'app.dill');
options = frontend.argParser.parse(<String>[
'--incremental',
'--sdk-root=$sdkRoot',
'--output-dill=$outputTrainingDill',
'--target=flutter',
'--track-widget-creation',
]);
compiler ??= _FlutterFrontendCompiler(output);

await compiler.compile(input, options);
compiler.acceptLastDelta();
await compiler.recompileDelta();
compiler.acceptLastDelta();
compiler.resetIncrementalCompiler();
await compiler.recompileDelta();
compiler.acceptLastDelta();
await compiler.recompileDelta();
compiler.acceptLastDelta();
for (int i = 0; i < 3; i++) {
final String outputTrainingDill = path.join(temp.path, 'app.dill');
options = frontend.argParser.parse(<String>[
'--incremental',
'--sdk-root=$sdkRoot',
'--output-dill=$outputTrainingDill',
'--target=flutter',
'--track-widget-creation',
'--enable-asserts',
'--gen-bytecode',
'--bytecode-options=source-positions,local-var-info,debugger-stops,instance-field-initializers,keep-unreachable-code,avoid-closure-call-instructions',
]);
compiler ??= _FlutterFrontendCompiler(output);

await compiler.compile(input, options);
compiler.acceptLastDelta();
await compiler.recompileDelta();
compiler.acceptLastDelta();
compiler.resetIncrementalCompiler();
await compiler.recompileDelta();
compiler.acceptLastDelta();
await compiler.recompileDelta();
compiler.acceptLastDelta();
}
return 0;
} finally {
temp.deleteSync(recursive: true);
Expand Down