OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 /// Defines the front-end API for converting source code to summaries. | 5 /// Defines the front-end API for converting source code to summaries. |
6 library front_end.summary_generator; | 6 library front_end.summary_generator; |
7 | 7 |
8 import 'dart:async'; | 8 import 'dart:async'; |
9 import 'compiler_options.dart'; | 9 import 'compiler_options.dart'; |
10 | 10 |
11 import 'src/base/processed_options.dart'; | |
12 import 'src/kernel_generator_impl.dart'; | |
13 | |
14 /// Creates a summary representation of the build unit whose source files are in | 11 /// Creates a summary representation of the build unit whose source files are in |
15 /// [sources]. | 12 /// [sources]. |
16 /// | 13 /// |
17 /// Intended to be a part of a modular compilation process. | 14 /// Intended to be a part of a modular compilation process. |
18 /// | 15 /// |
19 /// [sources] should be the complete set of source files for a build unit | 16 /// [sources] should be the complete set of source files for a build unit |
20 /// (including both library and part files). | 17 /// (including both library and part files). |
21 /// | 18 /// |
22 /// By default, the compilation process is hermetic, meaning that the only files | 19 /// The summarization process is hermetic, meaning that the only files which |
23 /// which will be read are those listed in [sources], | 20 /// will be read are those listed in [sources], |
24 /// [CompilerOptions.inputSummaries], and [CompilerOptions.sdkSummary]. If a | 21 /// [CompilerOptions.inputSummaries], and [CompilerOptions.sdkSummary]. If a |
25 /// source file attempts to refer to a file which is not obtainable from these | 22 /// source file attempts to refer to a file which is not obtainable from these |
26 /// URIs, that will result in an error, even if the file exists on the | 23 /// paths, that will result in an error, even if the file exists on the |
27 /// filesystem. | 24 /// filesystem. |
28 /// | 25 /// |
29 /// When [CompilerOptions.chaseDependencies] is true, this default behavior | |
30 /// changes, and any dependency of [sources] that is not listed in | |
31 /// [CompilerOptions.inputSummaries] and [CompilerOptions.sdkSummary] is treated | |
32 /// as an additional source file for the build unit. | |
33 /// | |
34 /// Any `part` declarations found in [sources] must refer to part files which | 26 /// Any `part` declarations found in [sources] must refer to part files which |
35 /// are also listed in the build unit sources, otherwise an error results. (It | 27 /// are also listed in [sources], otherwise an error results. (It is not |
36 /// is not permitted to refer to a part file declared in another build unit). | 28 /// permitted to refer to a part file declared in another build unit). |
37 /// | 29 /// |
38 /// The return value is a list of bytes to write to the summary file. | 30 /// The return value is a list of bytes to write to the summary file. |
39 Future<List<int>> summaryFor(List<Uri> sources, CompilerOptions options) async { | 31 Future<List<int>> summaryFor(List<Uri> sources, CompilerOptions options) => |
40 return (await generateKernel(new ProcessedOptions(options, true, sources), | 32 throw new UnimplementedError(); |
41 buildSummary: true, buildProgram: false)) | |
42 ?.summary; | |
43 } | |
OLD | NEW |