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

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

Issue 2355413005: Issue 27375. Use ContextBuilder to find analysis options file in analyzer_cli. (Closed)
Patch Set: Created 4 years, 3 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 | no next file » | 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.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 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 CommandLineOptions options) { 737 CommandLineOptions options) {
738 file_system.File file; 738 file_system.File file;
739 String filePath = options.analysisOptionsFile; 739 String filePath = options.analysisOptionsFile;
740 if (filePath != null) { 740 if (filePath != null) {
741 file = resourceProvider.getFile(filePath); 741 file = resourceProvider.getFile(filePath);
742 if (!file.exists) { 742 if (!file.exists) {
743 printAndFail('Options file not found: $filePath', 743 printAndFail('Options file not found: $filePath',
744 exitCode: ErrorSeverity.ERROR.ordinal); 744 exitCode: ErrorSeverity.ERROR.ordinal);
745 } 745 }
746 } else { 746 } else {
747 filePath = AnalysisEngine.ANALYSIS_OPTIONS_FILE; 747 return new ContextBuilder(resourceProvider, null, null)
748 file = resourceProvider.getFile(filePath); 748 .getOptionsFile(options.sourceFiles.first);
Brian Wilkerson 2016/09/22 22:01:20 I'm not sure how this works. The method getOptions
749 if (!file.exists) {
750 filePath = AnalysisEngine.ANALYSIS_OPTIONS_YAML_FILE;
751 file = resourceProvider.getFile(filePath);
752 }
753 } 749 }
754 return file; 750 return file;
755 } 751 }
756 752
757 /// Convert [sourcePath] into an absolute path. 753 /// Convert [sourcePath] into an absolute path.
758 static String _normalizeSourcePath(String sourcePath) => 754 static String _normalizeSourcePath(String sourcePath) =>
759 path.normalize(new io.File(sourcePath).absolute.path); 755 path.normalize(new io.File(sourcePath).absolute.path);
760 756
761 static void _processAnalysisOptions( 757 static void _processAnalysisOptions(
762 file_system.ResourceProvider resourceProvider, 758 file_system.ResourceProvider resourceProvider,
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 for (var package in packages) { 869 for (var package in packages) {
874 var packageName = path.basename(package.path); 870 var packageName = path.basename(package.path);
875 var realPath = package.resolveSymbolicLinksSync(); 871 var realPath = package.resolveSymbolicLinksSync();
876 result[packageName] = [ 872 result[packageName] = [
877 PhysicalResourceProvider.INSTANCE.getFolder(realPath) 873 PhysicalResourceProvider.INSTANCE.getFolder(realPath)
878 ]; 874 ];
879 } 875 }
880 return result; 876 return result;
881 } 877 }
882 } 878 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698