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

Unified Diff: pkg/analyzer_experimental/bin/analyzer.dart

Issue 15675016: More fixes for java2dart and status files. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer_experimental/bin/analyzer.dart
diff --git a/pkg/analyzer_experimental/bin/analyzer.dart b/pkg/analyzer_experimental/bin/analyzer.dart
index c9b83c8c1e5cf6d40b1aa3e4772d24a36c0a43f0..f8f48e61b53a42dd936fc89b80bd5da6f61cbe66 100644
--- a/pkg/analyzer_experimental/bin/analyzer.dart
+++ b/pkg/analyzer_experimental/bin/analyzer.dart
@@ -42,32 +42,30 @@ ErrorSeverity _runAnalyzer(CommandLineOptions options) {
stdout.writeln("Analyzing ${options.sourceFiles}...");
}
ErrorSeverity allResult = ErrorSeverity.NONE;
- for (String sourcePath in options.sourceFiles) {
- sourcePath = sourcePath.trim();
- // check that file exists
- if (!new File(sourcePath).existsSync()) {
- print('File not found: $sourcePath');
- return ErrorSeverity.ERROR;
- }
- // check that file is Dart file
- if (!AnalysisEngine.isDartFileName(sourcePath)) {
- print('$sourcePath is not a Dart file');
- return ErrorSeverity.ERROR;
- }
- // do analyze
- ErrorFormatter formatter = new ErrorFormatter(options.machineFormat ? stderr : stdout, options);
- AnalyzerImpl analyzer = new AnalyzerImpl(options);
- analyzer.analyze(sourcePath);
- // pring errors
- formatter.formatErrors(analyzer.errorInfos);
- // prepare status
- ErrorSeverity status = analyzer.maxErrorSeverity;
- if (status == ErrorSeverity.WARNING && options.warningsAreFatal) {
- status = ErrorSeverity.ERROR;
- }
- allResult = allResult.max(status);
+ String sourcePath = options.sourceFiles[0];
+ sourcePath = sourcePath.trim();
+ // check that file exists
+ if (!new File(sourcePath).existsSync()) {
+ print('File not found: $sourcePath');
+ return ErrorSeverity.ERROR;
}
- return allResult;
+ // check that file is Dart file
+ if (!AnalysisEngine.isDartFileName(sourcePath)) {
+ print('$sourcePath is not a Dart file');
+ return ErrorSeverity.ERROR;
+ }
+ // do analyze
+ ErrorFormatter formatter = new ErrorFormatter(options.machineFormat ? stderr : stdout, options);
+ AnalyzerImpl analyzer = new AnalyzerImpl(options);
+ analyzer.analyze(sourcePath);
+ // pring errors
Brian Wilkerson 2013/06/06 16:53:18 "pring" --> "print"
+ formatter.formatErrors(analyzer.errorInfos);
Brian Wilkerson 2013/06/06 16:53:18 It might already be getting done, but somewhere we
+ // prepare status
+ ErrorSeverity status = analyzer.maxErrorSeverity;
+ if (status == ErrorSeverity.WARNING && options.warningsAreFatal) {
+ status = ErrorSeverity.ERROR;
+ }
+ return status;
}
typedef ErrorSeverity BatchRunnerHandler(List<String> args);

Powered by Google App Engine
This is Rietveld 408576698