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

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

Issue 2541933002: update analyzer cli to support include directive in analysis options file (Closed)
Patch Set: merge Created 4 years 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:core'; 7 import 'dart:core';
8 import 'dart:io' as io; 8 import 'dart:io' as io;
9 9
10 import 'package:analyzer/dart/ast/ast.dart' show CompilationUnit; 10 import 'package:analyzer/dart/ast/ast.dart' show CompilationUnit;
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 263
264 // Create the context. 264 // Create the context.
265 context = AnalysisEngine.instance.createAnalysisContext(); 265 context = AnalysisEngine.instance.createAnalysisContext();
266 context.sourceFactory = new SourceFactory(<UriResolver>[ 266 context.sourceFactory = new SourceFactory(<UriResolver>[
267 new DartUriResolver(sdk), 267 new DartUriResolver(sdk),
268 new InSummaryUriResolver(resourceProvider, summaryDataStore), 268 new InSummaryUriResolver(resourceProvider, summaryDataStore),
269 new ExplicitSourceResolver(uriToFileMap) 269 new ExplicitSourceResolver(uriToFileMap)
270 ]); 270 ]);
271 271
272 // Set context options. 272 // Set context options.
273 Driver.setAnalysisContextOptions(resourceProvider, context, options, 273 Driver.setAnalysisContextOptions(
274 resourceProvider, context.sourceFactory, context, options,
274 (AnalysisOptionsImpl contextOptions) { 275 (AnalysisOptionsImpl contextOptions) {
275 if (options.buildSummaryOnlyDiet) { 276 if (options.buildSummaryOnlyDiet) {
276 contextOptions.analyzeFunctionBodies = false; 277 contextOptions.analyzeFunctionBodies = false;
277 } 278 }
278 }); 279 });
279 280
280 if (!options.buildSummaryOnly) { 281 if (!options.buildSummaryOnly) {
281 // Configure using summaries. 282 // Configure using summaries.
282 context.typeProvider = sdk.context.typeProvider; 283 context.typeProvider = sdk.context.typeProvider;
283 context.resultProvider = 284 context.resultProvider =
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 * Build the inverse mapping of [uriToSourceMap]. 416 * Build the inverse mapping of [uriToSourceMap].
416 */ 417 */
417 static Map<String, Uri> _computePathToUriMap(Map<Uri, File> uriToSourceMap) { 418 static Map<String, Uri> _computePathToUriMap(Map<Uri, File> uriToSourceMap) {
418 Map<String, Uri> pathToUriMap = <String, Uri>{}; 419 Map<String, Uri> pathToUriMap = <String, Uri>{};
419 uriToSourceMap.forEach((Uri uri, File file) { 420 uriToSourceMap.forEach((Uri uri, File file) {
420 pathToUriMap[file.path] = uri; 421 pathToUriMap[file.path] = uri;
421 }); 422 });
422 return pathToUriMap; 423 return pathToUriMap;
423 } 424 }
424 } 425 }
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