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 library analyzer.test.src.summary.summarize_ast_test; | 5 library analyzer.test.src.summary.summarize_ast_test; |
6 | 6 |
7 import 'package:analyzer/analyzer.dart'; | 7 import 'package:analyzer/analyzer.dart'; |
8 import 'package:analyzer/dart/ast/ast.dart'; | 8 import 'package:analyzer/dart/ast/ast.dart'; |
9 import 'package:analyzer/dart/ast/token.dart'; | 9 import 'package:analyzer/dart/ast/token.dart'; |
10 import 'package:analyzer/error/listener.dart'; | 10 import 'package:analyzer/error/listener.dart'; |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 | 283 |
284 /** | 284 /** |
285 * Link together the given file, along with any other files passed to | 285 * Link together the given file, along with any other files passed to |
286 * [addNamedSource], to form a package bundle. Reset the state of the buffers | 286 * [addNamedSource], to form a package bundle. Reset the state of the buffers |
287 * accumulated by [addNamedSource] and [addBundle] so that further bundles | 287 * accumulated by [addNamedSource] and [addBundle] so that further bundles |
288 * can be created. | 288 * can be created. |
289 */ | 289 */ |
290 PackageBundleBuilder createPackageBundle(String text, | 290 PackageBundleBuilder createPackageBundle(String text, |
291 {String path: '/test.dart', String uri}) { | 291 {String path: '/test.dart', String uri}) { |
292 PackageBundleAssembler assembler = new PackageBundleAssembler(); | 292 PackageBundleAssembler assembler = new PackageBundleAssembler(); |
293 assembler.recordDependencies(_filesToLink.summaryDataStore); | |
294 LinkerInputs linkerInputs = createLinkerInputs(text, path: path, uri: uri); | 293 LinkerInputs linkerInputs = createLinkerInputs(text, path: path, uri: uri); |
295 Map<String, LinkedLibraryBuilder> linkedLibraries = link( | 294 Map<String, LinkedLibraryBuilder> linkedLibraries = link( |
296 linkerInputs.linkedLibraries, | 295 linkerInputs.linkedLibraries, |
297 linkerInputs.getDependency, | 296 linkerInputs.getDependency, |
298 linkerInputs.getUnit, | 297 linkerInputs.getUnit, |
299 linkerInputs.getDeclaredVariable, | 298 linkerInputs.getDeclaredVariable, |
300 true); | 299 true); |
301 linkedLibraries.forEach(assembler.addLinkedLibrary); | 300 linkedLibraries.forEach(assembler.addLinkedLibrary); |
302 linkerInputs._uriToUnit.forEach((String uri, UnlinkedUnit unit) { | 301 linkerInputs._uriToUnit.forEach((String uri, UnlinkedUnit unit) { |
303 // Note: it doesn't matter what we store for the hash because it isn't | 302 // Note: it doesn't matter what we store for the hash because it isn't |
(...skipping 27 matching lines...) Expand all Loading... |
331 class _FilesToLink { | 330 class _FilesToLink { |
332 /** | 331 /** |
333 * Map from absolute URI to the [UnlinkedUnit] for each compilation unit | 332 * Map from absolute URI to the [UnlinkedUnit] for each compilation unit |
334 * passed to [addNamedSource]. | 333 * passed to [addNamedSource]. |
335 */ | 334 */ |
336 Map<String, UnlinkedUnitBuilder> uriToUnit = <String, UnlinkedUnitBuilder>{}; | 335 Map<String, UnlinkedUnitBuilder> uriToUnit = <String, UnlinkedUnitBuilder>{}; |
337 | 336 |
338 /** | 337 /** |
339 * Information about summaries to be included in the link process. | 338 * Information about summaries to be included in the link process. |
340 */ | 339 */ |
341 SummaryDataStore summaryDataStore = | 340 SummaryDataStore summaryDataStore = new SummaryDataStore([]); |
342 new SummaryDataStore([], recordDependencyInfo: true); | |
343 } | 341 } |
OLD | NEW |