OLD | NEW |
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 Loading... |
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 return new ContextBuilder(resourceProvider, null, null) | 747 filePath = AnalysisEngine.ANALYSIS_OPTIONS_FILE; |
748 .getOptionsFile(options.sourceFiles.first); | 748 file = resourceProvider.getFile(filePath); |
| 749 if (!file.exists) { |
| 750 filePath = AnalysisEngine.ANALYSIS_OPTIONS_YAML_FILE; |
| 751 file = resourceProvider.getFile(filePath); |
| 752 } |
749 } | 753 } |
750 return file; | 754 return file; |
751 } | 755 } |
752 | 756 |
753 /// Convert [sourcePath] into an absolute path. | 757 /// Convert [sourcePath] into an absolute path. |
754 static String _normalizeSourcePath(String sourcePath) => | 758 static String _normalizeSourcePath(String sourcePath) => |
755 path.normalize(new io.File(sourcePath).absolute.path); | 759 path.normalize(new io.File(sourcePath).absolute.path); |
756 | 760 |
757 static void _processAnalysisOptions( | 761 static void _processAnalysisOptions( |
758 file_system.ResourceProvider resourceProvider, | 762 file_system.ResourceProvider resourceProvider, |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
869 for (var package in packages) { | 873 for (var package in packages) { |
870 var packageName = path.basename(package.path); | 874 var packageName = path.basename(package.path); |
871 var realPath = package.resolveSymbolicLinksSync(); | 875 var realPath = package.resolveSymbolicLinksSync(); |
872 result[packageName] = [ | 876 result[packageName] = [ |
873 PhysicalResourceProvider.INSTANCE.getFolder(realPath) | 877 PhysicalResourceProvider.INSTANCE.getFolder(realPath) |
874 ]; | 878 ]; |
875 } | 879 } |
876 return result; | 880 return result; |
877 } | 881 } |
878 } | 882 } |
OLD | NEW |