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:
@@ -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 =
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user