| OLD | NEW |
| 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 'package:analyzer/file_system/file_system.dart'; | 5 import 'package:analyzer/file_system/file_system.dart'; |
| 6 import 'package:analyzer/source/analysis_options_provider.dart'; | 6 import 'package:analyzer/source/analysis_options_provider.dart'; |
| 7 import 'package:analyzer/src/generated/engine.dart'; | 7 import 'package:analyzer/src/generated/engine.dart'; |
| 8 import 'package:analyzer/src/task/model.dart'; | 8 import 'package:analyzer/src/task/model.dart'; |
| 9 import 'package:analyzer/task/model.dart'; | 9 import 'package:analyzer/task/model.dart'; |
| 10 import 'package:package_config/packages.dart'; | 10 import 'package:package_config/packages.dart'; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 if (config is YamlMap) { | 84 if (config is YamlMap) { |
| 85 AnalysisConfigurationDescriptor descriptor = | 85 AnalysisConfigurationDescriptor descriptor = |
| 86 new AnalysisConfigurationDescriptor.fromAnalyzerOptions(config); | 86 new AnalysisConfigurationDescriptor.fromAnalyzerOptions(config); |
| 87 | 87 |
| 88 if (descriptor.isValid) { | 88 if (descriptor.isValid) { |
| 89 //Create a path, given descriptor and packagemap | 89 //Create a path, given descriptor and packagemap |
| 90 Uri uri = packages.asMap()[descriptor.package]; | 90 Uri uri = packages.asMap()[descriptor.package]; |
| 91 Uri pragma = new Uri.file('config/${descriptor.pragma}.yaml', | 91 Uri pragma = new Uri.file('config/${descriptor.pragma}.yaml', |
| 92 windows: false); | 92 windows: false); |
| 93 Uri optionsUri = uri.resolveUri(pragma); | 93 Uri optionsUri = uri.resolveUri(pragma); |
| 94 File file = resourceProvider.getFile(optionsUri.toFilePath()); | 94 String path = resourceProvider.pathContext.fromUri(optionsUri); |
| 95 File file = resourceProvider.getFile(path); |
| 95 if (file.exists) { | 96 if (file.exists) { |
| 96 return optionsProvider.getOptionsFromFile(file); | 97 return optionsProvider.getOptionsFromFile(file); |
| 97 } | 98 } |
| 98 } | 99 } |
| 99 } | 100 } |
| 100 } | 101 } |
| 101 } catch (_) { | 102 } catch (_) { |
| 102 // Skip exceptional configurations. | 103 // Skip exceptional configurations. |
| 103 } | 104 } |
| 104 } | 105 } |
| 105 return null; | 106 return null; |
| 106 } | 107 } |
| 107 } | 108 } |
| OLD | NEW |