File tree 3 files changed +9
-3
lines changed
3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -902,6 +902,11 @@ Future<int> starter(
902
902
}
903
903
904
904
if (options['train' ]) {
905
+ if (options.rest.isEmpty) {
906
+ throw Exception ('Must specify input.dart' );
907
+ }
908
+
909
+ final String input = options.rest[0 ];
905
910
final String sdkRoot = options['sdk-root' ];
906
911
final String platform = options['platform' ];
907
912
final Directory temp =
@@ -920,8 +925,7 @@ Future<int> starter(
920
925
compiler ?? =
921
926
new FrontendCompiler (output, printerFactory: binaryPrinterFactory);
922
927
923
- await compiler.compile (Platform .script.toFilePath (), options,
924
- generator: generator);
928
+ await compiler.compile (input, options, generator: generator);
925
929
compiler.acceptLastDelta ();
926
930
await compiler.recompileDelta ();
927
931
compiler.acceptLastDelta ();
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ Future<int> main() async {
28
28
final CompilerInterface compiler = new _MockedCompiler ();
29
29
30
30
test ('train with mocked compiler completes' , () async {
31
- await starter (< String > ['--train' ], compiler: compiler);
31
+ await starter (< String > ['--train' , 'foo.dart' ], compiler: compiler);
32
32
});
33
33
});
34
34
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ kernel_application_snapshot("kernel-service_snapshot") {
29
29
]
30
30
training_args = [
31
31
" --train" ,
32
+
32
33
# Force triple-slashes both on Windows and otherwise.
33
34
# Becomes e.g. file:///full/path/to/file and "file:///C:/full/path/to/file.
34
35
# Without the ', "/"' part, on Linux it would get four slashes.
@@ -62,6 +63,7 @@ application_snapshot("frontend_server") {
62
63
" --train" ,
63
64
" --sdk-root=$sdk_root /" ,
64
65
" --platform=$sdk_root /vm_platform_strong.dill" ,
66
+ rebase_path (main_dart ),
65
67
]
66
68
output = " $root_out_dir /frontend_server.dart.snapshot"
67
69
}
You can’t perform that action at this time.
0 commit comments