Do not assume Platform.script is a Dart source file during training. (flutter/engine#12256)

Cf. dart-lang/sdk@74cff6c7df
This commit is contained in:
Ryan Macnak
2019-09-16 08:57:27 -07:00
committed by GitHub
parent 0521a735db
commit 891db996e8
3 changed files with 11 additions and 2 deletions

View File

@@ -50,6 +50,7 @@ if (is_fuchsia_host || is_fuchsia) {
training_args = [
"--train",
"--sdk-root=$flutter_patched_sdk",
rebase_path(main_dart),
]
frontend_server_files =

View File

@@ -92,6 +92,11 @@ Future<int> starter(
}
if (options['train']) {
if (!options.rest.isNotEmpty) {
throw Exception('Must specify input.dart');
}
final String input = options.rest[0];
final String sdkRoot = options['sdk-root'];
final Directory temp = Directory.systemTemp.createTempSync('train_frontend_server');
try {
@@ -105,7 +110,7 @@ Future<int> starter(
]);
compiler ??= _FlutterFrontendCompiler(output);
await compiler.compile(Platform.script.toFilePath(), options);
await compiler.compile(input, options);
compiler.acceptLastDelta();
await compiler.recompileDelta();
compiler.acceptLastDelta();

View File

@@ -15,7 +15,10 @@ application_snapshot("kernel_compiler") {
dot_packages = rebase_path("//third_party/dart/.packages")
training_args = [ "--train" ]
training_args = [
"--train",
rebase_path(main_dart),
]
kernel_compiler_files =
exec_script("//third_party/dart/tools/list_dart_files.py",