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

Side by Side Diff: pkg/analyzer_cli/lib/src/driver.dart

Issue 2648213007: Revert "Use single InputPackagesResultProvider, without SdkSummaryResultProvider." (Closed)
Patch Set: Created 3 years, 11 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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_cli.src.driver; 5 library analyzer_cli.src.driver;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:convert'; 8 import 'dart:convert';
9 import 'dart:io' as io; 9 import 'dart:io' as io;
10 10
(...skipping 14 matching lines...) Expand all
25 import 'package:analyzer/src/generated/interner.dart'; 25 import 'package:analyzer/src/generated/interner.dart';
26 import 'package:analyzer/src/generated/java_engine.dart'; 26 import 'package:analyzer/src/generated/java_engine.dart';
27 import 'package:analyzer/src/generated/sdk.dart'; 27 import 'package:analyzer/src/generated/sdk.dart';
28 import 'package:analyzer/src/generated/source.dart'; 28 import 'package:analyzer/src/generated/source.dart';
29 import 'package:analyzer/src/generated/source_io.dart'; 29 import 'package:analyzer/src/generated/source_io.dart';
30 import 'package:analyzer/src/generated/utilities_general.dart' 30 import 'package:analyzer/src/generated/utilities_general.dart'
31 show PerformanceTag; 31 show PerformanceTag;
32 import 'package:analyzer/src/lint/registry.dart'; 32 import 'package:analyzer/src/lint/registry.dart';
33 import 'package:analyzer/src/services/lint.dart'; 33 import 'package:analyzer/src/services/lint.dart';
34 import 'package:analyzer/src/source/source_resource.dart'; 34 import 'package:analyzer/src/source/source_resource.dart';
35 import 'package:analyzer/src/summary/idl.dart';
36 import 'package:analyzer/src/summary/package_bundle_reader.dart'; 35 import 'package:analyzer/src/summary/package_bundle_reader.dart';
37 import 'package:analyzer/src/summary/summary_sdk.dart' show SummaryBasedDartSdk; 36 import 'package:analyzer/src/summary/summary_sdk.dart' show SummaryBasedDartSdk;
38 import 'package:analyzer/src/task/options.dart'; 37 import 'package:analyzer/src/task/options.dart';
39 import 'package:analyzer_cli/src/analyzer_impl.dart'; 38 import 'package:analyzer_cli/src/analyzer_impl.dart';
40 import 'package:analyzer_cli/src/build_mode.dart'; 39 import 'package:analyzer_cli/src/build_mode.dart';
41 import 'package:analyzer_cli/src/error_formatter.dart'; 40 import 'package:analyzer_cli/src/error_formatter.dart';
42 import 'package:analyzer_cli/src/options.dart'; 41 import 'package:analyzer_cli/src/options.dart';
43 import 'package:analyzer_cli/src/perf_report.dart'; 42 import 'package:analyzer_cli/src/perf_report.dart';
44 import 'package:analyzer_cli/starter.dart'; 43 import 'package:analyzer_cli/starter.dart';
45 import 'package:linter/src/rules.dart' as linter; 44 import 'package:linter/src/rules.dart' as linter;
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 'Summaries are not yet supported when using Flutter.'); 509 'Summaries are not yet supported when using Flutter.');
511 } 510 }
512 511
513 // Read any input summaries. 512 // Read any input summaries.
514 SummaryDataStore summaryDataStore = new SummaryDataStore( 513 SummaryDataStore summaryDataStore = new SummaryDataStore(
515 useSummaries ? options.buildSummaryInputs : <String>[]); 514 useSummaries ? options.buildSummaryInputs : <String>[]);
516 515
517 // Once options and embedders are processed, setup the SDK. 516 // Once options and embedders are processed, setup the SDK.
518 _setupSdk(options, useSummaries); 517 _setupSdk(options, useSummaries);
519 518
520 PackageBundle sdkBundle = sdk.getLinkedBundle();
521 if (sdkBundle != null) {
522 summaryDataStore.addBundle(null, sdkBundle);
523 }
524
525 // Choose a package resolution policy and a diet parsing policy based on 519 // Choose a package resolution policy and a diet parsing policy based on
526 // the command-line options. 520 // the command-line options.
527 SourceFactory sourceFactory = _chooseUriResolutionPolicy( 521 SourceFactory sourceFactory = _chooseUriResolutionPolicy(
528 options, embedderMap, packageInfo, summaryDataStore); 522 options, embedderMap, packageInfo, summaryDataStore);
529 523
530 AnalyzeFunctionBodiesPredicate dietParsingPolicy = 524 AnalyzeFunctionBodiesPredicate dietParsingPolicy =
531 _chooseDietParsingPolicy(options); 525 _chooseDietParsingPolicy(options);
532 setAnalysisContextOptions( 526 setAnalysisContextOptions(
533 resourceProvider, sourceFactory, _context, options, 527 resourceProvider, sourceFactory, _context, options,
534 (AnalysisOptionsImpl contextOptions) { 528 (AnalysisOptionsImpl contextOptions) {
535 contextOptions.analyzeFunctionBodiesPredicate = dietParsingPolicy; 529 contextOptions.analyzeFunctionBodiesPredicate = dietParsingPolicy;
536 }); 530 });
537 531
538 _context.sourceFactory = sourceFactory; 532 _context.sourceFactory = sourceFactory;
539 if (sdkBundle != null) { 533 _context.resultProvider =
540 _context.resultProvider = 534 new InputPackagesResultProvider(_context, summaryDataStore);
541 new InputPackagesResultProvider(_context, summaryDataStore);
542 }
543 } 535 }
544 536
545 /// Return discovered packagespec, or `null` if none is found. 537 /// Return discovered packagespec, or `null` if none is found.
546 Packages _discoverPackagespec(Uri root) { 538 Packages _discoverPackagespec(Uri root) {
547 try { 539 try {
548 Packages packages = pkg_discovery.findPackagesFromFile(root); 540 Packages packages = pkg_discovery.findPackagesFromFile(root);
549 if (packages != Packages.noPackages) { 541 if (packages != Packages.noPackages) {
550 return packages; 542 return packages;
551 } 543 }
552 } catch (_) { 544 } catch (_) {
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 for (var package in packages) { 869 for (var package in packages) {
878 var packageName = path.basename(package.path); 870 var packageName = path.basename(package.path);
879 var realPath = package.resolveSymbolicLinksSync(); 871 var realPath = package.resolveSymbolicLinksSync();
880 result[packageName] = [ 872 result[packageName] = [
881 PhysicalResourceProvider.INSTANCE.getFolder(realPath) 873 PhysicalResourceProvider.INSTANCE.getFolder(realPath)
882 ]; 874 ];
883 } 875 }
884 return result; 876 return result;
885 } 877 }
886 } 878 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/src/summary/resynthesize_common.dart ('k') | pkg/dev_compiler/lib/src/compiler/compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698