| 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'dart:io' as io; | 6 import 'dart:io' as io; |
| 7 | 7 |
| 8 import 'package:analyzer/error/error.dart'; | 8 import 'package:analyzer/error/error.dart'; |
| 9 import 'package:analyzer/file_system/file_system.dart' as file_system; | 9 import 'package:analyzer/file_system/file_system.dart' as file_system; |
| 10 import 'package:analyzer/file_system/file_system.dart'; | 10 import 'package:analyzer/file_system/file_system.dart'; |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 // Wait a brief time for any analytics calls to finish. | 218 // Wait a brief time for any analytics calls to finish. |
| 219 await analytics.waitForLastPing(timeout: new Duration(milliseconds: 200)); | 219 await analytics.waitForLastPing(timeout: new Duration(milliseconds: 200)); |
| 220 analytics.close(); | 220 analytics.close(); |
| 221 } | 221 } |
| 222 | 222 |
| 223 Future<ErrorSeverity> _analyzeAll(CommandLineOptions options) async { | 223 Future<ErrorSeverity> _analyzeAll(CommandLineOptions options) async { |
| 224 PerformanceTag previous = _analyzeAllTag.makeCurrent(); | 224 PerformanceTag previous = _analyzeAllTag.makeCurrent(); |
| 225 try { | 225 try { |
| 226 return await _analyzeAllImpl(options); | 226 return await _analyzeAllImpl(options); |
| 227 } catch (e, st) { | 227 } catch (e, st) { |
| 228 crashReportSender.sendReport(e, stackTrace: st); | 228 // Catch and ignore any exceptions when reporting exceptions (network |
| 229 // errors or other). |
| 230 crashReportSender.sendReport(e, stackTrace: st).catchError((_) {}); |
| 229 rethrow; | 231 rethrow; |
| 230 } finally { | 232 } finally { |
| 231 previous.makeCurrent(); | 233 previous.makeCurrent(); |
| 232 } | 234 } |
| 233 } | 235 } |
| 234 | 236 |
| 235 /// Perform analysis according to the given [options]. | 237 /// Perform analysis according to the given [options]. |
| 236 Future<ErrorSeverity> _analyzeAllImpl(CommandLineOptions options) async { | 238 Future<ErrorSeverity> _analyzeAllImpl(CommandLineOptions options) async { |
| 237 if (!options.machineFormat) { | 239 if (!options.machineFormat) { |
| 238 List<String> fileNames = options.sourceFiles.map((String file) { | 240 List<String> fileNames = options.sourceFiles.map((String file) { |
| (...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1005 for (var package in packages) { | 1007 for (var package in packages) { |
| 1006 var packageName = path.basename(package.path); | 1008 var packageName = path.basename(package.path); |
| 1007 var realPath = package.resolveSymbolicLinksSync(); | 1009 var realPath = package.resolveSymbolicLinksSync(); |
| 1008 result[packageName] = [ | 1010 result[packageName] = [ |
| 1009 PhysicalResourceProvider.INSTANCE.getFolder(realPath) | 1011 PhysicalResourceProvider.INSTANCE.getFolder(realPath) |
| 1010 ]; | 1012 ]; |
| 1011 } | 1013 } |
| 1012 return result; | 1014 return result; |
| 1013 } | 1015 } |
| 1014 } | 1016 } |
| OLD | NEW |