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/kernel_generator_impl.dart'; | |
12 | |
11 /// Creates a summary representation of the build unit whose source files are in | 13 /// Creates a summary representation of the build unit whose source files are in |
12 /// [sources]. | 14 /// [sources]. |
13 /// | 15 /// |
14 /// Intended to be a part of a modular compilation process. | 16 /// Intended to be a part of a modular compilation process. |
15 /// | 17 /// |
16 /// [sources] should be the complete set of source files for a build unit | 18 /// [sources] should be the complete set of source files for a build unit |
17 /// (including both library and part files). | 19 /// (including both library and part files). |
18 /// | 20 /// |
19 /// The summarization process is hermetic, meaning that the only files which | 21 /// By default, the compilation process is hermetic, meaning that the only files |
20 /// will be read are those listed in [sources], | 22 /// which will be read are those listed in [sources], |
21 /// [CompilerOptions.inputSummaries], and [CompilerOptions.sdkSummary]. If a | 23 /// [CompilerOptions.inputSummaries], and [CompilerOptions.sdkSummary]. If a |
22 /// source file attempts to refer to a file which is not obtainable from these | 24 /// source file attempts to refer to a file which is not obtainable from these |
23 /// paths, that will result in an error, even if the file exists on the | 25 /// URIs, that will result in an error, even if the file exists on the |
24 /// filesystem. | 26 /// filesystem. |
25 /// | 27 /// |
28 /// When [CompilerOptions.chaseDependencies] is true, this default behavior | |
29 /// changes, and any dependency of [sources] that is not listed in | |
30 /// [CompilerOptions.inputSummaries] and [CompilerOptions.sdkSummary] is treated | |
31 /// as an additional source file for the build unit. | |
32 /// | |
26 /// Any `part` declarations found in [sources] must refer to part files which | 33 /// Any `part` declarations found in [sources] must refer to part files which |
27 /// are also listed in [sources], otherwise an error results. (It is not | 34 /// are also listed in the build unit sources, otherwise an error results. (It |
28 /// permitted to refer to a part file declared in another build unit). | 35 /// is not permitted to refer to a part file declared in another build unit). |
29 /// | 36 /// |
30 /// The return value is a list of bytes to write to the summary file. | 37 /// The return value is a list of bytes to write to the summary file. |
ahe
2017/07/03 10:05:31
If we're concerned about memory usage, this API sh
Siggi Cherem (dart-lang)
2017/07/05 03:39:30
True - we also have some open discussion about whe
| |
31 Future<List<int>> summaryFor(List<Uri> sources, CompilerOptions options) => | 38 Future<List<int>> summaryFor(List<Uri> sources, CompilerOptions options) async { |
32 throw new UnimplementedError(); | 39 return (await generateKernel(sources, options, |
40 buildSummary: true, buildProgram: false)) | |
41 ?.summary; | |
42 } | |
OLD | NEW |