| 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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 continue; | 237 continue; |
| 238 } | 238 } |
| 239 ErrorSeverity status = await _runAnalyzer(source, options); | 239 ErrorSeverity status = await _runAnalyzer(source, options); |
| 240 allResult = allResult.max(status); | 240 allResult = allResult.max(status); |
| 241 libUris.add(source.uri); | 241 libUris.add(source.uri); |
| 242 } | 242 } |
| 243 | 243 |
| 244 // Check that each part has a corresponding source in the input list. | 244 // Check that each part has a corresponding source in the input list. |
| 245 for (Source part in parts) { | 245 for (Source part in parts) { |
| 246 bool found = false; | 246 bool found = false; |
| 247 for (var lib in context.getLibrariesContaining(part)) { | 247 if (analysisDriver != null) { |
| 248 if (libUris.contains(lib.uri)) { | 248 var partFile = analysisDriver.fsState.getFileForPath(part.fullName); |
| 249 if (libUris.contains(partFile.library?.uri)) { |
| 249 found = true; | 250 found = true; |
| 250 } | 251 } |
| 252 } else { |
| 253 for (var lib in context.getLibrariesContaining(part)) { |
| 254 if (libUris.contains(lib.uri)) { |
| 255 found = true; |
| 256 } |
| 257 } |
| 251 } | 258 } |
| 252 if (!found) { | 259 if (!found) { |
| 253 errorSink.writeln("${part.fullName} is a part and cannot be analyzed."); | 260 errorSink.writeln("${part.fullName} is a part and cannot be analyzed."); |
| 254 errorSink.writeln("Please pass in a library that contains this part."); | 261 errorSink.writeln("Please pass in a library that contains this part."); |
| 255 io.exitCode = ErrorSeverity.ERROR.ordinal; | 262 io.exitCode = ErrorSeverity.ERROR.ordinal; |
| 256 allResult = allResult.max(ErrorSeverity.ERROR); | 263 allResult = allResult.max(ErrorSeverity.ERROR); |
| 257 } | 264 } |
| 258 } | 265 } |
| 259 | 266 |
| 260 if (!options.machineFormat) { | 267 if (!options.machineFormat) { |
| (...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 938 for (var package in packages) { | 945 for (var package in packages) { |
| 939 var packageName = path.basename(package.path); | 946 var packageName = path.basename(package.path); |
| 940 var realPath = package.resolveSymbolicLinksSync(); | 947 var realPath = package.resolveSymbolicLinksSync(); |
| 941 result[packageName] = [ | 948 result[packageName] = [ |
| 942 PhysicalResourceProvider.INSTANCE.getFolder(realPath) | 949 PhysicalResourceProvider.INSTANCE.getFolder(realPath) |
| 943 ]; | 950 ]; |
| 944 } | 951 } |
| 945 return result; | 952 return result; |
| 946 } | 953 } |
| 947 } | 954 } |
| OLD | NEW |