未验证 提交 04f567bd 编写于 作者: R Ryan Macnak 提交者: GitHub

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

Cf. dart-lang/sdk@74cff6c7df3e8f212c7f41a3a25631e007abc0f7
上级 aef8f5e0
......@@ -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",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册