| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 analyze_helper; | 5 library analyze_helper; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:io'; | 8 import 'dart:io'; |
| 9 import 'package:compiler/compiler.dart' as api; | 9 import 'package:compiler/compiler.dart' as api; |
| 10 import 'package:compiler/src/apiimpl.dart'; | 10 import 'package:compiler/src/apiimpl.dart'; |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 === | 147 === |
| 148 | 148 |
| 149 | 149 |
| 150 """); | 150 """); |
| 151 | 151 |
| 152 var libraryRoot = currentDirectory.resolve('sdk/'); | 152 var libraryRoot = currentDirectory.resolve('sdk/'); |
| 153 var packageRoot = | 153 var packageRoot = |
| 154 currentDirectory.resolveUri(new Uri.file('${Platform.packageRoot}/')); | 154 currentDirectory.resolveUri(new Uri.file('${Platform.packageRoot}/')); |
| 155 var provider = new CompilerSourceFileProvider(); | 155 var provider = new CompilerSourceFileProvider(); |
| 156 var handler = new CollectingDiagnosticHandler(whiteList, provider); | 156 var handler = new CollectingDiagnosticHandler(whiteList, provider); |
| 157 var options = <String>['--analyze-only', '--categories=Client,Server']; | 157 var options = <String>['--analyze-only', '--categories=Client,Server', |
| 158 '--show-package-warnings']; |
| 158 if (analyzeAll) options.add('--analyze-all'); | 159 if (analyzeAll) options.add('--analyze-all'); |
| 159 var compiler = new Compiler( | 160 var compiler = new Compiler( |
| 160 provider.readStringFromUri, | 161 provider.readStringFromUri, |
| 161 null, | 162 null, |
| 162 handler.diagnosticHandler, | 163 handler.diagnosticHandler, |
| 163 libraryRoot, packageRoot, | 164 libraryRoot, packageRoot, |
| 164 options, | 165 options, |
| 165 {}); | 166 {}); |
| 166 String MESSAGE = """ | 167 String MESSAGE = """ |
| 167 | 168 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 185 exit(1); | 186 exit(1); |
| 186 } | 187 } |
| 187 } | 188 } |
| 188 if (analyzeAll) { | 189 if (analyzeAll) { |
| 189 compiler.librariesToAnalyzeWhenRun = uriList; | 190 compiler.librariesToAnalyzeWhenRun = uriList; |
| 190 return compiler.run(null).then(onCompletion); | 191 return compiler.run(null).then(onCompletion); |
| 191 } else { | 192 } else { |
| 192 return compiler.run(uriList.single).then(onCompletion); | 193 return compiler.run(uriList.single).then(onCompletion); |
| 193 } | 194 } |
| 194 } | 195 } |
| OLD | NEW |