| 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 === NOTE: If this test fails, update [WHITE_LIST] in $testFileName | 149 === NOTE: If this test fails, update [WHITE_LIST] in $testFileName |
| 150 === | 150 === |
| 151 | 151 |
| 152 | 152 |
| 153 """); | 153 """); |
| 154 | 154 |
| 155 var libraryRoot = currentDirectory.resolve('sdk/'); | 155 var libraryRoot = currentDirectory.resolve('sdk/'); |
| 156 var packageRoot = | 156 var packageRoot = |
| 157 currentDirectory.resolveUri(new Uri.file('${Platform.packageRoot}/')); | 157 currentDirectory.resolveUri(Uri.parse(Platform.packageRoot)); |
| 158 var provider = new CompilerSourceFileProvider(); | 158 var provider = new CompilerSourceFileProvider(); |
| 159 var handler = new CollectingDiagnosticHandler(whiteList, provider); | 159 var handler = new CollectingDiagnosticHandler(whiteList, provider); |
| 160 var options = <String>[Flags.analyzeOnly, '--categories=Client,Server', | 160 var options = <String>[Flags.analyzeOnly, '--categories=Client,Server', |
| 161 Flags.showPackageWarnings]; | 161 Flags.showPackageWarnings]; |
| 162 if (analyzeAll) options.add(Flags.analyzeAll); | 162 if (analyzeAll) options.add(Flags.analyzeAll); |
| 163 if (analyzeMain) options.add(Flags.analyzeMain); | 163 if (analyzeMain) options.add(Flags.analyzeMain); |
| 164 var compiler = new CompilerImpl( | 164 var compiler = new CompilerImpl( |
| 165 provider, | 165 provider, |
| 166 null, | 166 null, |
| 167 handler, | 167 handler, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 191 exit(1); | 191 exit(1); |
| 192 } | 192 } |
| 193 } | 193 } |
| 194 if (analyzeAll || analyzeMain) { | 194 if (analyzeAll || analyzeMain) { |
| 195 compiler.librariesToAnalyzeWhenRun = uriList; | 195 compiler.librariesToAnalyzeWhenRun = uriList; |
| 196 return compiler.run(null).then(onCompletion); | 196 return compiler.run(null).then(onCompletion); |
| 197 } else { | 197 } else { |
| 198 return compiler.run(uriList.single).then(onCompletion); | 198 return compiler.run(uriList.single).then(onCompletion); |
| 199 } | 199 } |
| 200 } | 200 } |
| OLD | NEW |