OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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; | |
11 import 'package:compiler/src/apiimpl.dart'; | 10 import 'package:compiler/src/apiimpl.dart'; |
12 import 'package:compiler/src/commandline_options.dart'; | 11 import 'package:compiler/src/commandline_options.dart'; |
13 import 'package:compiler/src/diagnostics/messages.dart' show | 12 import 'package:compiler/src/diagnostics/messages.dart' show |
14 Message, | 13 Message, |
15 MessageKind; | 14 MessageKind; |
16 import 'package:compiler/src/filenames.dart'; | 15 import 'package:compiler/src/filenames.dart'; |
| 16 import 'package:compiler/src/options.dart' show |
| 17 CompilerOptions; |
17 import 'package:compiler/src/source_file_provider.dart'; | 18 import 'package:compiler/src/source_file_provider.dart'; |
18 import 'package:compiler/src/util/uri_extras.dart'; | 19 import 'package:compiler/src/util/uri_extras.dart'; |
19 | 20 |
20 /// Option for hiding whitelisted messages. | 21 /// Option for hiding whitelisted messages. |
21 const String HIDE_WHITELISTED = '--hide-whitelisted'; | 22 const String HIDE_WHITELISTED = '--hide-whitelisted'; |
22 | 23 |
23 /** | 24 /** |
24 * Map of whitelisted warnings and errors. | 25 * Map of whitelisted warnings and errors. |
25 * | 26 * |
26 * Only add a whitelisting together with a bug report to dartbug.com and add | 27 * Only add a whitelisting together with a bug report to dartbug.com and add |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 if (options.contains(Flags.verbose)) { | 220 if (options.contains(Flags.verbose)) { |
220 handler.verbose = true; | 221 handler.verbose = true; |
221 } | 222 } |
222 if (options.contains(HIDE_WHITELISTED)) { | 223 if (options.contains(HIDE_WHITELISTED)) { |
223 handler.showWhitelisted = false; | 224 handler.showWhitelisted = false; |
224 } | 225 } |
225 var compiler = new CompilerImpl( | 226 var compiler = new CompilerImpl( |
226 provider, | 227 provider, |
227 null, | 228 null, |
228 handler, | 229 handler, |
229 new new_api.CompilerOptions.parse( | 230 new CompilerOptions.parse( |
230 libraryRoot: libraryRoot, | 231 libraryRoot: libraryRoot, |
231 packageRoot: packageRoot, | 232 packageRoot: packageRoot, |
232 options: options, | 233 options: options, |
233 environment: {})); | 234 environment: {})); |
234 String MESSAGE = """ | 235 String MESSAGE = """ |
235 | 236 |
236 | 237 |
237 === | 238 === |
238 === ERROR: Unexpected result of analysis. | 239 === ERROR: Unexpected result of analysis. |
239 === | 240 === |
(...skipping 19 matching lines...) Expand all Loading... |
259 if (checkResults != null) { | 260 if (checkResults != null) { |
260 result = checkResults(compiler, handler); | 261 result = checkResults(compiler, handler); |
261 } else { | 262 } else { |
262 result = handler.checkResults(); | 263 result = handler.checkResults(); |
263 } | 264 } |
264 if (!result) { | 265 if (!result) { |
265 print(MESSAGE); | 266 print(MESSAGE); |
266 exit(1); | 267 exit(1); |
267 } | 268 } |
268 } | 269 } |
OLD | NEW |