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

Side by Side Diff: pkg/dev_compiler/lib/src/compiler/compiler.dart

Issue 2652823002: Use single InputPackagesResultProvider, without SdkSummaryResultProvider. (Closed)
Patch Set: Fixes for analyzer_cli. 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) 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 import 'dart:collection' show HashSet, Queue; 5 import 'dart:collection' show HashSet, Queue;
6 import 'dart:convert' show BASE64, JSON, UTF8; 6 import 'dart:convert' show BASE64, JSON, UTF8;
7 import 'dart:io' show File; 7 import 'dart:io' show File;
8 import 'package:analyzer/dart/element/element.dart' show LibraryElement; 8 import 'package:analyzer/dart/element/element.dart' show LibraryElement;
9 import 'package:analyzer/analyzer.dart' 9 import 'package:analyzer/analyzer.dart'
10 show AnalysisError, CompilationUnit, ErrorSeverity; 10 show AnalysisError, CompilationUnit, ErrorSeverity;
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 options: options.contextBuilderOptions); 79 options: options.contextBuilderOptions);
80 80
81 var analysisOptions = contextBuilder.getAnalysisOptions(analysisRoot); 81 var analysisOptions = contextBuilder.getAnalysisOptions(analysisRoot);
82 var sdk = contextBuilder.findSdk(null, analysisOptions); 82 var sdk = contextBuilder.findSdk(null, analysisOptions);
83 83
84 var sdkResolver = new DartUriResolver(sdk); 84 var sdkResolver = new DartUriResolver(sdk);
85 85
86 // Read the summaries. 86 // Read the summaries.
87 var summaryData = 87 var summaryData =
88 new SummaryDataStore(options.summaryPaths, recordDependencyInfo: true); 88 new SummaryDataStore(options.summaryPaths, recordDependencyInfo: true);
89 summaryData.addBundle(null, sdk.getLinkedBundle());
vsm 2017/01/23 23:43:37 Does it make sense to pass the sdk to the SummaryD
89 90
90 var srcFactory = createSourceFactory(options, 91 var srcFactory = createSourceFactory(options,
91 sdkResolver: sdkResolver, 92 sdkResolver: sdkResolver,
92 fileResolvers: fileResolvers, 93 fileResolvers: fileResolvers,
93 summaryData: summaryData, 94 summaryData: summaryData,
94 resourceProvider: resourceProvider); 95 resourceProvider: resourceProvider);
95 96
96 var context = 97 var context =
97 AnalysisEngine.instance.createAnalysisContext() as AnalysisContextImpl; 98 AnalysisEngine.instance.createAnalysisContext() as AnalysisContextImpl;
98 context.analysisOptions = analysisOptions; 99 context.analysisOptions = analysisOptions;
99 context.sourceFactory = srcFactory; 100 context.sourceFactory = srcFactory;
100 context.typeProvider = sdkResolver.dartSdk.context.typeProvider;
101 context.resultProvider = 101 context.resultProvider =
102 new InputPackagesResultProvider(context, summaryData); 102 new InputPackagesResultProvider(context, summaryData);
103 options.declaredVariables.forEach(context.declaredVariables.define); 103 options.declaredVariables.forEach(context.declaredVariables.define);
104 context.declaredVariables.define('dart.isVM', 'false'); 104 context.declaredVariables.define('dart.isVM', 'false');
105 105
106 // TODO(vsm): Should this be hardcoded? 106 // TODO(vsm): Should this be hardcoded?
107 context.declaredVariables.define('dart.library.html', 'true'); 107 context.declaredVariables.define('dart.library.html', 'true');
108 context.declaredVariables.define('dart.library.io', 'false'); 108 context.declaredVariables.define('dart.library.io', 'false');
109 109
110 if (!context.analysisOptions.strongMode) { 110 if (!context.analysisOptions.strongMode) {
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 // Fall back to a relative path. 571 // Fall back to a relative path.
572 return path.toUri(path.relative(path.fromUri(uri), from: dir)).toString(); 572 return path.toUri(path.relative(path.fromUri(uri), from: dir)).toString();
573 } 573 }
574 574
575 for (int i = 0; i < list.length; i++) { 575 for (int i = 0; i < list.length; i++) {
576 list[i] = transformUri(list[i]); 576 list[i] = transformUri(list[i]);
577 } 577 }
578 map['file'] = transformUri(map['file']); 578 map['file'] = transformUri(map['file']);
579 return map; 579 return map;
580 } 580 }
OLDNEW
« no previous file with comments | « pkg/analyzer_cli/lib/src/driver.dart ('k') | pkg/front_end/lib/src/incremental_resolved_ast_generator_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698