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

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

Issue 2976683002: Refactor creating AnalysisOptionsImpl and declared variables. (Closed)
Patch Set: Created 3 years, 5 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
« no previous file with comments | « no previous file | pkg/analyzer_cli/lib/src/driver.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.build_mode; 5 library analyzer_cli.src.build_mode;
6 6
7 import 'dart:io' as io; 7 import 'dart:io' as io;
8 8
9 import 'package:analyzer/dart/ast/ast.dart' show CompilationUnit; 9 import 'package:analyzer/dart/ast/ast.dart' show CompilationUnit;
10 import 'package:analyzer/error/error.dart'; 10 import 'package:analyzer/error/error.dart';
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 318
319 // Create the context. 319 // Create the context.
320 context = AnalysisEngine.instance.createAnalysisContext(); 320 context = AnalysisEngine.instance.createAnalysisContext();
321 context.sourceFactory = new SourceFactory(<UriResolver>[ 321 context.sourceFactory = new SourceFactory(<UriResolver>[
322 new DartUriResolver(sdk), 322 new DartUriResolver(sdk),
323 new InSummaryUriResolver(resourceProvider, summaryDataStore), 323 new InSummaryUriResolver(resourceProvider, summaryDataStore),
324 new ExplicitSourceResolver(uriToFileMap) 324 new ExplicitSourceResolver(uriToFileMap)
325 ]); 325 ]);
326 326
327 // Set context options. 327 // Set context options.
328 Driver.setAnalysisContextOptions(resourceProvider, context, options); 328 Driver.declareVariables(context.declaredVariables, options);
329 AnalysisOptionsImpl analysisOptions = Driver
330 .createAnalysisOptionsForCommandLineOptions(resourceProvider, options);
331 context.analysisOptions = analysisOptions;
329 332
330 if (!options.buildSummaryOnly) { 333 if (!options.buildSummaryOnly) {
331 // Configure using summaries. 334 // Configure using summaries.
332 context.typeProvider = sdk.context.typeProvider; 335 context.typeProvider = sdk.context.typeProvider;
333 context.resultProvider = 336 context.resultProvider =
334 new InputPackagesResultProvider(context, summaryDataStore); 337 new InputPackagesResultProvider(context, summaryDataStore);
335 } 338 }
336 } 339 }
337 340
338 /** 341 /**
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 * Build the inverse mapping of [uriToSourceMap]. 474 * Build the inverse mapping of [uriToSourceMap].
472 */ 475 */
473 static Map<String, Uri> _computePathToUriMap(Map<Uri, File> uriToSourceMap) { 476 static Map<String, Uri> _computePathToUriMap(Map<Uri, File> uriToSourceMap) {
474 Map<String, Uri> pathToUriMap = <String, Uri>{}; 477 Map<String, Uri> pathToUriMap = <String, Uri>{};
475 uriToSourceMap.forEach((Uri uri, File file) { 478 uriToSourceMap.forEach((Uri uri, File file) {
476 pathToUriMap[file.path] = uri; 479 pathToUriMap[file.path] = uri;
477 }); 480 });
478 return pathToUriMap; 481 return pathToUriMap;
479 } 482 }
480 } 483 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer_cli/lib/src/driver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698