Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Side by Side Diff: pkg/analyzer/test/src/summary/summarize_ast_test.dart

Issue 2226093002: Record information about a summary's dependencies in the summary itself. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/src/dart/scanner/reader.dart'; 10 import 'package:analyzer/src/dart/scanner/reader.dart';
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 342
343 /** 343 /**
344 * Link together the given file, along with any other files passed to 344 * Link together the given file, along with any other files passed to
345 * [addNamedSource], to form a package bundle. Reset the state of the buffers 345 * [addNamedSource], to form a package bundle. Reset the state of the buffers
346 * accumulated by [addNamedSource] and [addBundle] so that further bundles 346 * accumulated by [addNamedSource] and [addBundle] so that further bundles
347 * can be created. 347 * can be created.
348 */ 348 */
349 PackageBundleBuilder createPackageBundle(String text, 349 PackageBundleBuilder createPackageBundle(String text,
350 {String path: '/test.dart'}) { 350 {String path: '/test.dart'}) {
351 PackageBundleAssembler assembler = new PackageBundleAssembler(); 351 PackageBundleAssembler assembler = new PackageBundleAssembler();
352 assembler.recordDependencies(_filesToLink.summaryDataStore);
352 LinkerInputs linkerInputs = createLinkerInputs(text, path: path); 353 LinkerInputs linkerInputs = createLinkerInputs(text, path: path);
353 Map<String, LinkedLibraryBuilder> linkedLibraries = link( 354 Map<String, LinkedLibraryBuilder> linkedLibraries = link(
354 linkerInputs.linkedLibraries, 355 linkerInputs.linkedLibraries,
355 linkerInputs.getDependency, 356 linkerInputs.getDependency,
356 linkerInputs.getUnit, 357 linkerInputs.getUnit,
357 true); 358 true);
358 linkedLibraries.forEach(assembler.addLinkedLibrary); 359 linkedLibraries.forEach(assembler.addLinkedLibrary);
359 linkerInputs._uriToUnit.forEach((String uri, UnlinkedUnit unit) { 360 linkerInputs._uriToUnit.forEach((String uri, UnlinkedUnit unit) {
360 // Note: it doesn't matter what we store for the hash because it isn't 361 // Note: it doesn't matter what we store for the hash because it isn't
361 // used in these tests. 362 // used in these tests.
(...skipping 21 matching lines...) Expand all
383 class _FilesToLink { 384 class _FilesToLink {
384 /** 385 /**
385 * Map from absolute URI to the [UnlinkedUnit] for each compilation unit 386 * Map from absolute URI to the [UnlinkedUnit] for each compilation unit
386 * passed to [addNamedSource]. 387 * passed to [addNamedSource].
387 */ 388 */
388 Map<String, UnlinkedUnitBuilder> uriToUnit = <String, UnlinkedUnitBuilder>{}; 389 Map<String, UnlinkedUnitBuilder> uriToUnit = <String, UnlinkedUnitBuilder>{};
389 390
390 /** 391 /**
391 * Information about summaries to be included in the link process. 392 * Information about summaries to be included in the link process.
392 */ 393 */
393 SummaryDataStore summaryDataStore = new SummaryDataStore([]); 394 SummaryDataStore summaryDataStore =
395 new SummaryDataStore([], recordDependencyInfo: true);
394 } 396 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698