| 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/compiler_new.dart' as new_api; |
| 10 import 'package:compiler/src/apiimpl.dart'; | 11 import 'package:compiler/src/apiimpl.dart'; |
| 11 import 'package:compiler/src/commandline_options.dart'; | 12 import 'package:compiler/src/commandline_options.dart'; |
| 12 import 'package:compiler/src/diagnostics/messages.dart' show | 13 import 'package:compiler/src/diagnostics/messages.dart' show |
| 13 Message, | 14 Message, |
| 14 MessageKind; | 15 MessageKind; |
| 15 import 'package:compiler/src/filenames.dart'; | 16 import 'package:compiler/src/filenames.dart'; |
| 16 import 'package:compiler/src/source_file_provider.dart'; | 17 import 'package:compiler/src/source_file_provider.dart'; |
| 17 import 'package:compiler/src/util/uri_extras.dart'; | 18 import 'package:compiler/src/util/uri_extras.dart'; |
| 18 | 19 |
| 19 /** | 20 /** |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 case AnalysisMode.ALL: | 188 case AnalysisMode.ALL: |
| 188 options.add(Flags.analyzeAll); | 189 options.add(Flags.analyzeAll); |
| 189 break; | 190 break; |
| 190 case AnalysisMode.TREE_SHAKING: | 191 case AnalysisMode.TREE_SHAKING: |
| 191 break; | 192 break; |
| 192 } | 193 } |
| 193 var compiler = new CompilerImpl( | 194 var compiler = new CompilerImpl( |
| 194 provider, | 195 provider, |
| 195 null, | 196 null, |
| 196 handler, | 197 handler, |
| 197 libraryRoot, | 198 new new_api.CompilerOptions.parse( |
| 198 packageRoot, | 199 libraryRoot: libraryRoot, |
| 199 options, | 200 packageRoot: packageRoot, |
| 200 {}); | 201 options: options, |
| 202 environment: {})); |
| 201 String MESSAGE = """ | 203 String MESSAGE = """ |
| 202 | 204 |
| 203 | 205 |
| 204 === | 206 === |
| 205 === ERROR: Unexpected result of analysis. | 207 === ERROR: Unexpected result of analysis. |
| 206 === | 208 === |
| 207 === Please update [WHITE_LIST] in $testFileName | 209 === Please update [WHITE_LIST] in $testFileName |
| 208 === | 210 === |
| 209 """; | 211 """; |
| 210 | 212 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 223 if (checkResults != null) { | 225 if (checkResults != null) { |
| 224 result = checkResults(compiler, handler); | 226 result = checkResults(compiler, handler); |
| 225 } else { | 227 } else { |
| 226 result = handler.checkResults(); | 228 result = handler.checkResults(); |
| 227 } | 229 } |
| 228 if (!result) { | 230 if (!result) { |
| 229 print(MESSAGE); | 231 print(MESSAGE); |
| 230 exit(1); | 232 exit(1); |
| 231 } | 233 } |
| 232 } | 234 } |
| OLD | NEW |